RLMNetworkClient.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 Realm Inc.
  4. //
  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
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  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.
  16. //
  17. ////////////////////////////////////////////////////////////////////////////
  18. #import <Foundation/Foundation.h>
  19. #import "RLMSyncUtil_Private.h"
  20. NS_ASSUME_NONNULL_BEGIN
  21. @interface RLMNetworkRequestOptions : NSObject
  22. @property (nonatomic, copy, nullable) NSString *authorizationHeaderName;
  23. @property (nonatomic, copy, nullable) NSDictionary<NSString *, NSString *> *customHeaders;
  24. @property (nullable, nonatomic, copy) NSDictionary<NSString *, NSURL *> *pinnedCertificatePaths;
  25. @end
  26. /// An abstract class representing a server endpoint.
  27. @interface RLMSyncServerEndpoint : NSObject RLM_SYNC_UNINITIALIZABLE
  28. + (void)sendRequestToServer:(NSURL *)serverURL
  29. JSON:(NSDictionary *)jsonDictionary
  30. completion:(void (^)(NSError *))completionBlock;
  31. + (void)sendRequestToServer:(NSURL *)serverURL
  32. JSON:(NSDictionary *)jsonDictionary
  33. timeout:(NSTimeInterval)timeout
  34. completion:(void (^)(NSError *, NSDictionary *))completionBlock;
  35. @end
  36. @interface RLMSyncAuthEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  37. @end
  38. @interface RLMSyncChangePasswordEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  39. @end
  40. @interface RLMSyncUpdateAccountEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  41. @end
  42. @interface RLMSyncGetUserInfoEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  43. @end
  44. @interface RLMSyncGetPermissionsEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  45. @end
  46. @interface RLMSyncGetPermissionOffersEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  47. @end
  48. @interface RLMSyncApplyPermissionsEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  49. @end
  50. @interface RLMSyncOfferPermissionsEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  51. @end
  52. @interface RLMSyncAcceptPermissionOfferEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  53. @end
  54. @interface RLMSyncInvalidatePermissionOfferEndpoint : RLMSyncServerEndpoint RLM_SYNC_UNINITIALIZABLE
  55. @end
  56. NS_ASSUME_NONNULL_END