forked from octokit/octokit.objc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OCTServer.h
47 lines (36 loc) · 1.4 KB
/
OCTServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// OCTServer.h
// OctoKit
//
// Created by Alan Rogers on 18/10/12.
// Copyright (c) 2012 GitHub. All rights reserved.
//
#import <Mantle/Mantle.h>
// The default URL scheme to use for Enterprise URLs, if none is explicitly
// known or specified.
extern NSString * const OCTServerDefaultEnterpriseScheme;
// The HTTPS URL scheme to use for Enterprise URLs.
extern NSString * const OCTServerHTTPSEnterpriseScheme;
// Represents a GitHub server instance
// (ie. github.com or an Enterprise instance)
@interface OCTServer : MTLModel
// Returns YES if this is an Enterprise instance
@property (nonatomic, assign, getter = isEnterprise, readonly) BOOL enterprise;
// The base URL to the instance associated with this server
@property (nonatomic, copy, readonly) NSURL *baseURL;
// The base URL to the API we should use for requests to this server
// (i.e., Enterprise or github.com).
//
// This URL is constructed from the baseURL.
@property (nonatomic, copy, readonly) NSURL *APIEndpoint;
// The base URL to the website for the instance (the
// Enterprise landing page or github.com).
//
// This URL is constructed from the baseURL.
@property (nonatomic, copy, readonly) NSURL *baseWebURL;
// Returns the github.com server instance
+ (instancetype)dotComServer;
// Returns either the Enterprise instance for a given base URL, or +dotComServer
// if `baseURL` is nil.
+ (instancetype)serverWithBaseURL:(NSURL *)baseURL;
@end