1 ////////////////////////////////////////////////////////////////////////////
3 // Copyright 2016 Realm Inc.
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
17 ////////////////////////////////////////////////////////////////////////////
19 #import <Foundation/Foundation.h>
21 #import "RLMSyncUtil_Private.h"
23 NS_ASSUME_NONNULL_BEGIN
25 /// An abstract class representing a server endpoint.
26 @interface RLMSyncServerEndpoint : NSObject RLM_SYNC_UNINITIALIZABLE
29 /// The authentication endpoint.
30 @interface RLMSyncAuthEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
31 + (instancetype)endpoint;
34 /// The password change endpoint.
35 @interface RLMSyncChangePasswordEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
36 + (instancetype)endpoint;
39 /// The get user info endpoint.
40 @interface RLMSyncGetUserInfoEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
41 + (instancetype)endpoint;
45 A simple Realm Object Server network client that wraps `NSURLSession`.
47 @interface RLMNetworkClient : NSObject
49 + (void)sendRequestToEndpoint:(RLMSyncServerEndpoint *)endpoint
50 server:(NSURL *)serverURL
51 JSON:(NSDictionary *)jsonDictionary
52 completion:(RLMSyncCompletionBlock)completionBlock;
54 + (void)sendRequestToEndpoint:(RLMSyncServerEndpoint *)endpoint
55 server:(NSURL *)serverURL
56 JSON:(NSDictionary *)jsonDictionary
57 timeout:(NSTimeInterval)timeout
58 completion:(RLMSyncCompletionBlock)completionBlock;