added iOS source code
[wl-app.git] / iOS / Pods / Realm / include / RLMSyncConfiguration.h
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
19 #import <Foundation/Foundation.h>
20
21 @class RLMSyncUser;
22
23 NS_ASSUME_NONNULL_BEGIN
24
25 /**
26  A configuration object representing configuration state for a Realm which is intended to sync with a Realm Object
27  Server.
28  */
29 @interface RLMSyncConfiguration : NSObject
30
31 /// The user to which the remote Realm belongs.
32 @property (nonatomic, readonly) RLMSyncUser *user;
33
34 /**
35  The URL of the remote Realm upon the Realm Object Server.
36
37  @warning The URL cannot end with `.realm`, `.realm.lock` or `.realm.management`.
38  */
39 @property (nonatomic, readonly) NSURL *realmURL;
40
41
42 /**
43  Whether SSL certificate validation is enabled for the connection associated
44  with this configuration value. SSL certificate validation is ON by default.
45
46  @warning NEVER disable certificate validation for clients and servers in production.
47  */
48 @property (nonatomic) BOOL enableSSLValidation;
49
50 /**
51  Whether this Realm should be opened in 'partial synchronization' mode.
52  Partial synchronization mode means that no objects are synchronized from the remote Realm
53  except those matching queries that the user explicitly specifies.
54
55  @warning Partial synchronization is a tech preview. Its APIs are subject to change.
56 */
57 @property (nonatomic) BOOL isPartial;
58
59 /**
60  Create a sync configuration instance.
61
62  @param user    A `RLMSyncUser` that owns the Realm at the given URL.
63  @param url     The unresolved absolute URL to the Realm on the Realm Object Server, e.g.
64                 `realm://example.org/~/path/to/realm`. "Unresolved" means the path should
65                 contain the wildcard marker `~`, which will automatically be filled in with
66                 the user identity by the Realm Object Server.
67  */
68 - (instancetype)initWithUser:(RLMSyncUser *)user realmURL:(NSURL *)url;
69
70 /// :nodoc:
71 - (instancetype)init __attribute__((unavailable("This type cannot be created directly")));
72
73 /// :nodoc:
74 + (instancetype)new __attribute__((unavailable("This type cannot be created directly")));
75
76 @end
77
78 NS_ASSUME_NONNULL_END