AWSClient

public final class AWSClient

This is the workhorse of SotoCore. You provide it with a AWSShape Input object, it converts it to AWSRequest which is then converted to a raw HTTPClient Request. This is then sent to AWS. When the response from AWS is received if it is successful it is converted to a AWSResponse which is then decoded to generate a AWSShape Output object. If it is not successful then AWSClient will throw an AWSErrorType.

Member variables

Initialization

API Calls

  • Shutdown client synchronously. Before an AWSClient is deleted you need to call this function or the async version shutdown to do a clean shutdown of the client. It cleans up CredentialProvider tasks and shuts down the HTTP client if it was created by the AWSClient.

    Throws

    AWSClient.ClientError.alreadyShutdown: You have already shutdown the client

    Declaration

    Swift

    public func syncShutdown() throws
  • Shutdown AWSClient asynchronously. Before an AWSClient is deleted you need to call this function or the synchronous version syncShutdown to do a clean shutdown of the client. It cleans up CredentialProvider tasks and shuts down the HTTP client if it was created by the AWSClient. Given we could be destroying the EventLoopGroup the client uses, we have to use a DispatchQueue to run some of this work on.

    Declaration

    Swift

    public func shutdown(queue: DispatchQueue = .global(), _ callback: @escaping (Error?) -> Void)

    Parameters

    queue

    Dispatch Queue to run shutdown on

    callback

    Callback called when shutdown is complete. If there was an error it will return with Error in callback

Member structs/enums

  • Errors returned by AWSClient code

    See more

    Declaration

    Swift

    public struct ClientError : Swift.Error, Equatable
    extension AWSClient.ClientError: CustomStringConvertible
  • Specifies how HTTPClient will be created and establishes lifecycle ownership.

    See more

    Declaration

    Swift

    public enum HTTPClientProvider
  • Additional options

    See more

    Declaration

    Swift

    public struct Options
  • Execute an empty request and return a future with the output object generated from the response

    Declaration

    Swift

    @discardableResult
    public func execute(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Void>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    serviceConfig

    AWS service configuration used in request creation and signing

    endpointDiscovery

    Endpoint discovery helper

    logger

    Logger

    eventLoop

    Optional EventLoop to run everything on

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    @discardableResult
    public func execute<Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Void>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    serviceConfig

    AWS service configuration used in request creation and signing

    input

    Input object

    hostPrefix

    Prefix to append to host name

    endpointDiscovery

    Endpoint discovery helper

    logger

    Logger

    eventLoop

    Optional EventLoop to run everything on

    Return Value

    Future containing output object that completes when response is received

  • Execute an empty request and return a future with the output object generated from the response

    Declaration

    Swift

    @discardableResult
    public func execute<Output: AWSDecodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Output>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    serviceConfig

    AWS service configuration used in request creation and signing

    endpointDiscovery

    Endpoint discovery helper

    logger

    Logger

    eventLoop

    Optional EventLoop to run everything on

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape, Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Output>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    serviceConfig

    AWS service configuration used in request creation and signing

    input

    Input object

    hostPrefix

    Prefix to append to host name

    endpointDiscovery

    Endpoint discovery helper

    logger

    Logger

    eventLoop

    Optional EventLoop to run everything on

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape, Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        stream: @escaping AWSHTTPClient.ResponseStream
    ) -> EventLoopFuture<Output>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    input

    Input object

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Future containing output object that completes when response is received

Pagination

  • If an AWS command is returning an arbituary sized array sometimes it adds support for paginating this array ie it will return the array in blocks of a defined size, each block also includes a token which can be used to access the next block. This function loads each block and calls a closure with each block as parameter. This function returns the result of combining all of these blocks using the given closure,

    Declaration

    Swift

    public func paginate<Input: AWSPaginateToken, Output: AWSShape, Result>(
        input: Input,
        initialValue: Result,
        command: @escaping (Input, Logger, EventLoop?) -> EventLoopFuture<Output>,
        inputKey: KeyPath<Input, Input.Token?>,
        outputKey: KeyPath<Output, Input.Token?>,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (Result, Output, EventLoop) -> EventLoopFuture<(Bool, Result)>
    ) -> EventLoopFuture<Result> where Input.Token: Equatable

    Parameters

    input

    Input for request

    initialValue

    The value to use as the initial accumulating value. initialValue is passed to onPage the first time it is called.

    command

    Command to be paginated

    inputKey

    The name of token in the request object to continue pagination

    outputKey

    The name of token in the response object to continue pagination

    eventLoop

    EventLoop to run this process on

    logger

    Logger used for logging

    onPage

    closure called with each block of entries. It combines an accumulating result with the contents of response from the call to AWS. This combined result is then returned along with a boolean indicating if the paginate operation should continue.

  • If an AWS command is returning an arbituary sized array sometimes it adds support for paginating this array ie it will return the array in blocks of a defined size, each block also includes a token which can be used to access the next block. This function loads each block and calls a closure with each block as parameter.

    Declaration

    Swift

    public func paginate<Input: AWSPaginateToken, Output: AWSShape>(
        input: Input,
        command: @escaping (Input, Logger, EventLoop?) -> EventLoopFuture<Output>,
        inputKey: KeyPath<Input, Input.Token?>,
        outputKey: KeyPath<Output, Input.Token?>,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (Output, EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> where Input.Token: Equatable

    Parameters

    input

    Input for request

    command

    Command to be paginated

    inputKey

    The name of token in the request object to continue pagination

    outputKey

    The name of token in the response object to continue pagination

    eventLoop

    EventLoop to run this process on

    logger

    Logger used for logging

    onPage

    closure called with each block of entries. Returns boolean indicating whether we should continue.

  • If an AWS command is returning an arbituary sized array sometimes it adds support for paginating this array ie it will return the array in blocks of a defined size, each block also includes a token which can be used to access the next block. This function loads each block and calls a closure with each block as parameter. This function returns the result of combining all of these blocks using the given closure,

    Declaration

    Swift

    public func paginate<Input: AWSPaginateToken, Output: AWSShape, Result>(
        input: Input,
        initialValue: Result,
        command: @escaping (Input, Logger, EventLoop?) -> EventLoopFuture<Output>,
        tokenKey: KeyPath<Output, Input.Token?>,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (Result, Output, EventLoop) -> EventLoopFuture<(Bool, Result)>
    ) -> EventLoopFuture<Result>

    Parameters

    input

    Input for request

    initialValue

    The value to use as the initial accumulating value. initialValue is passed to onPage the first time it is called.

    command

    Command to be paginated

    tokenKey

    The name of token in the response object to continue pagination

    eventLoop

    EventLoop to run this process on

    logger

    Logger used for logging

    onPage

    closure called with each block of entries. It combines an accumulating result with the contents of response from the call to AWS. This combined result is then returned along with a boolean indicating if the paginate operation should continue.

  • If an AWS command is returning an arbituary sized array sometimes it adds support for paginating this array ie it will return the array in blocks of a defined size, each block also includes a token which can be used to access the next block. This function loads each block and calls a closure with each block as parameter.

    Declaration

    Swift

    public func paginate<Input: AWSPaginateToken, Output: AWSShape>(
        input: Input,
        command: @escaping (Input, Logger, EventLoop?) -> EventLoopFuture<Output>,
        tokenKey: KeyPath<Output, Input.Token?>,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (Output, EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void>

    Parameters

    input

    Input for request

    command

    Command to be paginated

    tokenKey

    The name of token in the response object to continue pagination

    eventLoop

    EventLoop to run this process on

    logger

    Logger used for logging

    onPage

    closure called with each block of entries. Returns boolean indicating whether we should continue.

  • If an AWS command is returning an arbituary sized array sometimes it adds support for paginating this array ie it will return the array in blocks of a defined size, each block also includes a token which can be used to access the next block. This function loads each block and calls a closure with each block as parameter. This function returns the result of combining all of these blocks using the given closure,

    Declaration

    Swift

    public func paginate<Input: AWSPaginateToken, Output: AWSShape, Result>(
        input: Input,
        initialValue: Result,
        command: @escaping (Input, Logger, EventLoop?) -> EventLoopFuture<Output>,
        tokenKey: KeyPath<Output, Input.Token?>,
        moreResultsKey: KeyPath<Output, Bool?>,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (Result, Output, EventLoop) -> EventLoopFuture<(Bool, Result)>
    ) -> EventLoopFuture<Result>

    Parameters

    input

    Input for request

    initialValue

    The value to use as the initial accumulating value. initialValue is passed to onPage the first time it is called.

    command

    Command to be paginated

    tokenKey

    The name of token in the response object to continue pagination

    moreResultsKey

    The KeyPath for the member of the output that indicates whether we should ask for more data

    eventLoop

    EventLoop to run this process on

    logger

    Logger used for logging

    onPage

    closure called with each block of entries. It combines an accumulating result with the contents of response from the call to AWS. This combined result is then returned along with a boolean indicating if the paginate operation should continue.

  • If an AWS command is returning an arbituary sized array sometimes it adds support for paginating this array ie it will return the array in blocks of a defined size, each block also includes a token which can be used to access the next block. This function loads each block and calls a closure with each block as parameter.

    Declaration

    Swift

    public func paginate<Input: AWSPaginateToken, Output: AWSShape>(
        input: Input,
        command: @escaping (Input, Logger, EventLoop?) -> EventLoopFuture<Output>,
        tokenKey: KeyPath<Output, Input.Token?>,
        moreResultsKey: KeyPath<Output, Bool?>,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (Output, EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void>

    Parameters

    input

    Input for request

    command

    Command to be paginated

    tokenKey

    The name of token in the response object to continue pagination

    moreResultsKey

    The KeyPath for the member of the output that indicates whether we should ask for more data

    eventLoop

    EventLoop to run this process on

    logger

    Logger used for logging

    onPage

    closure called with each block of entries. Returns boolean indicating whether we should continue.

  • If an AWS command is returning an arbituary sized array sometimes it adds support for paginating this array ie it will return the array in blocks of a defined size, each block also includes a token which can be used to access the next block. This function loads each block and calls a closure with each block as parameter. This function returns the result of combining all of these blocks using the given closure,

    Declaration

    Swift

    @available(*, deprecated, message: "Deprecated this version of paginate in favour of version that includes the inputKey")
    public func paginate<Input: AWSPaginateToken, Output: AWSShape, Result>(
        input: Input,
        initialValue: Result,
        command: @escaping (Input, Logger, EventLoop?) -> EventLoopFuture<Output>,
        tokenKey: KeyPath<Output, Input.Token?>,
        moreResultsKey: KeyPath<Output, Bool>,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (Result, Output, EventLoop) -> EventLoopFuture<(Bool, Result)>
    ) -> EventLoopFuture<Result>

    Parameters

    input

    Input for request

    initialValue

    The value to use as the initial accumulating value. initialValue is passed to onPage the first time it is called.

    command

    Command to be paginated

    tokenKey

    The name of token in the response object to continue pagination

    moreResultsKey

    The KeyPath for the member of the output that indicates whether we should ask for more data

    eventLoop

    EventLoop to run this process on

    logger

    Logger used for logging

    onPage

    closure called with each block of entries. It combines an accumulating result with the contents of response from the call to AWS. This combined result is then returned along with a boolean indicating if the paginate operation should continue.

  • If an AWS command is returning an arbituary sized array sometimes it adds support for paginating this array ie it will return the array in blocks of a defined size, each block also includes a token which can be used to access the next block. This function loads each block and calls a closure with each block as parameter.

    Declaration

    Swift

    @available(*, deprecated, message: "Deprecated this version of paginate in favour of version that includes the inputKey")
    public func paginate<Input: AWSPaginateToken, Output: AWSShape>(
        input: Input,
        command: @escaping (Input, Logger, EventLoop?) -> EventLoopFuture<Output>,
        tokenKey: KeyPath<Output, Input.Token?>,
        moreResultsKey: KeyPath<Output, Bool>,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (Output, EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void>

    Parameters

    input

    Input for request

    command

    Command to be paginated

    tokenKey

    The name of token in the response object to continue pagination

    moreResultsKey

    The KeyPath for the member of the output that indicates whether we should ask for more data

    eventLoop

    EventLoop to run this process on

    logger

    Logger used for logging

    onPage

    closure called with each block of entries. Returns boolean indicating whether we should continue.

API Calls

  • execute a request with an input object and return a future with an empty response

    Declaration

    Swift

    public func execute<Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Void>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    input

    Input object

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Empty Future that completes when response is received

  • Execute an empty request and return a future with an empty response

    Declaration

    Swift

    public func execute(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Void>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Empty Future that completes when response is received

  • Execute an empty request and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Output>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape, Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Output>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    input

    Input object

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape, Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        stream: @escaping AWSHTTPClient.ResponseStream
    ) -> EventLoopFuture<Output>

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    input

    Input object

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Future containing output object that completes when response is received

  • Get credential used by client

    Declaration

    Swift

    public func getCredential(on eventLoop: EventLoop? = nil, logger: Logger = AWSClient.loggingDisabled) -> EventLoopFuture<Credential>

    Parameters

    eventLoop

    optional eventLoop to run operation on

    logger

    optional logger to use

    Return Value

    Credential

  • Generate a signed URL

    Declaration

    Swift

    public func signURL(
        url: URL,
        httpMethod: HTTPMethod,
        headers: HTTPHeaders = HTTPHeaders(),
        expires: TimeAmount,
        serviceConfig: AWSServiceConfig,
        logger: Logger = AWSClient.loggingDisabled
    ) -> EventLoopFuture<URL>

    Parameters

    url

    URL to sign

    httpMethod

    HTTP method to use (.GET, .PUT, .PUSH etc)

    httpHeaders

    Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL

    expires

    How long before the signed URL expires

    serviceConfig

    additional AWS service configuration used to sign the url

    logger

    Logger to output to

    Return Value

    A signed URL

  • Generate signed headers

    Declaration

    Swift

    public func signHeaders(
        url: URL,
        httpMethod: HTTPMethod,
        headers: HTTPHeaders = HTTPHeaders(),
        body: AWSPayload,
        serviceConfig: AWSServiceConfig,
        logger: Logger = AWSClient.loggingDisabled
    ) -> EventLoopFuture<HTTPHeaders>

    Parameters

    url

    URL to sign

    httpMethod

    HTTP method to use (.GET, .PUT, .PUSH etc)

    httpHeaders

    Headers that are to be used with this URL.

    body

    Payload to sign as well. While it is unnecessary to provide the body for S3 other services may require it

    serviceConfig

    additional AWS service configuration used to sign the url

    logger

    Logger to output to

    Return Value

    A set of signed headers that include the original headers supplied

  • Execute an empty request and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    serviceConfig

    AWS service configuration used in request creation and signing

    endpointDiscovery

    Endpoint discovery helper

    logger

    Logger

    eventLoop

    Optional EventLoop to run everything on

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    serviceConfig

    AWS service configuration used in request creation and signing

    input

    Input object

    hostPrefix

    Prefix to append to host name

    endpointDiscovery

    Endpoint discovery helper

    logger

    Logger

    eventLoop

    Optional EventLoop to run everything on

    Return Value

    Future containing output object that completes when response is received

  • Execute an empty request and return a future with the output object generated from the response

    Declaration

    Swift

    @discardableResult
    public func execute<Output: AWSDecodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws -> Output

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    serviceConfig

    AWS service configuration used in request creation and signing

    endpointDiscovery

    Endpoint discovery helper

    logger

    Logger

    eventLoop

    Optional EventLoop to run everything on

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape, Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws -> Output

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    serviceConfig

    AWS service configuration used in request creation and signing

    input

    Input object

    hostPrefix

    Prefix to append to host name

    endpointDiscovery

    Endpoint discovery helper

    logger

    Logger

    eventLoop

    Optional EventLoop to run everything on

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape, Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        endpointDiscovery: AWSEndpointDiscovery,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        stream: @escaping AWSHTTPClient.ResponseStream
    ) async throws -> Output

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    input

    Input object

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Future containing output object that completes when response is received

  • Used to access paginated results.

    See more

    Declaration

    Swift

    public struct PaginatorSequence<Input, Output> : AsyncSequence where Input : AWSPaginateToken, Output : AWSShape, Input.Token : Equatable
  • Returns when waiter polling returns a success state or returns an error if the polling returns an error or timesout

    Declaration

    Swift

    public func waitUntil<Input, Output>(
        _ input: Input,
        waiter: Waiter<Input, Output>,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws

    Parameters

    input

    Input parameters

    waiter

    Waiter to wait on

    maxWaitTime

    Maximum amount of time to wait

    logger

    Logger used to provide output

    eventLoop

    EventLoop to run API calls on

    Return Value

    EventLoopFuture that will be fulfilled once waiter has completed

  • execute a request with an input object and return a future with an empty response

    Declaration

    Swift

    public func execute<Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    input

    Input object

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Empty Future that completes when response is received

  • Execute an empty request and return a future with an empty response

    Declaration

    Swift

    public func execute(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Empty Future that completes when response is received

  • Execute an empty request and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws -> Output

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape, Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) async throws -> Output

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    input

    Input object

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Future containing output object that completes when response is received

  • Execute a request with an input object and return a future with the output object generated from the response

    Declaration

    Swift

    public func execute<Output: AWSDecodableShape, Input: AWSEncodableShape>(
        operation operationName: String,
        path: String,
        httpMethod: HTTPMethod,
        serviceConfig: AWSServiceConfig,
        input: Input,
        hostPrefix: String? = nil,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil,
        stream: @escaping AWSHTTPClient.ResponseStream
    ) async throws -> Output

    Parameters

    operationName

    Name of the AWS operation

    path

    path to append to endpoint URL

    httpMethod

    HTTP method to use (“GET”, “PUT”, “PUSH” etc)

    input

    Input object

    config

    AWS service configuration used in request creation and signing

    context

    additional context for call

    Return Value

    Future containing output object that completes when response is received

  • Get credential used by client

    Declaration

    Swift

    public func getCredential(on eventLoop: EventLoop? = nil, logger: Logger = AWSClient.loggingDisabled) async throws -> Credential

    Parameters

    eventLoop

    optional eventLoop to run operation on

    logger

    optional logger to use

    Return Value

    Credential

  • Generate a signed URL

    Declaration

    Swift

    public func signURL(
        url: URL,
        httpMethod: HTTPMethod,
        headers: HTTPHeaders = HTTPHeaders(),
        expires: TimeAmount,
        serviceConfig: AWSServiceConfig,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws -> URL

    Parameters

    url

    URL to sign

    httpMethod

    HTTP method to use (.GET, .PUT, .PUSH etc)

    httpHeaders

    Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL

    expires

    How long before the signed URL expires

    serviceConfig

    additional AWS service configuration used to sign the url

    logger

    Logger to output to

    Return Value

    A signed URL

  • Generate signed headers

    Declaration

    Swift

    public func signHeaders(
        url: URL,
        httpMethod: HTTPMethod,
        headers: HTTPHeaders = HTTPHeaders(),
        body: AWSPayload,
        serviceConfig: AWSServiceConfig,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws -> HTTPHeaders

    Parameters

    url

    URL to sign

    httpMethod

    HTTP method to use (.GET, .PUT, .PUSH etc)

    httpHeaders

    Headers that are to be used with this URL.

    body

    Payload to sign as well. While it is unnecessary to provide the body for S3 other services may require it

    serviceConfig

    additional AWS service configuration used to sign the url

    logger

    Logger to output to

    Return Value

    A set of signed headers that include the original headers supplied

Waiters

  • Waiter state

    See more

    Declaration

    Swift

    public enum WaiterState
  • A waiter is a client side abstraction used to poll a resource until a desired state is reached

    See more

    Declaration

    Swift

    public struct Waiter<Input, Output>
  • Returns an EventLoopFuture that will by fulfilled once waiter polling returns a success state or returns an error if the polling returns an error or timesout

    Declaration

    Swift

    public func waitUntil<Input, Output>(
        _ input: Input,
        waiter: Waiter<Input, Output>,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> EventLoopFuture<Void>

    Parameters

    input

    Input parameters

    waiter

    Waiter to wait on

    maxWaitTime

    Maximum amount of time to wait

    logger

    Logger used to provide output

    eventLoop

    EventLoop to run API calls on

    Return Value

    EventLoopFuture that will be fulfilled once waiter has completed