This repository was archived by the owner on Sep 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathServiceRemoteWordPressComREST.h
More file actions
52 lines (42 loc) · 1.58 KB
/
ServiceRemoteWordPressComREST.h
File metadata and controls
52 lines (42 loc) · 1.58 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
#import <Foundation/Foundation.h>
#import <WordPressKit/WordPressComRESTAPIInterfacing.h>
#import <WordPressKit/WordPressComRESTAPIVersion.h>
@class WordPressComRestApi;
NS_ASSUME_NONNULL_BEGIN
/**
* @class ServiceRemoteREST
* @brief Parent class for all REST service classes.
*/
@interface ServiceRemoteWordPressComREST : NSObject
/**
* @brief The API object to use for communications.
*/
// TODO: This needs to go before being able to put this ObjC in a package.
@property (nonatomic, strong, readonly) WordPressComRestApi *wordPressComRestApi;
/**
* @brief The interface to the WordPress.com API to use for performing REST requests.
* This is meant to gradually replace `wordPressComRestApi`.
*/
@property (nonatomic, strong, readonly) id<WordPressComRESTAPIInterfacing> wordPressComRESTAPI;
/**
* @brief Designated initializer.
*
* @param api The API to use for communication. Cannot be nil.
*
* @returns The initialized object.
*/
- (instancetype)initWithWordPressComRestApi:(WordPressComRestApi *)api;
#pragma mark - Request URL construction
/**
* @brief Constructs the request URL for the specified API version and specified resource URL.
*
* @param endpoint The URL of the resource for the request. Cannot be nil.
* @param apiVersion The version of the API to use.
*
* @returns The request URL.
*/
- (NSString *)pathForEndpoint:(NSString *)endpoint
withVersion:(WordPressComRESTAPIVersion)apiVersion
NS_SWIFT_NAME(path(forEndpoint:withVersion:));
@end
NS_ASSUME_NONNULL_END