RealmSwift-Swift.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. // Generated by Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)
  2. #pragma clang diagnostic push
  3. #if defined(__has_include) && __has_include(<swift/objc-prologue.h>)
  4. # include <swift/objc-prologue.h>
  5. #endif
  6. #pragma clang diagnostic ignored "-Wauto-import"
  7. #include <objc/NSObject.h>
  8. #include <stdint.h>
  9. #include <stddef.h>
  10. #include <stdbool.h>
  11. #if !defined(SWIFT_TYPEDEFS)
  12. # define SWIFT_TYPEDEFS 1
  13. # if defined(__has_include) && __has_include(<uchar.h>)
  14. # include <uchar.h>
  15. # elif !defined(__cplusplus) || __cplusplus < 201103L
  16. typedef uint_least16_t char16_t;
  17. typedef uint_least32_t char32_t;
  18. # endif
  19. typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
  20. typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
  21. typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
  22. typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
  23. typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
  24. typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
  25. typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
  26. typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
  27. typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
  28. typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
  29. typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
  30. typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
  31. #endif
  32. #if !defined(SWIFT_PASTE)
  33. # define SWIFT_PASTE_HELPER(x, y) x##y
  34. # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
  35. #endif
  36. #if !defined(SWIFT_METATYPE)
  37. # define SWIFT_METATYPE(X) Class
  38. #endif
  39. #if !defined(SWIFT_CLASS_PROPERTY)
  40. # if __has_feature(objc_class_property)
  41. # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
  42. # else
  43. # define SWIFT_CLASS_PROPERTY(...)
  44. # endif
  45. #endif
  46. #if defined(__has_attribute) && __has_attribute(objc_runtime_name)
  47. # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
  48. #else
  49. # define SWIFT_RUNTIME_NAME(X)
  50. #endif
  51. #if defined(__has_attribute) && __has_attribute(swift_name)
  52. # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
  53. #else
  54. # define SWIFT_COMPILE_NAME(X)
  55. #endif
  56. #if defined(__has_attribute) && __has_attribute(objc_method_family)
  57. # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
  58. #else
  59. # define SWIFT_METHOD_FAMILY(X)
  60. #endif
  61. #if defined(__has_attribute) && __has_attribute(noescape)
  62. # define SWIFT_NOESCAPE __attribute__((noescape))
  63. #else
  64. # define SWIFT_NOESCAPE
  65. #endif
  66. #if defined(__has_attribute) && __has_attribute(warn_unused_result)
  67. # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
  68. #else
  69. # define SWIFT_WARN_UNUSED_RESULT
  70. #endif
  71. #if !defined(SWIFT_CLASS_EXTRA)
  72. # define SWIFT_CLASS_EXTRA
  73. #endif
  74. #if !defined(SWIFT_PROTOCOL_EXTRA)
  75. # define SWIFT_PROTOCOL_EXTRA
  76. #endif
  77. #if !defined(SWIFT_ENUM_EXTRA)
  78. # define SWIFT_ENUM_EXTRA
  79. #endif
  80. #if !defined(SWIFT_CLASS)
  81. # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
  82. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
  83. # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  84. # else
  85. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  86. # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  87. # endif
  88. #endif
  89. #if !defined(SWIFT_PROTOCOL)
  90. # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  91. # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  92. #endif
  93. #if !defined(SWIFT_EXTENSION)
  94. # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
  95. #endif
  96. #if !defined(OBJC_DESIGNATED_INITIALIZER)
  97. # if defined(__has_attribute) && __has_attribute(objc_designated_initializer)
  98. # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  99. # else
  100. # define OBJC_DESIGNATED_INITIALIZER
  101. # endif
  102. #endif
  103. #if !defined(SWIFT_ENUM)
  104. # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type
  105. # if defined(__has_feature) && __has_feature(generalized_swift_name)
  106. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type
  107. # else
  108. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name)
  109. # endif
  110. #endif
  111. #if !defined(SWIFT_UNAVAILABLE)
  112. # define SWIFT_UNAVAILABLE __attribute__((unavailable))
  113. #endif
  114. #if !defined(SWIFT_UNAVAILABLE_MSG)
  115. # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
  116. #endif
  117. #if !defined(SWIFT_AVAILABILITY)
  118. # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
  119. #endif
  120. #if !defined(SWIFT_DEPRECATED)
  121. # define SWIFT_DEPRECATED __attribute__((deprecated))
  122. #endif
  123. #if !defined(SWIFT_DEPRECATED_MSG)
  124. # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
  125. #endif
  126. #if defined(__has_feature) && __has_feature(modules)
  127. @import Realm;
  128. @import ObjectiveC;
  129. @import Foundation;
  130. @import Realm.Private;
  131. #endif
  132. #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
  133. #pragma clang diagnostic ignored "-Wduplicate-method-arg"
  134. @class RLMRealm;
  135. @class RLMObjectSchema;
  136. @class RLMSchema;
  137. /// <code>Object</code> is a class used to define Realm model objects.
  138. /// In Realm you define your model classes by subclassing <code>Object</code> and adding properties to be managed.
  139. /// You then instantiate and use your custom subclasses instead of using the <code>Object</code> class directly.
  140. /// \code
  141. /// class Dog: Object {
  142. /// dynamic var name: String = ""
  143. /// dynamic var adopted: Bool = false
  144. /// let siblings = List<Dog>()
  145. /// }
  146. ///
  147. /// \endcode<h3>Supported property types</h3>
  148. /// <ul>
  149. /// <li>
  150. /// <code>String</code>, <code>NSString</code>
  151. /// </li>
  152. /// <li>
  153. /// <code>Int</code>
  154. /// </li>
  155. /// <li>
  156. /// <code>Int8</code>, <code>Int16</code>, <code>Int32</code>, <code>Int64</code>
  157. /// </li>
  158. /// <li>
  159. /// <code>Float</code>
  160. /// </li>
  161. /// <li>
  162. /// <code>Double</code>
  163. /// </li>
  164. /// <li>
  165. /// <code>Bool</code>
  166. /// </li>
  167. /// <li>
  168. /// <code>Date</code>, <code>NSDate</code>
  169. /// </li>
  170. /// <li>
  171. /// <code>Data</code>, <code>NSData</code>
  172. /// </li>
  173. /// <li>
  174. /// <code>RealmOptional<T></code> for optional numeric properties
  175. /// </li>
  176. /// <li>
  177. /// <code>Object</code> subclasses, to model many-to-one relationships
  178. /// </li>
  179. /// <li>
  180. /// <code>List<T></code>, to model many-to-many relationships
  181. /// </li>
  182. /// </ul>
  183. /// <code>String</code>, <code>NSString</code>, <code>Date</code>, <code>NSDate</code>, <code>Data</code>, <code>NSData</code> and <code>Object</code> subclass properties can be declared as optional.
  184. /// <code>Int</code>, <code>Int8</code>, <code>Int16</code>, <code>Int32</code>, <code>Int64</code>, <code>Float</code>, <code>Double</code>, <code>Bool</code>, and <code>List</code> properties cannot. To store an optional
  185. /// number, use <code>RealmOptional<Int></code>, <code>RealmOptional<Float></code>, <code>RealmOptional<Double></code>, or <code>RealmOptional<Bool></code> instead,
  186. /// which wraps an optional numeric value.
  187. /// All property types except for <code>List</code> and <code>RealmOptional</code> <em>must</em> be declared as <code>dynamic var</code>. <code>List</code> and
  188. /// <code>RealmOptional</code> properties must be declared as non-dynamic <code>let</code> properties. Swift <code>lazy</code> properties are not allowed.
  189. /// Note that none of the restrictions listed above apply to properties that are configured to be ignored by Realm.
  190. /// <h3>Querying</h3>
  191. /// You can retrieve all objects of a given type from a Realm by calling the <code>objects(_:)</code> instance method.
  192. /// <h3>Relationships</h3>
  193. /// See our <a href="http://realm.io/docs/cocoa">Cocoa guide</a> for more details.
  194. SWIFT_CLASS_NAMED("Object")
  195. @interface RealmSwiftObject : RLMObjectBase
  196. /// Creates an unmanaged instance of a Realm object.
  197. /// Call <code>add(_:)</code> on a <code>Realm</code> instance to add an unmanaged object into that Realm.
  198. /// <ul>
  199. /// <li>
  200. /// see: <code>Realm().add(_:)</code>
  201. /// </li>
  202. /// </ul>
  203. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  204. /// Creates an unmanaged instance of a Realm object.
  205. /// The <code>value</code> argument is used to populate the object. It can be a key-value coding compliant object, an array or
  206. /// dictionary returned from the methods in <code>NSJSONSerialization</code>, or an <code>Array</code> containing one element for each
  207. /// managed property. An exception will be thrown if any required properties are not present and those properties were
  208. /// not defined with default values.
  209. /// When passing in an <code>Array</code> as the <code>value</code> argument, all properties must be present, valid and in the same order as
  210. /// the properties defined in the model.
  211. /// Call <code>add(_:)</code> on a <code>Realm</code> instance to add an unmanaged object into that Realm.
  212. /// \param value The value used to populate the object.
  213. ///
  214. - (nonnull instancetype)initWithValue:(id _Nonnull)value OBJC_DESIGNATED_INITIALIZER;
  215. /// Indicates if the object can no longer be accessed because it is now invalid.
  216. /// An object can no longer be accessed if the object has been deleted from the Realm that manages it, or if
  217. /// <code>invalidate()</code> is called on that Realm.
  218. @property (nonatomic, readonly, getter=isInvalidated) BOOL invalidated;
  219. /// A human-readable description of the object.
  220. @property (nonatomic, readonly, copy) NSString * _Nonnull description;
  221. /// Helper to return the class name for an Object subclass.
  222. @property (nonatomic, readonly, copy) NSString * _Nonnull className;
  223. /// WARNING: This is an internal helper method not intended for public use.
  224. /// :nodoc:
  225. + (Class _Nonnull)objectUtilClass:(BOOL)isSwift SWIFT_WARN_UNUSED_RESULT;
  226. /// Override this method to specify the name of a property to be used as the primary key.
  227. /// Only properties of types <code>String</code> and <code>Int</code> can be designated as the primary key. Primary key properties enforce
  228. /// uniqueness for each value whenever the property is set, which incurs minor overhead. Indexes are created
  229. /// automatically for primary key properties.
  230. ///
  231. /// returns:
  232. /// The name of the property designated as the primary key, or <code>nil</code> if the model has no primary key.
  233. + (NSString * _Nullable)primaryKey SWIFT_WARN_UNUSED_RESULT;
  234. /// Override this method to specify the names of properties to ignore. These properties will not be managed by
  235. /// the Realm that manages the object.
  236. ///
  237. /// returns:
  238. /// An array of property names to ignore.
  239. + (NSArray<NSString *> * _Nonnull)ignoredProperties SWIFT_WARN_UNUSED_RESULT;
  240. /// Returns an array of property names for properties which should be indexed.
  241. /// Only string, integer, boolean, <code>Date</code>, and <code>NSDate</code> properties are supported.
  242. ///
  243. /// returns:
  244. /// An array of property names.
  245. + (NSArray<NSString *> * _Nonnull)indexedProperties SWIFT_WARN_UNUSED_RESULT;
  246. - (id _Nullable)objectForKeyedSubscript:(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
  247. - (void)setObject:(id _Nullable)value forKeyedSubscript:(NSString * _Nonnull)key;
  248. /// Returns whether two Realm objects are equal.
  249. /// Objects are considered equal if and only if they are both managed by the same Realm and point to the same
  250. /// underlying object in the database.
  251. /// \param object The object to compare the receiver to.
  252. ///
  253. - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
  254. /// WARNING: This is an internal initializer not intended for public use.
  255. /// :nodoc:
  256. - (nonnull instancetype)initWithRealm:(RLMRealm * _Nonnull)realm schema:(RLMObjectSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  257. /// WARNING: This is an internal initializer not intended for public use.
  258. /// :nodoc:
  259. - (nonnull instancetype)initWithValue:(id _Nonnull)value schema:(RLMSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  260. @end
  261. /// Object interface which allows untyped getters and setters for Objects.
  262. /// :nodoc:
  263. SWIFT_CLASS("_TtC10RealmSwift13DynamicObject")
  264. @interface DynamicObject : RealmSwiftObject
  265. - (id _Nullable)objectForKeyedSubscript:(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
  266. - (void)setObject:(id _Nullable)value forKeyedSubscript:(NSString * _Nonnull)key;
  267. /// :nodoc:
  268. - (id _Nullable)valueForUndefinedKey:(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
  269. /// :nodoc:
  270. - (void)setValue:(id _Nullable)value forUndefinedKey:(NSString * _Nonnull)key;
  271. /// :nodoc:
  272. + (BOOL)shouldIncludeInDefaultSchema SWIFT_WARN_UNUSED_RESULT;
  273. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  274. - (nonnull instancetype)initWithValue:(id _Nonnull)value OBJC_DESIGNATED_INITIALIZER;
  275. - (nonnull instancetype)initWithRealm:(RLMRealm * _Nonnull)realm schema:(RLMObjectSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  276. - (nonnull instancetype)initWithValue:(id _Nonnull)value schema:(RLMSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  277. @end
  278. /// :nodoc:
  279. /// Internal class. Do not use directly. Used for reflection and initialization
  280. SWIFT_CLASS("_TtC10RealmSwift18LinkingObjectsBase")
  281. @interface LinkingObjectsBase : NSObject <NSFastEnumeration>
  282. @property (nonatomic, readonly, copy) NSString * _Nonnull objectClassName;
  283. @property (nonatomic, readonly, copy) NSString * _Nonnull propertyName;
  284. @property (nonatomic, readonly, strong) RLMResults<RLMObject *> * _Nonnull rlmResults;
  285. - (nonnull instancetype)initFromClassName:(NSString * _Nonnull)objectClassName property:(NSString * _Nonnull)propertyName OBJC_DESIGNATED_INITIALIZER;
  286. - (NSInteger)countByEnumeratingWithState:(NSFastEnumerationState * _Nonnull)state objects:(id _Nullable * _Null_unspecified)buffer count:(NSInteger)len SWIFT_WARN_UNUSED_RESULT;
  287. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  288. @end
  289. /// :nodoc:
  290. /// Internal class. Do not use directly.
  291. SWIFT_CLASS("_TtC10RealmSwift8ListBase")
  292. @interface ListBase : RLMListBase
  293. /// Returns a human-readable description of the objects contained in the List.
  294. @property (nonatomic, readonly, copy) NSString * _Nonnull description;
  295. /// Returns the number of objects in this List.
  296. @property (nonatomic, readonly) NSInteger count;
  297. - (nonnull instancetype)initWithArray:(RLMArray<RLMObject *> * _Nonnull)array OBJC_DESIGNATED_INITIALIZER;
  298. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  299. @end
  300. @interface NSDate (SWIFT_EXTENSION(RealmSwift))
  301. @end
  302. @interface NSNumber (SWIFT_EXTENSION(RealmSwift))
  303. @end
  304. @interface NSNumber (SWIFT_EXTENSION(RealmSwift))
  305. @end
  306. @interface RealmSwiftObject (SWIFT_EXTENSION(RealmSwift))
  307. - (RLMObject * _Nonnull)unsafeCastToRLMObject SWIFT_WARN_UNUSED_RESULT;
  308. @end
  309. @interface RealmSwiftObject (SWIFT_EXTENSION(RealmSwift))
  310. + (nonnull instancetype)bridgingFrom:(id _Nonnull)objectiveCValue with:(id _Nullable)metadata SWIFT_WARN_UNUSED_RESULT;
  311. @end
  312. /// :nodoc:
  313. /// Internal class. Do not use directly.
  314. SWIFT_CLASS_NAMED("ObjectUtil")
  315. @interface RealmSwiftObjectUtil : NSObject
  316. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  317. @end
  318. @interface RLMSyncCredentials (SWIFT_EXTENSION(RealmSwift))
  319. @end
  320. @interface RLMSyncManager (SWIFT_EXTENSION(RealmSwift))
  321. /// The sole instance of the singleton.
  322. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) RLMSyncManager * _Nonnull shared;)
  323. + (RLMSyncManager * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT;
  324. @end
  325. @class RLMSyncPermissionValue;
  326. @interface RLMSyncPermissionResults (SWIFT_EXTENSION(RealmSwift))
  327. - (RLMSyncPermissionValue * _Nonnull)objectAtIndexedSubscript:(NSInteger)index SWIFT_WARN_UNUSED_RESULT;
  328. - (NSInteger)indexAfter:(NSInteger)i SWIFT_WARN_UNUSED_RESULT;
  329. @property (nonatomic, readonly) NSInteger startIndex;
  330. @property (nonatomic, readonly) NSInteger endIndex;
  331. @end
  332. @interface RLMSyncSession (SWIFT_EXTENSION(RealmSwift))
  333. @end
  334. @interface RLMSyncUser (SWIFT_EXTENSION(RealmSwift))
  335. /// A dictionary of all valid, logged-in user identities corresponding to their <code>SyncUser</code> objects.
  336. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSDictionary<NSString *, RLMSyncUser *> * _Nonnull all;)
  337. + (NSDictionary<NSString *, RLMSyncUser *> * _Nonnull)all SWIFT_WARN_UNUSED_RESULT;
  338. /// The logged-in user. <code>nil</code> if none exists. Only use this property if your application expects
  339. /// no more than one logged-in user at any given time.
  340. /// warning:
  341. /// Throws an Objective-C exception if more than one logged-in user exists.
  342. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) RLMSyncUser * _Nullable current;)
  343. + (RLMSyncUser * _Nullable)current SWIFT_WARN_UNUSED_RESULT;
  344. @end
  345. /// This model is used to reflect permissions.
  346. /// It should be used in conjunction with a <code>SyncUser</code>’s Permission Realm.
  347. /// You can only read this Realm. Use the objects in Management Realm to
  348. /// make request for modifications of permissions.
  349. /// See https://realm.io/docs/realm-object-server/#permissions for general
  350. /// documentation.
  351. SWIFT_CLASS("_TtC10RealmSwift14SyncPermission")
  352. @interface SyncPermission : RealmSwiftObject
  353. /// The date this object was last modified.
  354. @property (nonatomic, copy) NSDate * _Nonnull updatedAt;
  355. /// The ID of the affected user by the permission.
  356. @property (nonatomic, copy) NSString * _Nonnull userId;
  357. /// The path to the realm.
  358. @property (nonatomic, copy) NSString * _Nonnull path;
  359. /// Whether the affected user is allowed to read from the Realm.
  360. @property (nonatomic) BOOL mayRead;
  361. /// Whether the affected user is allowed to write to the Realm.
  362. @property (nonatomic) BOOL mayWrite;
  363. /// Whether the affected user is allowed to manage the access rights for others.
  364. @property (nonatomic) BOOL mayManage;
  365. /// :nodoc:
  366. + (BOOL)shouldIncludeInDefaultSchema SWIFT_WARN_UNUSED_RESULT;
  367. /// :nodoc:
  368. + (NSString * _Nullable)_realmObjectName SWIFT_WARN_UNUSED_RESULT;
  369. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  370. - (nonnull instancetype)initWithValue:(id _Nonnull)value OBJC_DESIGNATED_INITIALIZER;
  371. - (nonnull instancetype)initWithRealm:(RLMRealm * _Nonnull)realm schema:(RLMObjectSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  372. - (nonnull instancetype)initWithValue:(id _Nonnull)value schema:(RLMSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  373. @end
  374. /// This model is used for requesting changes to a Realm’s permissions.
  375. /// It should be used in conjunction with a <code>SyncUser</code>’s Management Realm.
  376. /// See https://realm.io/docs/realm-object-server/#permissions for general
  377. /// documentation.
  378. SWIFT_CLASS("_TtC10RealmSwift20SyncPermissionChange")
  379. @interface SyncPermissionChange : RealmSwiftObject
  380. /// The globally unique ID string of this permission change object.
  381. @property (nonatomic, copy) NSString * _Nonnull id;
  382. /// The date this object was initially created.
  383. @property (nonatomic, copy) NSDate * _Nonnull createdAt;
  384. /// The date this object was last modified.
  385. @property (nonatomic, copy) NSDate * _Nonnull updatedAt;
  386. /// An error or informational message, typically written to by the Realm Object Server.
  387. @property (nonatomic, copy) NSString * _Nullable statusMessage;
  388. /// Sync management object status.
  389. @property (nonatomic, readonly) RLMSyncManagementObjectStatus status;
  390. /// The remote URL to the realm.
  391. @property (nonatomic, copy) NSString * _Nonnull realmUrl;
  392. /// The identity of a user affected by this permission change.
  393. @property (nonatomic, copy) NSString * _Nonnull userId;
  394. /// :nodoc:
  395. + (NSString * _Nullable)primaryKey SWIFT_WARN_UNUSED_RESULT;
  396. /// :nodoc:
  397. + (BOOL)shouldIncludeInDefaultSchema SWIFT_WARN_UNUSED_RESULT;
  398. /// :nodoc:
  399. + (NSString * _Nullable)_realmObjectName SWIFT_WARN_UNUSED_RESULT;
  400. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  401. - (nonnull instancetype)initWithValue:(id _Nonnull)value OBJC_DESIGNATED_INITIALIZER;
  402. - (nonnull instancetype)initWithRealm:(RLMRealm * _Nonnull)realm schema:(RLMObjectSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  403. - (nonnull instancetype)initWithValue:(id _Nonnull)value schema:(RLMSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  404. @end
  405. /// This model is used for offering permission changes to other users.
  406. /// It should be used in conjunction with a <code>SyncUser</code>’s Management Realm.
  407. /// See https://realm.io/docs/realm-object-server/#permissions for general
  408. /// documentation.
  409. SWIFT_CLASS("_TtC10RealmSwift19SyncPermissionOffer")
  410. @interface SyncPermissionOffer : RealmSwiftObject
  411. /// The globally unique ID string of this permission offer object.
  412. @property (nonatomic, copy) NSString * _Nonnull id;
  413. /// The date this object was initially created.
  414. @property (nonatomic, copy) NSDate * _Nonnull createdAt;
  415. /// The date this object was last modified.
  416. @property (nonatomic, copy) NSDate * _Nonnull updatedAt;
  417. /// An error or informational message, typically written to by the Realm Object Server.
  418. @property (nonatomic, copy) NSString * _Nullable statusMessage;
  419. /// Sync management object status.
  420. @property (nonatomic, readonly) RLMSyncManagementObjectStatus status;
  421. /// A token which uniquely identifies this offer. Generated by the server.
  422. @property (nonatomic, copy) NSString * _Nullable token;
  423. /// The remote URL to the realm.
  424. @property (nonatomic, copy) NSString * _Nonnull realmUrl;
  425. /// Whether this offer allows the receiver to read from the Realm.
  426. @property (nonatomic) BOOL mayRead;
  427. /// Whether this offer allows the receiver to write to the Realm.
  428. @property (nonatomic) BOOL mayWrite;
  429. /// Whether this offer allows the receiver to manage the access rights for others.
  430. @property (nonatomic) BOOL mayManage;
  431. /// When this token will expire and become invalid.
  432. @property (nonatomic, copy) NSDate * _Nullable expiresAt;
  433. /// Construct a permission offer object used to offer permission changes to other users.
  434. /// \param realmURL The URL to the Realm on which to apply these permission changes
  435. /// to, once the offer is accepted.
  436. ///
  437. /// \param expiresAt When this token will expire and become invalid.
  438. /// Pass <code>nil</code> if this offer should not expire.
  439. ///
  440. /// \param mayRead Grant or revoke read access.
  441. ///
  442. /// \param mayWrite Grant or revoked read-write access.
  443. ///
  444. /// \param mayManage Grant or revoke administrative access.
  445. ///
  446. - (nonnull instancetype)initWithRealmURL:(NSString * _Nonnull)realmURL expiresAt:(NSDate * _Nullable)expiresAt mayRead:(BOOL)mayRead mayWrite:(BOOL)mayWrite mayManage:(BOOL)mayManage;
  447. /// :nodoc:
  448. + (NSArray<NSString *> * _Nonnull)indexedProperties SWIFT_WARN_UNUSED_RESULT;
  449. /// :nodoc:
  450. + (NSString * _Nullable)primaryKey SWIFT_WARN_UNUSED_RESULT;
  451. /// :nodoc:
  452. + (BOOL)shouldIncludeInDefaultSchema SWIFT_WARN_UNUSED_RESULT;
  453. /// :nodoc:
  454. + (NSString * _Nullable)_realmObjectName SWIFT_WARN_UNUSED_RESULT;
  455. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  456. - (nonnull instancetype)initWithValue:(id _Nonnull)value OBJC_DESIGNATED_INITIALIZER;
  457. - (nonnull instancetype)initWithRealm:(RLMRealm * _Nonnull)realm schema:(RLMObjectSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  458. - (nonnull instancetype)initWithValue:(id _Nonnull)value schema:(RLMSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  459. @end
  460. /// This model is used to apply permission changes defined in the permission offer
  461. /// object represented by the specified token, which was created by another user’s
  462. /// <code>SyncPermissionOffer</code> object.
  463. /// It should be used in conjunction with a <code>SyncUser</code>’s Management Realm.
  464. /// See https://realm.io/docs/realm-object-server/#permissions for general
  465. /// documentation.
  466. SWIFT_CLASS("_TtC10RealmSwift27SyncPermissionOfferResponse")
  467. @interface SyncPermissionOfferResponse : RealmSwiftObject
  468. /// The globally unique ID string of this permission offer response object.
  469. @property (nonatomic, copy) NSString * _Nonnull id;
  470. /// The date this object was initially created.
  471. @property (nonatomic, copy) NSDate * _Nonnull createdAt;
  472. /// The date this object was last modified.
  473. @property (nonatomic, copy) NSDate * _Nonnull updatedAt;
  474. /// An error or informational message, typically written to by the Realm Object Server.
  475. @property (nonatomic, copy) NSString * _Nullable statusMessage;
  476. /// Sync management object status.
  477. @property (nonatomic, readonly) RLMSyncManagementObjectStatus status;
  478. /// The received token which uniquely identifies another user’s <code>SyncPermissionOffer</code>.
  479. @property (nonatomic, copy) NSString * _Nonnull token;
  480. /// The remote URL to the realm on which these permission changes were applied.
  481. @property (nonatomic, copy) NSString * _Nullable realmUrl;
  482. /// Construct a permission offer response object used to apply permission changes
  483. /// defined in the permission offer object represented by the specified token,
  484. /// which was created by another user’s <code>SyncPermissionOffer</code> object.
  485. /// \param token The received token which uniquely identifies another user’s
  486. /// <code>SyncPermissionOffer</code>.
  487. ///
  488. - (nonnull instancetype)initWithToken:(NSString * _Nonnull)token;
  489. /// :nodoc:
  490. + (NSString * _Nullable)primaryKey SWIFT_WARN_UNUSED_RESULT;
  491. /// :nodoc:
  492. + (BOOL)shouldIncludeInDefaultSchema SWIFT_WARN_UNUSED_RESULT;
  493. /// :nodoc:
  494. + (NSString * _Nullable)_realmObjectName SWIFT_WARN_UNUSED_RESULT;
  495. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  496. - (nonnull instancetype)initWithValue:(id _Nonnull)value OBJC_DESIGNATED_INITIALIZER;
  497. - (nonnull instancetype)initWithRealm:(RLMRealm * _Nonnull)realm schema:(RLMObjectSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  498. - (nonnull instancetype)initWithValue:(id _Nonnull)value schema:(RLMSchema * _Nonnull)schema OBJC_DESIGNATED_INITIALIZER;
  499. @end
  500. #pragma clang diagnostic pop