186 186 | import aws.sdk.kotlin.services.s3.model.PutBucketTaggingRequest
|
187 187 | import aws.sdk.kotlin.services.s3.model.PutBucketTaggingResponse
|
188 188 | import aws.sdk.kotlin.services.s3.model.PutBucketVersioningRequest
|
189 189 | import aws.sdk.kotlin.services.s3.model.PutBucketVersioningResponse
|
190 190 | import aws.sdk.kotlin.services.s3.model.PutBucketWebsiteRequest
|
191 191 | import aws.sdk.kotlin.services.s3.model.PutBucketWebsiteResponse
|
192 192 | import aws.sdk.kotlin.services.s3.model.PutObjectAclRequest
|
193 193 | import aws.sdk.kotlin.services.s3.model.PutObjectAclResponse
|
194 194 | import aws.sdk.kotlin.services.s3.model.PutObjectLegalHoldRequest
|
195 195 | import aws.sdk.kotlin.services.s3.model.PutObjectLegalHoldResponse
|
196 196 | import aws.sdk.kotlin.services.s3.model.PutObjectLockConfigurationRequest
|
197 197 | import aws.sdk.kotlin.services.s3.model.PutObjectLockConfigurationResponse
|
198 198 | import aws.sdk.kotlin.services.s3.model.PutObjectRequest
|
199 199 | import aws.sdk.kotlin.services.s3.model.PutObjectResponse
|
200 200 | import aws.sdk.kotlin.services.s3.model.PutObjectRetentionRequest
|
201 201 | import aws.sdk.kotlin.services.s3.model.PutObjectRetentionResponse
|
202 202 | import aws.sdk.kotlin.services.s3.model.PutObjectTaggingRequest
|
203 203 | import aws.sdk.kotlin.services.s3.model.PutObjectTaggingResponse
|
204 204 | import aws.sdk.kotlin.services.s3.model.PutPublicAccessBlockRequest
|
205 205 | import aws.sdk.kotlin.services.s3.model.PutPublicAccessBlockResponse
|
206 206 | import aws.sdk.kotlin.services.s3.model.RestoreObjectRequest
|
207 207 | import aws.sdk.kotlin.services.s3.model.RestoreObjectResponse
|
208 208 | import aws.sdk.kotlin.services.s3.model.SelectObjectContentRequest
|
209 209 | import aws.sdk.kotlin.services.s3.model.SelectObjectContentResponse
|
210 210 | import aws.sdk.kotlin.services.s3.model.UploadPartCopyRequest
|
211 211 | import aws.sdk.kotlin.services.s3.model.UploadPartCopyResponse
|
212 212 | import aws.sdk.kotlin.services.s3.model.UploadPartRequest
|
213 213 | import aws.sdk.kotlin.services.s3.model.UploadPartResponse
|
214 214 | import aws.sdk.kotlin.services.s3.model.WriteGetObjectResponseRequest
|
215 215 | import aws.sdk.kotlin.services.s3.model.WriteGetObjectResponseResponse
|
216 - | import aws.smithy.kotlin.runtime.auth.AuthSchemeId
|
217 216 | import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
|
218 217 | import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderConfig
|
219 218 | import aws.smithy.kotlin.runtime.auth.awscredentials.SigV4aClientConfig
|
220 219 | import aws.smithy.kotlin.runtime.awsprotocol.ClockSkewInterceptor
|
221 220 | import aws.smithy.kotlin.runtime.client.AbstractSdkClientBuilder
|
222 221 | import aws.smithy.kotlin.runtime.client.AbstractSdkClientFactory
|
223 222 | import aws.smithy.kotlin.runtime.client.LogMode
|
224 223 | import aws.smithy.kotlin.runtime.client.RetryClientConfig
|
225 224 | import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfig
|
226 225 | import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfigImpl
|
227 226 | import aws.smithy.kotlin.runtime.client.SdkClient
|
228 227 | import aws.smithy.kotlin.runtime.client.SdkClientConfig
|
229 228 | import aws.smithy.kotlin.runtime.client.config.HttpChecksumConfig
|
230 229 | import aws.smithy.kotlin.runtime.client.config.RequestHttpChecksumConfig
|
231 230 | import aws.smithy.kotlin.runtime.client.config.ResponseHttpChecksumConfig
|
232 231 | import aws.smithy.kotlin.runtime.http.auth.AuthScheme
|
233 232 | import aws.smithy.kotlin.runtime.http.auth.HttpAuthConfig
|
234 233 | import aws.smithy.kotlin.runtime.http.config.HttpClientConfig
|
235 234 | import aws.smithy.kotlin.runtime.http.config.HttpEngineConfig
|
236 235 | import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
|
237 236 | import aws.smithy.kotlin.runtime.http.engine.HttpEngineConfigImpl
|
238 237 | import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
|
239 238 | import aws.smithy.kotlin.runtime.net.url.Url
|
240 239 | import aws.smithy.kotlin.runtime.retries.RetryStrategy
|
241 240 | import aws.smithy.kotlin.runtime.retries.policy.RetryPolicy
|
242 241 | import aws.smithy.kotlin.runtime.telemetry.Global
|
243 242 | import aws.smithy.kotlin.runtime.telemetry.TelemetryConfig
|
244 243 | import aws.smithy.kotlin.runtime.telemetry.TelemetryProvider
|
245 244 | import aws.smithy.kotlin.runtime.util.LazyAsyncValue
|
246 245 | import kotlin.collections.List
|
284 283 | }
|
285 284 |
|
286 285 | public class Builder internal constructor(): AbstractSdkClientBuilder<Config, Config.Builder, S3Client>() {
|
287 286 | override val config: Config.Builder = Config.Builder()
|
288 287 | override fun newClient(config: Config): S3Client = DefaultS3Client(config)
|
289 288 | }
|
290 289 |
|
291 290 | public class Config private constructor(builder: Builder) : AwsSdkClientConfig, CredentialsProviderConfig, HttpAuthConfig, HttpChecksumConfig, HttpClientConfig, HttpEngineConfig by builder.buildHttpEngineConfig(), RetryClientConfig, RetryStrategyClientConfig by builder.buildRetryStrategyClientConfig(), SdkClientConfig, SigV4aClientConfig, TelemetryConfig {
|
292 291 | override val clientName: String = builder.clientName
|
293 292 | override val region: String? = builder.region
|
294 - | override val authSchemePreference: kotlin.collections.List<aws.smithy.kotlin.runtime.auth.AuthSchemeId>? = builder.authSchemePreference
|
295 293 | override val authSchemes: kotlin.collections.List<aws.smithy.kotlin.runtime.http.auth.AuthScheme> = builder.authSchemes
|
296 294 | public val continueHeaderThresholdBytes: Long? = builder.continueHeaderThresholdBytes
|
297 295 | override val credentialsProvider: CredentialsProvider = builder.credentialsProvider ?: DefaultChainCredentialsProvider(httpClient = httpClient, region = region).manage()
|
298 296 | public val disableMrap: Boolean = builder.disableMrap ?: false
|
299 297 | public val disableS3ExpressSessionAuth: Boolean = builder.disableS3ExpressSessionAuth ?: false
|
300 298 | public val enableAccelerate: Boolean = builder.enableAccelerate ?: false
|
301 299 | public val enableAwsChunked: Boolean = builder.enableAwsChunked ?: true
|
302 300 | public val endpointProvider: S3EndpointProvider = builder.endpointProvider ?: DefaultS3EndpointProvider()
|
303 301 | public val endpointUrl: Url? = builder.endpointUrl
|
304 302 | public val expressCredentialsProvider: CredentialsProvider = builder.expressCredentialsProvider ?: DefaultS3ExpressCredentialsProvider()
|
305 303 | public val forcePathStyle: Boolean = builder.forcePathStyle ?: false
|
306 304 | override val interceptors: kotlin.collections.List<aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor> = builder.interceptors
|
307 305 | override val logMode: LogMode = builder.logMode ?: LogMode.Default
|
308 306 | override val requestChecksumCalculation: RequestHttpChecksumConfig = builder.requestChecksumCalculation ?: RequestHttpChecksumConfig.WHEN_SUPPORTED
|
309 307 | override val responseChecksumValidation: ResponseHttpChecksumConfig = builder.responseChecksumValidation ?: ResponseHttpChecksumConfig.WHEN_SUPPORTED
|
310 308 | override val retryPolicy: RetryPolicy<Any?> = builder.retryPolicy ?: AwsRetryPolicy.Default
|
311 309 | override val sigV4aSigningRegionSet: kotlin.collections.Set<kotlin.String>? = builder.sigV4aSigningRegionSet
|
312 310 | override val telemetryProvider: TelemetryProvider = builder.telemetryProvider ?: TelemetryProvider.Global
|
313 311 | public val useArnRegion: Boolean = builder.useArnRegion ?: false
|
314 312 | override val useDualStack: Boolean = builder.useDualStack ?: false
|
315 313 | override val useFips: Boolean = builder.useFips ?: false
|
316 314 | override val applicationId: String? = builder.applicationId
|
317 - | public val authSchemeProvider: S3AuthSchemeProvider = builder.authSchemeProvider ?: DefaultS3AuthSchemeProvider(endpointProvider, authSchemePreference)
|
315 + | public val authSchemeProvider: S3AuthSchemeProvider = builder.authSchemeProvider ?: DefaultS3AuthSchemeProvider(endpointProvider)
|
318 316 | public companion object {
|
319 317 | public inline operator fun invoke(block: Builder.() -> kotlin.Unit): Config = Builder().apply(block).build()
|
320 318 | }
|
321 319 |
|
322 320 | public fun toBuilder(): Builder = Builder().apply {
|
323 321 | clientName = this@Config.clientName
|
324 322 | region = this@Config.region
|
325 - | authSchemePreference = this@Config.authSchemePreference
|
326 323 | authSchemes = this@Config.authSchemes
|
327 324 | continueHeaderThresholdBytes = this@Config.continueHeaderThresholdBytes
|
328 325 | credentialsProvider = this@Config.credentialsProvider
|
329 326 | disableMrap = this@Config.disableMrap
|
330 327 | disableS3ExpressSessionAuth = this@Config.disableS3ExpressSessionAuth
|
331 328 | enableAccelerate = this@Config.enableAccelerate
|
332 329 | enableAwsChunked = this@Config.enableAwsChunked
|
333 330 | endpointProvider = this@Config.endpointProvider
|
334 331 | endpointUrl = this@Config.endpointUrl
|
335 332 | expressCredentialsProvider = this@Config.expressCredentialsProvider
|
336 333 | forcePathStyle = this@Config.forcePathStyle
|
337 334 | httpClient = this@Config.httpClient
|
338 335 | interceptors = this@Config.interceptors.toMutableList()
|
339 336 | logMode = this@Config.logMode
|
340 337 | requestChecksumCalculation = this@Config.requestChecksumCalculation
|
341 338 | responseChecksumValidation = this@Config.responseChecksumValidation
|
342 339 | retryPolicy = this@Config.retryPolicy
|
343 340 | retryStrategy = this@Config.retryStrategy
|
344 341 | sigV4aSigningRegionSet = this@Config.sigV4aSigningRegionSet
|
345 342 | telemetryProvider = this@Config.telemetryProvider
|
346 343 | useArnRegion = this@Config.useArnRegion
|
347 344 | useDualStack = this@Config.useDualStack
|
348 345 | useFips = this@Config.useFips
|
349 346 | applicationId = this@Config.applicationId
|
350 347 | authSchemeProvider = this@Config.authSchemeProvider
|
351 348 | }
|
352 349 |
|
353 350 | public class Builder : AwsSdkClientConfig.Builder, CredentialsProviderConfig.Builder, HttpAuthConfig.Builder, HttpChecksumConfig.Builder, HttpClientConfig.Builder, HttpEngineConfig.Builder by HttpEngineConfigImpl.BuilderImpl(), RetryClientConfig.Builder, RetryStrategyClientConfig.Builder by RetryStrategyClientConfigImpl.BuilderImpl(), SdkClientConfig.Builder<Config>, SigV4aClientConfig.Builder, TelemetryConfig.Builder {
|
354 351 | /**
|
355 352 | * A reader-friendly name for the client.
|
356 353 | */
|
357 354 | override var clientName: String = "S3"
|
358 355 |
|
359 356 | /**
|
360 357 | * The AWS region (e.g. `us-west-2`) to make requests to. See about AWS
|
361 358 | * [global infrastructure](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/) for more
|
362 359 | * information
|
363 360 | */
|
364 361 | override var region: String? = null
|
365 362 |
|
366 - | /**
|
367 - | * The ordered preference of [AuthScheme] that this client will use.
|
368 - | */
|
369 - | override var authSchemePreference: kotlin.collections.List<aws.smithy.kotlin.runtime.auth.AuthSchemeId>? = null
|
370 - |
|
371 363 | /**
|
372 364 | * Register new or override default [AuthScheme]s configured for this client. By default, the set
|
373 365 | * of auth schemes configured comes from the service model. An auth scheme configured explicitly takes
|
374 366 | * precedence over the defaults and can be used to customize identity resolution and signing for specific
|
375 367 | * authentication schemes.
|
376 368 | */
|
377 369 | override var authSchemes: kotlin.collections.List<aws.smithy.kotlin.runtime.http.auth.AuthScheme> = emptyList()
|
378 370 |
|
379 371 | /**
|
380 372 | * The minimum content length threshold (in bytes) for which to send `Expect: 100-continue` HTTP headers. PUT
|