DBOAuthResult

@interface DBOAuthResult : NSObject

Union result type from OAuth linking attempt.

  • tag

    Represents the DBOAuthResult object’s current tag state.

    Declaration

    Objective-C

    @property (readonly, nonatomic) DBOAuthResultTag tag;

    Swift

    var tag: DBOAuthResultTag { get }
  • The access token that is retrieved in the event of a successful OAuth authorization.

    Note

    Ensure the isSuccess method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

    @property (readonly, nonatomic) DBAccessToken *_Nonnull accessToken;

    Swift

    var accessToken: DBAccessToken { get }
  • The type of OAuth error that is returned in the event of an unsuccessful OAuth authorization.

    Note

    Ensure the isError method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

    @property (readonly, nonatomic) DBOAuthErrorType errorType;

    Swift

    var errorType: DBOAuthErrorType { get }
  • The error description string associated with the DBAuthErrorType that is returned in the event of an unsuccessful OAuth authorization.

    Note

    Ensure the isError method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

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

    Swift

    var errorDescription: String { get }
  • Initializes union class with tag state of success.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSuccess:(nonnull DBAccessToken *)accessToken;

    Swift

    init(success accessToken: DBAccessToken)

    Parameters

    accessToken

    The DBAccessToken (account_id / team_id and OAuth token pair) retrieved from the authorization flow.

    Return Value

    An initialized DBOAuthResult instance.

  • Initializes union class with tag state of error.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithError:(nonnull NSString *)errorType
                         errorDescription:(nonnull NSString *)errorDescription;

    Swift

    init(error errorType: String, errorDescription: String)

    Parameters

    errorType

    The string identifier of the OAuth error type (lookup performed in errorTypeLookup dict).

    errorDescription

    A short description of the error that occured during the authorization flow.

    Return Value

    An initialized DBOAuthResult instance.

  • Initializes union class with tag state of cancel.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCancel;

    Swift

    init(cancel: ())

    Return Value

    An initialized DBOAuthResult instance.

  • Retrieves whether the union’s current tag state has value success.

    Declaration

    Objective-C

    - (BOOL)isSuccess;

    Swift

    func isSuccess() -> Bool

    Return Value

    Whether the union’s current tag state has value success.

  • Retrieves whether the union’s current tag state has value error.

    Declaration

    Objective-C

    - (BOOL)isError;

    Swift

    func isError() -> Bool

    Return Value

    Whether the union’s current tag state has value error.

  • Retrieves whether the union’s current tag state has value cancel.

    Declaration

    Objective-C

    - (BOOL)isCancel;

    Swift

    func isCancel() -> Bool

    Return Value

    Whether the union’s current tag state has value cancel.

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

  • Description method.

    Declaration

    Objective-C

    - (nonnull NSString *)description;

    Swift

    func description() -> String

    Return Value

    A human-readable representation of the current object.