From 6c122dca68676e826d065c2b7619fb8bd156c8d3 Mon Sep 17 00:00:00 2001 From: Chan <55515281+sichanyoo@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:10:53 -0700 Subject: [PATCH] Miscellaneous fixes / updates for comments. (#824) Co-authored-by: Sichan Yoo --- .../Config/DefaultClientConfiguration.swift | 6 ++--- .../DefaultHttpClientConfiguration.swift | 20 +++++++------- .../DefaultSDKRuntimeConfiguration.swift | 27 +++++++------------ 3 files changed, 22 insertions(+), 31 deletions(-) diff --git a/Sources/ClientRuntime/Config/DefaultClientConfiguration.swift b/Sources/ClientRuntime/Config/DefaultClientConfiguration.swift index 49bc0432f..399878c9c 100644 --- a/Sources/ClientRuntime/Config/DefaultClientConfiguration.swift +++ b/Sources/ClientRuntime/Config/DefaultClientConfiguration.swift @@ -10,10 +10,10 @@ import struct SmithyRetriesAPI.RetryStrategyOptions public protocol DefaultClientConfiguration: ClientConfiguration { /// The configuration for retry of failed network requests. /// - /// Default options are provided if none are set. + /// Default options are used if none are set. var retryStrategyOptions: RetryStrategyOptions { get set } - /// The log mode to use for client logging. + /// The log mode to use for request / response messages. /// /// If none is provided, `.none` will be used. var clientLogMode: ClientLogMode { get set } @@ -31,7 +31,7 @@ public protocol DefaultClientConfiguration: ClientConfiguration { /// If none is provided, only a default logger provider will be used. var telemetryProvider: TelemetryProvider { get set } - /// Add an `InterceptorProvider` that will be used to provide interceptors for all operations. + /// Adds an `InterceptorProvider` that will be used to provide interceptors for all operations. /// /// - Parameter provider: The `InterceptorProvider` to add. func addInterceptorProvider(_ provider: InterceptorProvider) diff --git a/Sources/ClientRuntime/Config/DefaultHttpClientConfiguration.swift b/Sources/ClientRuntime/Config/DefaultHttpClientConfiguration.swift index d0018b5dc..5b390a4e5 100644 --- a/Sources/ClientRuntime/Config/DefaultHttpClientConfiguration.swift +++ b/Sources/ClientRuntime/Config/DefaultHttpClientConfiguration.swift @@ -12,31 +12,31 @@ import protocol SmithyIdentity.BearerTokenIdentityResolver public protocol DefaultHttpClientConfiguration: ClientConfiguration { - /// The HTTP client to be used for the target platform, configured with the supplied configuration. + /// The HTTP client to use, configured with the supplied configuration. /// - /// By default, Swift SDK will set this to `CRTClientEngine` client on Mac & Linux platforms, - /// or `URLSessionHttpClient` on non-Mac Apple platforms. + /// By default, Swift SDK will set this to `CRTClientEngine` client on Linux platforms, + /// and `URLSessionHttpClient` on Apple platforms. var httpClientEngine: HTTPClient { get set } /// Configuration for the HTTP client. var httpClientConfiguration: HttpClientConfiguration { get set } - /// List of auth schemes to use for client calls. + /// List of auth schemes to use for requests. /// - /// Defaults to auth schemes defined on the Smithy service model. + /// Defaults to auth schemes defined on the underlying Smithy model of a service. var authSchemes: [AuthScheme]? { get set } - /// The auth scheme resolver to use for resolving auth scheme. + /// The auth scheme resolver to use for resolving the auth scheme. /// - /// Defaults to a auth scheme resolver generated based on Smithy service model. + /// Defaults to an auth scheme resolver generated based on the underlying Smithy model of a service. var authSchemeResolver: AuthSchemeResolver { get set } - /// The token identity resolver to be used for bearer token authentication. + /// The token identity resolver to use for bearer token authentication. /// - /// If no resolver is supplied, the SDK will look for token in the `~/.aws/sso/cache` directory. + /// Default resolver will look for the token in the `~/.aws/sso/cache` directory. var bearerTokenIdentityResolver: any BearerTokenIdentityResolver { get set } - /// Add an `HttpInterceptorProvider` that will be used to provide interceptors for all HTTP operations. + /// Adds a `HttpInterceptorProvider` that will be used to provide interceptors for all HTTP operations. /// /// - Parameter provider: The `HttpInterceptorProvider` to add. func addInterceptorProvider(_ provider: HttpInterceptorProvider) diff --git a/Sources/ClientRuntime/Config/DefaultSDKRuntimeConfiguration.swift b/Sources/ClientRuntime/Config/DefaultSDKRuntimeConfiguration.swift index ce6a95f9d..e96e4a4a5 100644 --- a/Sources/ClientRuntime/Config/DefaultSDKRuntimeConfiguration.swift +++ b/Sources/ClientRuntime/Config/DefaultSDKRuntimeConfiguration.swift @@ -17,7 +17,6 @@ import struct SmithyRetriesAPI.RetryStrategyOptions import struct SmithyRetries.DefaultRetryStrategy import struct SmithyRetries.ExponentialBackoffStrategy -/// Provides configuration options for a Smithy-based service. public struct DefaultSDKRuntimeConfiguration { @@ -27,9 +26,9 @@ public struct DefaultSDKRuntimeConfiguration HTTPClient { @@ -107,26 +106,18 @@ public extension DefaultSDKRuntimeConfiguration { #endif } - /// The HTTP client configuration to use when none is provided. - /// - /// Is the CRT HTTP client's configuration. + /// The default HTTP client configuration to use. static var defaultHttpClientConfiguration: HttpClientConfiguration { HttpClientConfiguration() } - /// The idempotency token generator to use when none is provided. - /// - /// Defaults to one that provides UUIDs. + /// The default idempotency token generator that returns UUIDs. static var defaultIdempotencyTokenGenerator: IdempotencyTokenGenerator { DefaultIdempotencyTokenGenerator() } - /// The retry strategy options to use when none is provided. - /// - /// Defaults to options with the defaults defined in `RetryStrategyOptions`. + /// The default retry strategy options with the exponential backoff strategy & other defaults defined in `RetryStrategyOptions`. static var defaultRetryStrategyOptions: RetryStrategyOptions { RetryStrategyOptions(backoffStrategy: ExponentialBackoffStrategy()) } - /// The log mode to use when none is provided - /// - /// Defaults to `.none`. + /// The default client log mode is `.none`. static var defaultClientLogMode: ClientLogMode { .none } static var defaultAuthSchemeResolver: AuthSchemeResolver { DefaultAuthSchemeResolver() }