BaseProvider

public class BaseProvider : AbsioProvider

Provides base functionality for provider instances.

  • The KeyRing for the authenticated user. This will be null if the Provider is not authenticated.

    Throws

    AbsioError.notAuthenticatedError

    Declaration

    Swift

    public func getKeyRing() throws -> KeyRing

    Return Value

    returns KeyRing

  • Gets user id for current key ring

    Throws

    AbsioError.notAuthenticatedError

    Declaration

    Swift

    public func getUserId() throws -> UUID

    Return Value

    return user id for current key ring

Sync operations

  • Creates and persists a new SecuredContainer on the Absio Broker application and returns it. Use the returned value to learn the assigned ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func createContainer(content: Data?, accessLevels: [AccessLevel] = [], type: String? = nil, completionHandler: @escaping (SecuredContainer) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    content

    The container payload.

    accessLevels

    Optional. This is the defined access for all users. If null, the user creating the container will get full access (ContainerAccessLevel.DefaultOwnerPermissions). If any access is defined then the user creating the container will get the defined access or no access if none is defined. By default this list has one access level for creator with default permissions.

    type

    Optional string used to categorize the Container. Default: nil.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The created SecuredContainer.

  • Creates and persists a new SecuredContainer on the Absio Broker application and returns it. Use the returned value to learn the assigned ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func createContainer<T>(content: Data?, customHeaderObject: T?, accessLevels: [AccessLevel] = [], type: String? = nil, completionHandler: @escaping (SecuredContainer) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self where T : Decodable, T : Encodable

    Parameters

    content

    The container payload.

    customHeaderObject

    The optional header portion of the container. This object will be serialized as JSON. Default: null.

    accessLevels

    Optional. This is the defined access for all users. If null, the user creating the container will get full access (ContainerAccessLevel.DefaultOwnerPermissions). If any access is defined then the user creating the container will get the defined access or no access if none is defined. By default this list has one access level for creator with default permissions.

    type

    Optional string used to categorize the Container. Default: nil.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The created SecuredContainer.

  • Update the header of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainerHeader<T>(containerId: UUID, customHeaderObject: T?, completionHandler: @escaping (SecuredContainer) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self where T : Decodable, T : Encodable

    Parameters

    containerId

    The ID of the secured container.

    customHeaderObject

    Optional. The header to be encrypted in the secured container. If not supplied header will be nil.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The updated SecuredContainer.

  • Update the content of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainerContent(containerId: UUID, content: Data?, completionHandler: @escaping (SecuredContainer) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    containerId

    The ID of the secured container.

    content

    Optional. The content to be encrypted in the secured container. If not supplied the content will be null.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The updated SecuredContainer.

  • Update the content, header, access and type of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainer<T>(containerId: UUID, content: Data?, customHeaderObject: T?, accessLevels: [AccessLevel] = [], type: String? = nil, completionHandler: @escaping (SecuredContainer) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self where T : Decodable, T : Encodable

    Parameters

    containerId

    The ID of the secured container.

    content

    The container payload.

    customHeaderObject

    The optional header portion of the container. This object will be serialized as JSON. Default: null.

    accessLevels

    Optional. This is the defined access for all users. If null, the user creating the container will get full access (ContainerAccessLevel.DefaultOwnerPermissions). If any access is defined then the user creating the container will get the defined access or no access if none is defined. By default this list has one access level for creator with default permissions.

    type

    Optional string used to categorize the Container. Default: nil.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The updated SecuredContainer.

  • Update the access of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainerAccessLevels(containerId: UUID, accessLevels: [AccessLevel], completionHandler: @escaping () -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    containerId

    The ID of the secured container.

    accessLevels

    Optional. This is the defined access for all users. If null, the user creating the container will get full access (ContainerAccessLevel.DefaultOwnerPermissions). If any access is defined then the user creating the container will get the defined access or no access if none is defined. By default this list has one access level for creator with default permissions.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

  • Fetches an container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func getContainer(containerId: UUID, completionHandler: @escaping (Container) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    containerId

    The ID of the container.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    Container with content, header, and container metadata.

  • Gets the decrypted header for a secured container. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func getContainerHeader(containerId: UUID, completionHandler: @escaping (Header?) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    containerId

    The ID of the container.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The decrypted header from the container.

  • Gets the decrypted content for a secured container. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func getContainerContent(containerId: UUID, completionHandler: @escaping (Data?) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    containerId

    The ID of the container.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The decrypted data for the secured container.

  • Gets the metadata for a secured container. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func getContainerMetadata(containerId: UUID, completionHandler: @escaping (Container) -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    containerId

    The ID of the container.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The metadata for the requested container.

  • Deletes the secured container with the given ID from the Absio Broker application. The encrypted content and associated metadata will be removed. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func deleteContainer(containerId: UUID, completionHandler: @escaping () -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    containerId

    The ID of the container.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

  • Update the type of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainerType(containerId: UUID, type: String?, completionHandler: @escaping () -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    containerId

    The ID of the secured container.

    type

    Optional string used to categorize the Container. Default: nil.

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

    Return Value

    The updated SecuredContainer.

  • This will end an authenticated session. The KeyRing and the authenticated credentials on the rest client will be cleared from memory and

    Throws

    AbsioError

    Declaration

    Swift

    public func logout(completionHandler: @escaping () -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

  • Deletes all associated data for the authenticated user. NOTE: This cannot be undone. Ensure you really want to perform this operation before doing so. All data related to the user will be removed from the Absio Broker application.

    Throws

    AbsioError

    Declaration

    Swift

    public func deleteUser(completionHandler: @escaping () -> Void, errorHandler: @escaping (Error) -> Void, queue: DispatchQueue? = nil) throws -> Self

    Parameters

    completionHandler

    Completion Handler

    errorHandler

    Error Handler

    queue

    Optional. Custom queue to run callback on. If not specified DispatchQueue.main queue will be used

Async operations

  • Creates and persists a new SecuredContainer on the Absio Broker application and returns it. Use the returned value to learn the assigned ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func createContainer(content: Data?, accessLevels: [AccessLevel], type: String?) throws -> Promise<SecuredContainer>

    Parameters

    content

    The container payload.

    accessLevels

    Optional. This is the defined access for all users. If null, the user creating the container will get full access (ContainerAccessLevel.DefaultOwnerPermissions). If any access is defined then the user creating the container will get the defined access or no access if none is defined. By default this list has one access level for creator with default permissions.

    type

    Optional string used to categorize the Container. Default: nil.

    Return Value

    The created SecuredContainer.

  • Creates and persists a new SecuredContainer on the Absio Broker application and returns it. Use the returned value to learn the assigned ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func createContainer<T>(content: Data?, customHeaderObject: T?, accessLevels: [AccessLevel], type: String?) throws -> Promise<SecuredContainer> where T : Decodable, T : Encodable

    Parameters

    content

    The container payload.

    customHeaderObject

    The optional header portion of the container. This object will be serialized as JSON. Default: null.

    accessLevels

    Optional. This is the defined access for all users. If null, the user creating the container will get full access (ContainerAccessLevel.DefaultOwnerPermissions). If any access is defined then the user creating the container will get the defined access or no access if none is defined. By default this list has one access level for creator with default permissions.

    type

    Optional string used to categorize the Container. Default: nil.

    Return Value

    The created SecuredContainer.

  • Update the header of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainerHeader<T>(containerId: UUID, customHeaderObject: T?) throws -> Promise<SecuredContainer> where T : Decodable, T : Encodable

    Parameters

    containerId

    The ID of the secured container.

    customHeaderObject

    Optional. The header to be encrypted in the secured container. If not supplied header will be nil.

    Return Value

    The updated SecuredContainer.

  • Update the content of the secured container with the given ID. Calling this method requires an authenticated session. See logIn for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainerContent(containerId: UUID, content: Data?) throws -> Promise<SecuredContainer>

    Parameters

    containerId

    The ID of the secured container.

    content

    Optional. The content to be encrypted in the secured container. If not supplied the content will be null.

    Return Value

    The updated SecuredContainer.

  • Update the content, header, access and type of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainer<T>(containerId: UUID, content: Data?, customHeaderObject: T?, accessLevels: [AccessLevel], type: String?) throws -> Promise<SecuredContainer> where T : Decodable, T : Encodable

    Parameters

    containerId

    The ID of the secured container.

    content

    The container payload.

    customHeaderObject

    The optional header portion of the container. This object will be serialized as JSON. Default: null.

    accessLevels

    Optional. This is the defined access for all users. If null, the user creating the container will get full access (ContainerAccessLevel.DefaultOwnerPermissions). If any access is defined then the user creating the container will get the defined access or no access if none is defined. By default this list has one access level for creator with default permissions.

    type

    Optional string used to categorize the Container. Default: nil.

    Return Value

    The updated SecuredContainer.

  • Update the access of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainerAccessLevels(containerId: UUID, accessLevels: [AccessLevel]) throws -> Promise<Void>

    Parameters

    containerId

    The ID of the secured container.

    accessLevels

    Optional. This is the defined access for all users. If null, the user creating the container will get full access (ContainerAccessLevel.DefaultOwnerPermissions). If any access is defined then the user creating the container will get the defined access or no access if none is defined. By default this list has one access level for creator with default permissions.

  • Fetches an container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func getContainer(containerId: UUID) throws -> Promise<Container>

    Parameters

    containerId

    The ID of the container.

    Return Value

    Container with content, header, and container metadata.

  • Gets the decrypted header for a secured container. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func getContainerHeader(containerId: UUID) throws -> Promise<Header?>

    Parameters

    containerId

    The ID of the container.

    Return Value

    The decrypted header from the container.

  • Gets the decrypted content for a secured container. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func getContainerContent(containerId: UUID) throws -> Promise<Data?>

    Parameters

    containerId

    The ID of the container.

    Return Value

    The decrypted data for the secured container.

  • Gets the metadata for a secured container. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func getContainerMetadata(containerId: UUID) throws -> Promise<Container>

    Parameters

    containerId

    The ID of the container.

    Return Value

    The metadata for the requested container.

  • Deletes the secured container with the given ID from the Absio Broker application. The encrypted content and associated metadata will be removed. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func deleteContainer(containerId: UUID) throws -> Promise<Void>

    Parameters

    containerId

    The ID of the container.

  • Update the type of the secured container with the given ID. Calling this method requires an authenticated session. See login for authenticating.

    Throws

    AbsioError

    Declaration

    Swift

    public func updateContainerType(containerId: UUID, type: String?) throws -> Promise<Void>

    Parameters

    containerId

    The ID of the secured container.

    type

    Optional string used to categorize the Container. Default: nil.

    Return Value

    The updated SecuredContainer.

  • This will end an authenticated session. The KeyRing and the authenticated credentials on the rest client will be cleared from memory and

    Throws

    AbsioError

    Declaration

    Swift

    public func logout() throws -> Promise<Void>
  • Deletes all associated data for the authenticated user. NOTE: This cannot be undone. Ensure you really want to perform this operation before doing so. All data related to the user will be removed from the Absio Broker application.

    Throws

    AbsioError

    Declaration

    Swift

    public func deleteUser() throws -> Promise<Void>