DBFILESFileLockContent
Objective-C
@interface DBFILESFileLockContent : NSObject <DBSerializable, NSCopying>
Swift
class DBFILESFileLockContent : NSObject, DBSerializable, NSCopying
The FileLockContent
union.
This class implements the DBSerializable
protocol (serialize and
deserialize instance methods), which is required for all Obj-C SDK API route
objects.
-
Represents the union’s current tag state.
Declaration
Objective-C
@property (nonatomic, readonly) DBFILESFileLockContentTag tag;
Swift
var tag: DBFILESFileLockContentTag { get }
-
A lock held by a single user. - note: Ensure the
isSingleUser
method returns true before accessing, otherwise a runtime exception will be raised.Declaration
Objective-C
@property (nonatomic, readonly) DBFILESSingleUserLock *_Nonnull singleUser;
Swift
var singleUser: DBFILESSingleUserLock { get }
-
Initializes union class with tag state of “unlocked”.
Description of the “unlocked” tag state: Empty type to indicate no lock.
Declaration
Objective-C
- (nonnull instancetype)initWithUnlocked;
Swift
init(unlocked: ())
Return Value
An initialized instance.
-
Initializes union class with tag state of “single_user”.
Description of the “single_user” tag state: A lock held by a single user.
Declaration
Objective-C
- (nonnull instancetype)initWithSingleUser: (nonnull DBFILESSingleUserLock *)singleUser;
Swift
init(singleUser: DBFILESSingleUserLock)
Parameters
singleUser
A lock held by a single user.
Return Value
An initialized instance.
-
Initializes union class with tag state of “other”.
Declaration
Objective-C
- (nonnull instancetype)initWithOther;
Swift
init(other: ())
Return Value
An initialized instance.
-
Retrieves whether the union’s current tag state has value “unlocked”.
Declaration
Objective-C
- (BOOL)isUnlocked;
Swift
func isUnlocked() -> Bool
Return Value
Whether the union’s current tag state has value “unlocked”.
-
Retrieves whether the union’s current tag state has value “single_user”.
Note
Call this method and ensure it returns true before accessing the
singleUser
property, otherwise a runtime exception will be thrown.Declaration
Objective-C
- (BOOL)isSingleUser;
Swift
func isSingleUser() -> Bool
Return Value
Whether the union’s current tag state has value “single_user”.
-
Retrieves whether the union’s current tag state has value “other”.
Declaration
Objective-C
- (BOOL)isOther;
Swift
func isOther() -> Bool
Return Value
Whether the union’s current tag state has value “other”.
-
Retrieves string value of union’s current tag state.
Declaration
Objective-C
- (nonnull NSString *)tagName;
Swift
func tagName() -> String
Return Value
A human-readable string representing the union’s current tag state.