-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCSIOAPIURLs.m
More file actions
93 lines (76 loc) · 2.83 KB
/
CSIOAPIURLs.m
File metadata and controls
93 lines (76 loc) · 2.83 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
// CSIOAPIURLs.m
// Contentstack
//
// Created by Reefaq on 13/07/15.
// Copyright (c) 2015 Contentstack. All rights reserved.
//
#import "CSIOAPIURLs.h"
#import "CSIOConstants.h"
@implementation CSIOAPIURLs
//MARK: URLs -
// Query
static NSString *fetchContentTypeEntriesQuery = @"/%@/content_types/%@/entries";
// Entry
static NSString *fetchEntry = @"/%@/content_types/%@/entries/%@";
// Asset
static NSString *fetchAsset = @"/%@/assets/%@";
// AssetLibrary
static NSString *fetchAssetLibrary = @"/%@/assets";
//stack
static NSString *fetchLastActivity = @"/%@/content_types";
// stack
static NSString *fetchSchema = @"/%@/content_types";
// Content Type
static NSString *fetchContentTypeSchema = @"/%@/content_types/%@";
// sync
static NSString *syncData = @"/%@/stacks/sync";
// Taxonomy
static NSString *fetchTaxonomyWithVersion = @"/%@/taxonomies/entries";
//GlobalField
static NSString *fetchGlobalFieldWithVersion = @"/%@/global_fields/%@";
//GlobalFields
static NSString *findGlobalFieldsWithVersion = @"/%@/global_fields";
//MARK: Methods -
//stack
+(NSString *)fetchSchemaWithVersion:(NSString*)version {
return [NSString stringWithFormat:fetchSchema,version];
}
//stack
+(NSString *)fetchContenTypeSchema:(NSString*)contentTypeUID withVersion:(NSString*)version {
return [NSString stringWithFormat:fetchContentTypeSchema, version, contentTypeUID];
}
//Taxonomy
+(NSString *)fetchTaxonomyWithVersion:(NSString*)version {
return [NSString stringWithFormat:fetchTaxonomyWithVersion, version];
}
//Query
+(NSString *)fetchContentTypeEntriesQueryURLWithUID:(NSString *)contentTypeUID withVersion:(NSString*)version{
return [NSString stringWithFormat:fetchContentTypeEntriesQuery,version,contentTypeUID];
}
//Entry
+ (NSString *)fetchEntryURLWithContentTypeUID:(NSString *)contentTypeUID entryUID:(NSString*)entryUID withVersion:(NSString*)version; {
return [NSString stringWithFormat:fetchEntry,version,contentTypeUID,entryUID];
}
+ (NSString *)fetchContentTypeSchemaQueryURLWithVersion:(NSString *)version {
return [NSString stringWithFormat:fetchLastActivity,version];
}
//Asset
+ (NSString *)fetchAssetWithUID:(NSString*)assetUID withVersion:(NSString*)version {
return [NSString stringWithFormat:fetchAsset,version,assetUID];
}
//AssetLibrary
+ (NSString *)fetchAssetLibraryWithVersion:(NSString*)version{
return [NSString stringWithFormat:fetchAssetLibrary,version];
}
//sync
+(NSString *)syncWithVersion:(NSString*)version {
return [NSString stringWithFormat:syncData,version];
}
+(NSString*)fetchGlobalFieldWithVersion:(NSString*)globalFieldUID withVersion:(NSString*)version {
return [NSString stringWithFormat:fetchGlobalFieldWithVersion, version, globalFieldUID];
}
+(NSString*)findGlobalFieldsWithVersion:(NSString*)version {
return [NSString stringWithFormat:findGlobalFieldsWithVersion, version];
}
@end