RLMSyncPermissionOfferResponse.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 <Realm/Realm.h>
  19. #import <Realm/RLMSyncUtil.h>
  20. NS_ASSUME_NONNULL_BEGIN
  21. /**
  22. This model is used to apply permission changes defined in the permission offer
  23. object represented by the specified token, which was created by another user's
  24. `RLMSyncPermissionOffer` object.
  25. It should be used in conjunction with an `RLMSyncUser`'s Management Realm.
  26. See https://realm.io/docs/realm-object-server/#permissions for general
  27. documentation.
  28. */
  29. @interface RLMSyncPermissionOfferResponse : RLMObject
  30. /// The globally unique ID string of this permission offer response object.
  31. @property (readonly) NSString *id;
  32. /// The date this object was initially created.
  33. @property (readonly) NSDate *createdAt;
  34. /// The date this object was last modified.
  35. @property (readonly) NSDate *updatedAt;
  36. /// The status code of the object that was processed by Realm Object Server.
  37. @property (nullable, readonly) NSNumber<RLMInt> *statusCode;
  38. /// An error or informational message, typically written to by the Realm Object Server.
  39. @property (nullable, readonly) NSString *statusMessage;
  40. /// Sync management object status.
  41. @property (readonly) RLMSyncManagementObjectStatus status;
  42. /// The received token which uniquely identifies another user's `RLMSyncPermissionOffer`.
  43. @property (readonly) NSString *token;
  44. /// The remote URL to the realm on which these permission changes were applied.
  45. /// Generated by the server.
  46. @property (nullable, readonly) NSString *realmUrl;
  47. /**
  48. Construct a permission offer response object used to apply permission changes
  49. defined in the permission offer object represented by the specified token,
  50. which was created by another user's `RLMSyncPermissionOffer` object.
  51. @param token The received token which uniquely identifies another user's
  52. `RLMSyncPermissionOffer`.
  53. */
  54. + (instancetype)permissionOfferResponseWithToken:(NSString *)token;
  55. @end
  56. NS_ASSUME_NONNULL_END