DBAUTHAuthError

Objective-C

@interface DBAUTHAuthError : NSObject <DBSerializable, NSCopying>

Swift

class DBAUTHAuthError : NSObject, DBSerializable, NSCopying

The AuthError union.

Errors occurred during authentication.

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) DBAUTHAuthErrorTag tag;

    Swift

    var tag: DBAUTHAuthErrorTag { get }
  • The access token does not have the required scope to access the route. @note Ensure the isMissingScope method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

    @property (nonatomic, readonly) DBAUTHTokenScopeError *_Nonnull missingScope;

    Swift

    var missingScope: DBAUTHTokenScopeError { get }

Constructors

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

    Description of the “invalid_access_token” tag state: The access token is invalid.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithInvalidAccessToken;

    Swift

    init(invalidAccessToken: ())

    Return Value

    An initialized instance.

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

    Description of the “invalid_select_user” tag state: The user specified in ‘Dropbox-API-Select-User’ is no longer on the team.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithInvalidSelectUser;

    Swift

    init(invalidSelectUser: ())

    Return Value

    An initialized instance.

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

    Description of the “invalid_select_admin” tag state: The user specified in ‘Dropbox-API-Select-Admin’ is not a Dropbox Business team admin.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithInvalidSelectAdmin;

    Swift

    init(invalidSelectAdmin: ())

    Return Value

    An initialized instance.

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

    Description of the “user_suspended” tag state: The user has been suspended.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithUserSuspended;

    Swift

    init(userSuspended: ())

    Return Value

    An initialized instance.

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

    Description of the “expired_access_token” tag state: The access token has expired.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithExpiredAccessToken;

    Swift

    init(expiredAccessToken: ())

    Return Value

    An initialized instance.

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

    Description of the “missing_scope” tag state: The access token does not have the required scope to access the route.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithMissingScope:
        (nonnull DBAUTHTokenScopeError *)missingScope;

    Swift

    init(missingScope: DBAUTHTokenScopeError)

    Parameters

    missingScope

    The access token does not have the required scope to access the route.

    Return Value

    An initialized instance.

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

    Description of the “route_access_denied” tag state: The route is not available to public.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithRouteAccessDenied;

    Swift

    init(routeAccessDenied: ())

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

    Declaration

    Objective-C

    - (BOOL)isInvalidAccessToken;

    Swift

    func isInvalidAccessToken() -> Bool

    Return Value

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

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

    Declaration

    Objective-C

    - (BOOL)isInvalidSelectUser;

    Swift

    func isInvalidSelectUser() -> Bool

    Return Value

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

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

    Declaration

    Objective-C

    - (BOOL)isInvalidSelectAdmin;

    Swift

    func isInvalidSelectAdmin() -> Bool

    Return Value

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

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

    Declaration

    Objective-C

    - (BOOL)isUserSuspended;

    Swift

    func isUserSuspended() -> Bool

    Return Value

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

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

    Declaration

    Objective-C

    - (BOOL)isExpiredAccessToken;

    Swift

    func isExpiredAccessToken() -> Bool

    Return Value

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

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

    Note

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

    Declaration

    Objective-C

    - (BOOL)isMissingScope;

    Swift

    func isMissingScope() -> Bool

    Return Value

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

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

    Declaration

    Objective-C

    - (BOOL)isRouteAccessDenied;

    Swift

    func isRouteAccessDenied() -> Bool

    Return Value

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

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