138 138 | import aws.sdk.kotlin.services.codebuild.model.UpdateWebhookResponse
|
139 139 | import aws.smithy.kotlin.runtime.auth.AuthSchemeId
|
140 140 | import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
|
141 141 | import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderConfig
|
142 142 | import aws.smithy.kotlin.runtime.awsprotocol.ClockSkewInterceptor
|
143 143 | import aws.smithy.kotlin.runtime.client.AbstractSdkClientBuilder
|
144 144 | import aws.smithy.kotlin.runtime.client.AbstractSdkClientFactory
|
145 145 | import aws.smithy.kotlin.runtime.client.LogMode
|
146 146 | import aws.smithy.kotlin.runtime.client.RetryClientConfig
|
147 147 | import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfig
|
148 148 | import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfigImpl
|
149 149 | import aws.smithy.kotlin.runtime.client.SdkClient
|
150 150 | import aws.smithy.kotlin.runtime.client.SdkClientConfig
|
151 151 | import aws.smithy.kotlin.runtime.client.region.RegionProvider
|
152 152 | import aws.smithy.kotlin.runtime.http.auth.AuthScheme
|
153 153 | import aws.smithy.kotlin.runtime.http.auth.HttpAuthConfig
|
154 154 | import aws.smithy.kotlin.runtime.http.config.HttpClientConfig
|
155 155 | import aws.smithy.kotlin.runtime.http.config.HttpEngineConfig
|
156 156 | import aws.smithy.kotlin.runtime.http.config.TimeoutConfig
|
157 157 | import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
|
158 158 | import aws.smithy.kotlin.runtime.http.engine.HttpEngineConfigImpl
|
159 159 | import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
|
160 160 | import aws.smithy.kotlin.runtime.net.url.Url
|
161 161 | import aws.smithy.kotlin.runtime.retries.RetryStrategy
|
162 162 | import aws.smithy.kotlin.runtime.retries.policy.RetryPolicy
|
163 163 | import aws.smithy.kotlin.runtime.telemetry.Global
|
164 164 | import aws.smithy.kotlin.runtime.telemetry.TelemetryConfig
|
165 165 | import aws.smithy.kotlin.runtime.telemetry.TelemetryProvider
|
166 166 | import aws.smithy.kotlin.runtime.util.LazyAsyncValue
|
167 167 | import kotlin.collections.List
|
168 + | import kotlin.collections.Set
|
168 169 | import kotlin.jvm.JvmStatic
|
169 170 | import kotlin.time.Duration
|
170 171 | import kotlinx.coroutines.runBlocking
|
171 172 |
|
172 173 |
|
173 174 | public const val ServiceId: String = "CodeBuild"
|
174 175 | public const val SdkVersion: String = "1.6.105-SNAPSHOT"
|
175 176 | public const val ServiceApiVersion: String = "2016-10-06"
|
176 177 |
|
177 178 | /**
|
178 179 | * # CodeBuild
|
179 180 | * CodeBuild is a fully managed build service in the cloud. CodeBuild compiles your source code, runs unit tests, and produces artifacts that are ready to deploy. CodeBuild eliminates the need to provision, manage, and scale your own build servers. It provides prepackaged build environments for the most popular programming languages and build tools, such as Apache Maven, Gradle, and more. You can also fully customize build environments in CodeBuild to use your own build tools. CodeBuild scales automatically to meet peak build requests. You pay only for the build time you consume. For more information about CodeBuild, see the *[CodeBuild User Guide](https://docs.aws.amazon.com/codebuild/latest/userguide/welcome.html).*
|
180 181 | */
|
181 182 | public interface CodeBuildClient : SdkClient {
|
182 183 | /**
|
183 184 | * CodeBuildClient's configuration
|
184 185 | */
|
185 186 | public override val config: Config
|
186 187 |
|
187 188 | public companion object : AbstractAwsSdkClientFactory<Config, Config.Builder, CodeBuildClient, Builder>()
|
188 189 | {
|
189 190 | @JvmStatic
|
190 191 | override fun builder(): Builder = Builder()
|
191 192 |
|
192 193 | override fun finalizeConfig(builder: Builder) {
|
193 194 | super.finalizeConfig(builder)
|
194 195 | builder.config.interceptors.add(0, ClockSkewInterceptor())
|
195 196 | }
|
196 197 |
|
197 198 | override suspend fun finalizeEnvironmentalConfig(builder: Builder, sharedConfig: LazyAsyncValue<AwsSharedConfig>, activeProfile: LazyAsyncValue<AwsProfile>) {
|
198 199 | super.finalizeEnvironmentalConfig(builder, sharedConfig, activeProfile)
|
199 200 | builder.config.endpointUrl = builder.config.endpointUrl ?: resolveEndpointUrl(
|
200 201 | sharedConfig,
|
201 202 | "CodeBuild",
|
202 203 | "CODEBUILD",
|
203 204 | "codebuild",
|
204 205 | )
|
205 206 | }
|
206 207 | }
|
207 208 |
|
208 209 | public class Builder internal constructor(): AbstractSdkClientBuilder<Config, Config.Builder, CodeBuildClient>() {
|
209 210 | override val config: Config.Builder = Config.Builder()
|
210 211 | override fun newClient(config: Config): CodeBuildClient = DefaultCodeBuildClient(config)
|
211 212 | }
|
212 213 |
|
213 214 | public class Config private constructor(builder: Builder) : AwsSdkClientConfig, CredentialsProviderConfig, HttpAuthConfig, HttpClientConfig, HttpEngineConfig by builder.buildHttpEngineConfig(), RetryClientConfig, RetryStrategyClientConfig by builder.buildRetryStrategyClientConfig(), SdkClientConfig, TelemetryConfig, TimeoutConfig {
|
214 215 | override val clientName: String = builder.clientName
|
215 216 | override val region: String? = (builder.region ?: runBlocking { builder.regionProvider?.getRegion() ?: resolveRegion() })?.let { validateRegion(it) }
|
216 217 | override val regionProvider: RegionProvider = builder.regionProvider ?: DefaultRegionProviderChain()
|
217 218 | override val attemptTimeout: Duration? = builder.attemptTimeout
|
218 219 | override val authSchemePreference: kotlin.collections.List<aws.smithy.kotlin.runtime.auth.AuthSchemeId>? = builder.authSchemePreference
|
219 220 | override val authSchemes: kotlin.collections.List<aws.smithy.kotlin.runtime.http.auth.AuthScheme> = builder.authSchemes
|
220 221 | override val callTimeout: Duration? = builder.callTimeout
|
221 222 | override val credentialsProvider: CredentialsProvider = builder.credentialsProvider ?: DefaultChainCredentialsProvider(httpClient = httpClient, region = region).manage()
|
222 223 | public val endpointProvider: CodeBuildEndpointProvider = builder.endpointProvider ?: DefaultCodeBuildEndpointProvider()
|
223 224 | public val endpointUrl: Url? = builder.endpointUrl
|
224 225 | override val interceptors: kotlin.collections.List<aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor> = builder.interceptors
|
225 226 | override val logMode: LogMode = builder.logMode ?: LogMode.Default
|
227 + | override val logRedactedHeaders: kotlin.collections.Set<kotlin.String> = builder.logRedactedHeaders ?: emptySet()
|
226 228 | override val retryPolicy: RetryPolicy<Any?> = builder.retryPolicy ?: AwsRetryPolicy.Default
|
227 229 | override val telemetryProvider: TelemetryProvider = builder.telemetryProvider ?: TelemetryProvider.Global
|
228 230 | override val useDualStack: Boolean = builder.useDualStack ?: false
|
229 231 | override val useFips: Boolean = builder.useFips ?: false
|
230 232 | override val applicationId: String? = builder.applicationId
|
231 233 | public val authSchemeProvider: CodeBuildAuthSchemeProvider = builder.authSchemeProvider ?: DefaultCodeBuildAuthSchemeProvider(authSchemePreference = authSchemePreference)
|
232 234 | public companion object {
|
233 235 | public inline operator fun invoke(block: Builder.() -> kotlin.Unit): Config = Builder().apply(block).build()
|
234 236 | }
|
235 237 |
|
236 238 | public fun toBuilder(): Builder = Builder().apply {
|
237 239 | clientName = this@Config.clientName
|
238 240 | region = this@Config.region
|
239 241 | regionProvider = this@Config.regionProvider
|
240 242 | attemptTimeout = this@Config.attemptTimeout
|
241 243 | authSchemePreference = this@Config.authSchemePreference
|
242 244 | authSchemes = this@Config.authSchemes
|
243 245 | callTimeout = this@Config.callTimeout
|
244 246 | credentialsProvider = this@Config.credentialsProvider
|
245 247 | endpointProvider = this@Config.endpointProvider
|
246 248 | endpointUrl = this@Config.endpointUrl
|
247 249 | httpClient = this@Config.httpClient
|
248 250 | interceptors = this@Config.interceptors.toMutableList()
|
249 251 | logMode = this@Config.logMode
|
252 + | logRedactedHeaders = this@Config.logRedactedHeaders
|
250 253 | retryPolicy = this@Config.retryPolicy
|
251 254 | retryStrategy = this@Config.retryStrategy
|
252 255 | telemetryProvider = this@Config.telemetryProvider
|
253 256 | useDualStack = this@Config.useDualStack
|
254 257 | useFips = this@Config.useFips
|
255 258 | applicationId = this@Config.applicationId
|
256 259 | authSchemeProvider = this@Config.authSchemeProvider
|
257 260 | }
|
258 261 |
|
259 262 | public class Builder : AwsSdkClientConfig.Builder, CredentialsProviderConfig.Builder, HttpAuthConfig.Builder, HttpClientConfig.Builder, HttpEngineConfig.Builder by HttpEngineConfigImpl.BuilderImpl(), RetryClientConfig.Builder, RetryStrategyClientConfig.Builder by RetryStrategyClientConfigImpl.BuilderImpl(), SdkClientConfig.Builder<Config>, TelemetryConfig.Builder, TimeoutConfig.Builder {
|