DBCOMMONPathRoot

Objective-C

@interface DBCOMMONPathRoot : NSObject <DBSerializable, NSCopying>

Swift

class DBCOMMONPathRoot : NSObject, DBSerializable, NSCopying

The PathRoot 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) DBCOMMONPathRootTag tag;

    Swift

    var tag: DBCOMMONPathRootTag { get }
  • Paths are relative to the authenticating user’s root namespace (This results in invalidRoot in DBCOMMONPathRootError if the user’s root namespace has changed.). - note: Ensure the isRoot method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

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

    Swift

    var root: String { get }
  • Paths are relative to given namespace id (This results in noPermission in DBCOMMONPathRootError if you don’t have access to this namespace.). @note Ensure the isNamespaceId method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

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

    Swift

    var namespaceId: String { get }

Constructors

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

    Description of the “home” tag state: Paths are relative to the authenticating user’s home namespace, whether or not that user belongs to a team.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithHome;

    Swift

    init(home: ())

    Return Value

    An initialized instance.

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

    Description of the “root” tag state: Paths are relative to the authenticating user’s root namespace (This results in invalidRoot in DBCOMMONPathRootError if the user’s root namespace has changed.).

    Declaration

    Objective-C

    - (nonnull instancetype)initWithRoot:(nonnull NSString *)root;

    Swift

    init(root: String)

    Parameters

    root

    Paths are relative to the authenticating user’s root namespace (This results in invalidRoot in DBCOMMONPathRootError if the user’s root namespace has changed.).

    Return Value

    An initialized instance.

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

    Description of the “namespace_id” tag state: Paths are relative to given namespace id (This results in noPermission in DBCOMMONPathRootError if you don’t have access to this namespace.).

    Declaration

    Objective-C

    - (nonnull instancetype)initWithNamespaceId:(nonnull NSString *)namespaceId;

    Swift

    init(namespaceId: String)

    Parameters

    namespaceId

    Paths are relative to given namespace id (This results in noPermission in DBCOMMONPathRootError if you don’t have access to this namespace.).

    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 “home”.

    Declaration

    Objective-C

    - (BOOL)isHome;

    Swift

    func isHome() -> Bool

    Return Value

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

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

    Note

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

    Declaration

    Objective-C

    - (BOOL)isRoot;

    Swift

    func isRoot() -> Bool

    Return Value

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

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

    Note

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

    Declaration

    Objective-C

    - (BOOL)isNamespaceId;

    Swift

    func isNamespaceId() -> Bool

    Return Value

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

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