DBSHARINGLinkPassword

Objective-C

@interface DBSHARINGLinkPassword : NSObject <DBSerializable, NSCopying>

Swift

class DBSHARINGLinkPassword : NSObject, DBSerializable, NSCopying

The LinkPassword union.

This class implements the DBSerializable protocol (serialize and deserialize instance methods), which is required for all Obj-C SDK API route objects.

Instance fields

  • tag

    Represents the union’s current tag state.

    Declaration

    Objective-C

    @property (nonatomic, readonly) DBSHARINGLinkPasswordTag tag;

    Swift

    var tag: DBSHARINGLinkPasswordTag { get }
  • Set a new password or change an existing password. - note: Ensure the isSetPassword method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull setPassword;

    Swift

    var setPassword: String { get }

Constructors

  • Initializes union class with tag state of “remove_password”.

    Description of the “remove_password” tag state: Remove the currently set password for the link.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithRemovePassword;

    Swift

    init(removePassword: ())

    Return Value

    An initialized instance.

  • Initializes union class with tag state of “set_password”.

    Description of the “set_password” tag state: Set a new password or change an existing password.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSetPassword:(nonnull NSString *)setPassword;

    Swift

    init(setPassword: String)

    Parameters

    setPassword

    Set a new password or change an existing password.

    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.

Tag state methods

  • Retrieves whether the union’s current tag state has value “remove_password”.

    Declaration

    Objective-C

    - (BOOL)isRemovePassword;

    Swift

    func isRemove() -> Bool

    Return Value

    Whether the union’s current tag state has value “remove_password”.

  • Retrieves whether the union’s current tag state has value “set_password”.

    Note

    Call this method and ensure it returns true before accessing the setPassword property, otherwise a runtime exception will be thrown.

    Declaration

    Objective-C

    - (BOOL)isSetPassword;

    Swift

    func isSetPassword() -> Bool

    Return Value

    Whether the union’s current tag state has value “set_password”.

  • 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.