ClientError
Errors returned by AWSClient
code
struct ClientError
Errors returned by AWSClient
code
struct ClientError
import SotoCore
final class AWSClient
Client managing communication with AWS services
init(credentialProvider credentialProviderFactory: CredentialProviderFactory = .default, retryPolicy retryPolicyFactory: RetryPolicyFactory = .default, middleware: some AWSMiddlewareProtocol, options: Options = Options(), httpClient: AWSHTTPClient = HTTPClient.shared, logger: Logger = AWSClient.loggingDisabled)
Initialize an AWSClient struct
init(credentialProvider credentialProviderFactory: CredentialProviderFactory = .default, retryPolicy retryPolicyFactory: RetryPolicyFactory = .default, options: Options = Options(), httpClient: AWSHTTPClient = HTTPClient.shared, logger: Logger = AWSClient.loggingDisabled)
Initialize an AWSClient struct
static let loggingDisabled: Logger
Default logger that logs nothing
let credentialProvider: CredentialProvider
AWS credentials provider
let httpClient: AWSHTTPClient
HTTP client used by AWSClient
let logger: Logger
Logger used for non-request based output
let middleware: AWSMiddlewareProtocol
Middleware code to be applied to requests and responses
func execute<Output>(operation operationName: String, path: String, httpMethod: HTTPMethod, serviceConfig: AWSServiceConfig, input: some AWSEncodableShape, hostPrefix: String? = nil, logger: Logger = AWSClient.loggingDisabled) async throws -> Output where Output : AWSDecodableShape
Execute a request with an input object and return the output object generated from the response
func execute(operation operationName: String, path: String, httpMethod: HTTPMethod, serviceConfig: AWSServiceConfig, input: some AWSEncodableShape, hostPrefix: String? = nil, logger: Logger = AWSClient.loggingDisabled) async throws
Execute a request with an input object and an empty response
func execute<Output>(operation operationName: String, path: String, httpMethod: HTTPMethod, serviceConfig: AWSServiceConfig, logger: Logger = AWSClient.loggingDisabled) async throws -> Output where Output : AWSDecodableShape
Execute an empty request and return the output object generated from the response
func execute(operation operationName: String, path: String, httpMethod: HTTPMethod, serviceConfig: AWSServiceConfig, logger: Logger = AWSClient.loggingDisabled) async throws
Execute an empty request and an empty response
func getCredential(logger: Logger = AWSClient.loggingDisabled) async throws -> Credential
Get credential used by client
func shutdown() async throws
Shutdown AWSClient asynchronously.
func signHeaders(url: URL, httpMethod: HTTPMethod, headers: HTTPHeaders = HTTPHeaders(), body: AWSHTTPBody, serviceConfig: AWSServiceConfig, logger: Logger = AWSClient.loggingDisabled) async throws -> HTTPHeaders
Generate signed headers
func signURL(url: URL, httpMethod: HTTPMethod, headers: HTTPHeaders = HTTPHeaders(), expires: TimeAmount, serviceConfig: AWSServiceConfig, logger: Logger = AWSClient.loggingDisabled) async throws -> URL
Generate a signed URL
func syncShutdown() throws
Shutdown client synchronously.
func waitUntil<Input, Output>(_ input: Input, waiter: Waiter<Input, Output>, maxWaitTime: TimeAmount? = nil, logger: Logger = AWSClient.loggingDisabled) async throws where Input : Sendable, Output : Sendable
Returns when waiter polling returns a success state or returns an error if the polling returns an error or timesout
struct Options
Additional options
struct PaginatorSequence<Input, Output> where Input : AWSPaginateToken, Output : AWSShape, Input.Token : Equatable
Used to access paginated results.
struct Waiter<Input, Output> where Input : Sendable, Output : Sendable
A waiter is a client side abstraction used to poll a resource until a desired state is reached
enum WaiterState
Waiter state
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Error : Sendable
A type representing an error value that can be thrown.
protocol Escapable
protocol Sendable
static var alreadyShutdown: ClientError { get }
client has already been shutdown
static var bodyLengthMismatch: ClientError { get }
Data supplied to the Request does not equal length indicated
static var failedToAccessPayload: ClientError { get }
Failed to access payload while building request
static var invalidARN: ClientError { get }
ARN provided to client is invalid
static var invalidURL: ClientError { get }
URL provided to client is invalid
static var waiterFailed: ClientError { get }
Waiter failed, but without an error. ie a successful api call was an error
static var waiterTimeout: ClientError { get }
Waiter failed to complete in time alloted
var description: String { get }
return human readable description of error
var localizedDescription: String { get }
Retrieve the localized description for this error.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.