From 98cb3753d4f6b4d72d7893c02e237e805073dffe Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Fri, 23 Feb 2024 17:32:22 -0800 Subject: [PATCH 1/9] Connect token providers via codegen --- .../aws-credential-types/Cargo.toml | 2 +- .../src/provider/token.rs | 18 + .../smithy/rustsdk/AwsCodegenDecorator.kt | 1 + ...ers.kt => CredentialProvidersDecorator.kt} | 31 +- .../smithy/rustsdk/SigV4AuthDecorator.kt | 37 +- .../smithy/rustsdk/TokenProvidersDecorator.kt | 110 + .../rustsdk/TokenProvidersDecoratorTest.kt | 75 + aws/sdk/aws-models/codecatalyst.json | 5574 +++++++++++++++++ aws/sdk/integration-tests/Cargo.toml | 1 + .../integration-tests/codecatalyst/Cargo.toml | 17 + .../codecatalyst/tests/sso_bearer_auth.json | 126 + .../codecatalyst/tests/sso_bearer_auth.rs | 31 + .../customizations/HttpAuthDecorator.kt | 10 +- .../codegen/client/smithy/endpoint/Util.kt | 13 +- .../src/client/identity/http.rs | 20 +- 15 files changed, 6039 insertions(+), 27 deletions(-) rename aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/{CredentialProviders.kt => CredentialProvidersDecorator.kt} (86%) create mode 100644 aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt create mode 100644 aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecoratorTest.kt create mode 100644 aws/sdk/aws-models/codecatalyst.json create mode 100644 aws/sdk/integration-tests/codecatalyst/Cargo.toml create mode 100644 aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.json create mode 100644 aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs diff --git a/aws/rust-runtime/aws-credential-types/Cargo.toml b/aws/rust-runtime/aws-credential-types/Cargo.toml index 4060690b08..bdbb0aba6f 100644 --- a/aws/rust-runtime/aws-credential-types/Cargo.toml +++ b/aws/rust-runtime/aws-credential-types/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/smithy-lang/smithy-rs" [features] hardcoded-credentials = [] -test-util = [] +test-util = ["aws-smithy-runtime-api/test-util"] [dependencies] aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async" } diff --git a/aws/rust-runtime/aws-credential-types/src/provider/token.rs b/aws/rust-runtime/aws-credential-types/src/provider/token.rs index 14d361b885..e59ff7665c 100644 --- a/aws/rust-runtime/aws-credential-types/src/provider/token.rs +++ b/aws/rust-runtime/aws-credential-types/src/provider/token.rs @@ -13,6 +13,12 @@ //! token providers in the SDK config. use crate::{provider::error::TokenError, provider::future, Token}; +use aws_smithy_runtime_api::client::{ + identity::{IdentityFuture, ResolveIdentity}, + runtime_components::RuntimeComponents, +}; +use aws_smithy_runtime_api::impl_shared_conversions; +use aws_smithy_types::config_bag::ConfigBag; use std::sync::Arc; /// Result type for token providers @@ -71,3 +77,15 @@ impl ProvideToken for SharedTokenProvider { self.0.provide_token() } } + +impl ResolveIdentity for SharedTokenProvider { + fn resolve_identity<'a>( + &'a self, + _runtime_components: &'a RuntimeComponents, + _config_bag: &'a ConfigBag, + ) -> IdentityFuture<'a> { + IdentityFuture::new(async move { Ok(self.provide_token().await?.into()) }) + } +} + +impl_shared_conversions!(convert SharedTokenProvider from ProvideToken using SharedTokenProvider::new); diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt index 3bc616a9b8..e246227f53 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt @@ -56,6 +56,7 @@ val DECORATORS: List = InvocationIdDecorator(), RetryInformationHeaderDecorator(), RemoveDefaultsDecorator(), + TokenProvidersDecorator(), ), // Service specific decorators ApiGatewayDecorator().onlyApplyTo("com.amazonaws.apigateway#BackplaneControlService"), diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProviders.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt similarity index 86% rename from aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProviders.kt rename to aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt index ce8610e51b..73b60cf8b6 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProviders.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt @@ -5,12 +5,14 @@ package software.amazon.smithy.rustsdk +import software.amazon.smithy.aws.traits.auth.SigV4Trait +import software.amazon.smithy.model.knowledge.ServiceIndex import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.ClientRustModule import software.amazon.smithy.rust.codegen.client.smithy.configReexport import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator import software.amazon.smithy.rust.codegen.client.smithy.customize.TestUtilFeature -import software.amazon.smithy.rust.codegen.client.smithy.endpoint.supportedAuthSchemes +import software.amazon.smithy.rust.codegen.client.smithy.endpoint.usesSigV4a import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ServiceConfig import software.amazon.smithy.rust.codegen.core.rustlang.featureGateBlock @@ -22,29 +24,38 @@ import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType.Companion.pre import software.amazon.smithy.rust.codegen.core.smithy.RustCrate import software.amazon.smithy.rust.codegen.core.smithy.customize.AdHocCustomization import software.amazon.smithy.rust.codegen.core.smithy.customize.adhocCustomization +import software.amazon.smithy.rust.codegen.core.util.letIf class CredentialsProviderDecorator : ClientCodegenDecorator { override val name: String = "CredentialsProvider" override val order: Byte = 0 + private fun applies(codegenContext: ClientCodegenContext): Boolean = + ServiceIndex.of(codegenContext.model).getEffectiveAuthSchemes(codegenContext.serviceShape) + .containsKey(SigV4Trait.ID) || codegenContext.serviceShape.usesSigV4a() + override fun configCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, - ): List { - return baseCustomizations + CredentialProviderConfig(codegenContext) - } + ): List = + baseCustomizations.letIf(applies(codegenContext)) { it + CredentialProviderConfig(codegenContext) } override fun extraSections(codegenContext: ClientCodegenContext): List = - listOf( - adhocCustomization { section -> - rust("${section.serviceConfigBuilder}.set_credentials_provider(${section.sdkConfig}.credentials_provider());") - }, - ) + emptyList().letIf(applies(codegenContext)) { + it + + adhocCustomization { section -> + rust("${section.serviceConfigBuilder}.set_credentials_provider(${section.sdkConfig}.credentials_provider());") + } + } override fun extras( codegenContext: ClientCodegenContext, rustCrate: RustCrate, ) { + if (!applies(codegenContext)) { + return + } + rustCrate.mergeFeature(TestUtilFeature.copy(deps = listOf("aws-credential-types/test-util"))) rustCrate.withModule(ClientRustModule.config) { @@ -125,7 +136,7 @@ class CredentialProviderConfig(private val codegenContext: ClientCodegenContext) """, *codegenScope, ) { - if (codegenContext.serviceShape.supportedAuthSchemes().contains("sigv4a")) { + if (codegenContext.serviceShape.usesSigV4a()) { featureGateBlock("sigv4a") { rustTemplate( "self.runtime_components.set_identity_resolver(#{SIGV4A_SCHEME_ID}, credentials_provider.clone());", diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt index fb1385bdc6..f942f36314 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt @@ -14,7 +14,7 @@ import software.amazon.smithy.model.shapes.ShapeId import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.customize.AuthSchemeOption import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator -import software.amazon.smithy.rust.codegen.client.smithy.endpoint.supportedAuthSchemes +import software.amazon.smithy.rust.codegen.client.smithy.endpoint.usesSigV4a import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationSection import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginCustomization @@ -35,6 +35,7 @@ import software.amazon.smithy.rust.codegen.core.util.getTrait import software.amazon.smithy.rust.codegen.core.util.hasEventStreamOperations import software.amazon.smithy.rust.codegen.core.util.hasTrait import software.amazon.smithy.rust.codegen.core.util.isInputEventStream +import software.amazon.smithy.rust.codegen.core.util.letIf import software.amazon.smithy.rust.codegen.core.util.thenSingletonListOf class SigV4AuthDecorator : ClientCodegenDecorator { @@ -43,6 +44,10 @@ class SigV4AuthDecorator : ClientCodegenDecorator { private val sigv4a = "sigv4a" + private fun applies(codegenContext: ClientCodegenContext): Boolean = + ServiceIndex.of(codegenContext.model).getEffectiveAuthSchemes(codegenContext.serviceShape) + .containsKey(SigV4Trait.ID) || codegenContext.serviceShape.usesSigV4a() + private fun sigv4(runtimeConfig: RuntimeConfig) = writable { val awsRuntimeAuthModule = AwsRuntimeType.awsRuntime(runtimeConfig).resolve("auth") @@ -62,8 +67,12 @@ class SigV4AuthDecorator : ClientCodegenDecorator { operationShape: OperationShape, baseAuthSchemeOptions: List, ): List { + if (!applies(codegenContext)) { + return baseAuthSchemeOptions + } + val supportsSigV4a = - codegenContext.serviceShape.supportedAuthSchemes().contains(sigv4a) + codegenContext.serviceShape.usesSigV4a() .thenSingletonListOf { sigv4a(codegenContext.runtimeConfig) } return baseAuthSchemeOptions + AuthSchemeOption.StaticAuthSchemeOption( @@ -76,25 +85,39 @@ class SigV4AuthDecorator : ClientCodegenDecorator { codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = - baseCustomizations + listOf(AuthServiceRuntimePluginCustomization(codegenContext)) + baseCustomizations.letIf(applies(codegenContext)) { + it + + listOf( + AuthServiceRuntimePluginCustomization( + codegenContext, + ), + ) + } override fun operationCustomizations( codegenContext: ClientCodegenContext, operation: OperationShape, baseCustomizations: List, - ): List = baseCustomizations + AuthOperationCustomization(codegenContext) + ): List = + baseCustomizations.letIf(applies(codegenContext)) { it + AuthOperationCustomization(codegenContext) } override fun configCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = - baseCustomizations + SigV4SigningConfig(codegenContext.runtimeConfig, codegenContext.serviceShape.getTrait()) + baseCustomizations.letIf(applies(codegenContext)) { + it + + SigV4SigningConfig( + codegenContext.runtimeConfig, + codegenContext.serviceShape.getTrait(), + ) + } override fun extras( codegenContext: ClientCodegenContext, rustCrate: RustCrate, ) { - if (codegenContext.serviceShape.supportedAuthSchemes().contains("sigv4a")) { + if (codegenContext.serviceShape.usesSigV4a()) { // Add optional feature for SigV4a support rustCrate.mergeFeature(Feature("sigv4a", true, listOf("aws-runtime/sigv4a"))) } @@ -185,7 +208,7 @@ private class AuthServiceRuntimePluginCustomization(private val codegenContext: rustTemplate("#{SharedAuthScheme}::new(#{SigV4AuthScheme}::new())", *codegenScope) } - if (codegenContext.serviceShape.supportedAuthSchemes().contains("sigv4a")) { + if (codegenContext.serviceShape.usesSigV4a()) { featureGateBlock("sigv4a") { section.registerAuthScheme(this) { rustTemplate("#{SharedAuthScheme}::new(#{SigV4aAuthScheme}::new())", *codegenScope) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt new file mode 100644 index 0000000000..5a9864a3ed --- /dev/null +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt @@ -0,0 +1,110 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package software.amazon.smithy.rustsdk + +import software.amazon.smithy.model.knowledge.ServiceIndex +import software.amazon.smithy.model.traits.HttpBearerAuthTrait +import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext +import software.amazon.smithy.rust.codegen.client.smithy.configReexport +import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator +import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization +import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ServiceConfig +import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency +import software.amazon.smithy.rust.codegen.core.rustlang.rust +import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate +import software.amazon.smithy.rust.codegen.core.rustlang.writable +import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.customize.AdHocCustomization +import software.amazon.smithy.rust.codegen.core.smithy.customize.adhocCustomization + +class TokenProvidersDecorator : ClientCodegenDecorator { + override val name: String get() = "TokenProvidersDecorator" + override val order: Byte = 0 + + private fun applies(codegenContext: ClientCodegenContext): Boolean = + ServiceIndex.of(codegenContext.model).getEffectiveAuthSchemes(codegenContext.serviceShape) + .containsKey(HttpBearerAuthTrait.ID) + + override fun configCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + if (applies(codegenContext)) { + baseCustomizations + TokenProviderConfig(codegenContext) + } else { + baseCustomizations + } + + override fun extraSections(codegenContext: ClientCodegenContext): List = + if (applies(codegenContext)) { + listOf( + adhocCustomization { section -> + rust("${section.serviceConfigBuilder}.set_token_provider(${section.sdkConfig}.token_provider());") + }, + ) + } else { + emptyList() + } +} + +/** + * Add a `.token_provider` field and builder to the `Config` for a given service + */ +class TokenProviderConfig(private val codegenContext: ClientCodegenContext) : ConfigCustomization() { + private val runtimeConfig = codegenContext.runtimeConfig + private val codegenScope = + arrayOf( + *RuntimeType.preludeScope, + "Token" to configReexport(AwsRuntimeType.awsCredentialTypes(runtimeConfig).resolve("Token")), + "ProvideToken" to + configReexport( + AwsRuntimeType.awsCredentialTypes(runtimeConfig) + .resolve("provider::token::ProvideToken"), + ), + "SharedTokenProvider" to + configReexport( + AwsRuntimeType.awsCredentialTypes(runtimeConfig) + .resolve("provider::token::SharedTokenProvider"), + ), + "TestToken" to AwsRuntimeType.awsCredentialTypesTestUtil(runtimeConfig).resolve("Token"), + "HTTP_BEARER_AUTH_SCHEME_ID" to + CargoDependency.smithyRuntimeApiClient(runtimeConfig) + .withFeature("http-auth").toType().resolve("client::auth::http").resolve("HTTP_BEARER_AUTH_SCHEME_ID"), + ) + + override fun section(section: ServiceConfig) = + writable { + when (section) { + ServiceConfig.BuilderImpl -> { + rustTemplate( + """ + /// Sets the access token provider for this service + pub fn token_provider(mut self, token_provider: impl #{ProvideToken} + 'static) -> Self { + self.set_token_provider(#{Some}(#{SharedTokenProvider}::new(token_provider))); + self + } + + /// Sets the access token provider for this service + pub fn set_token_provider(&mut self, token_provider: #{Option}<#{SharedTokenProvider}>) -> &mut Self { + if let Some(token_provider) = token_provider { + self.runtime_components.set_identity_resolver(#{HTTP_BEARER_AUTH_SCHEME_ID}, token_provider); + } + self + } + """, + *codegenScope, + ) + } + + is ServiceConfig.DefaultForTests -> + rustTemplate( + "${section.configBuilderRef}.set_token_provider(Some(#{SharedTokenProvider}::new(#{TestToken}::for_tests())));", + *codegenScope, + ) + + else -> emptySection + } + } +} diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecoratorTest.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecoratorTest.kt new file mode 100644 index 0000000000..01ea19dc96 --- /dev/null +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecoratorTest.kt @@ -0,0 +1,75 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package software.amazon.smithy.rustsdk + +import org.junit.jupiter.api.Test +import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate +import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel +import software.amazon.smithy.rust.codegen.core.testutil.integrationTest +import software.amazon.smithy.rust.codegen.core.testutil.tokioTest + +class TokenProvidersDecoratorTest { + val model = + """ + namespace test + + use aws.api#service + use aws.protocols#restJson1 + use smithy.rules#endpointRuleSet + + @service(sdkId: "dontcare") + @restJson1 + @httpBearerAuth + @endpointRuleSet({ + "version": "1.0", + "rules": [{ "type": "endpoint", "conditions": [], "endpoint": { "url": "https://example.com" } }], + "parameters": { + "Region": { "required": false, "type": "String", "builtIn": "AWS::Region" }, + } + }) + service TestService { + version: "2023-01-01", + operations: [SomeOperation] + } + + structure SomeOutput { + someAttribute: Long, + someVal: String + } + + @http(uri: "/SomeOperation", method: "GET") + operation SomeOperation { + output: SomeOutput + } + """.asSmithyModel() + + @Test + fun `it adds token provider configuration`() { + awsSdkIntegrationTest(model) { ctx, rustCrate -> + rustCrate.integrationTest("token_providers") { + tokioTest("configuring_credentials_provider_at_operation_level_should_work") { + val moduleName = ctx.moduleUseName() + rustTemplate( + """ + // this should compile + let _ = $moduleName::Config::builder() + .token_provider(#{TestToken}::for_tests()) + .build(); + + // this should also compile + $moduleName::Config::builder() + .set_token_provider(Some(#{SharedTokenProvider}::new(#{TestToken}::for_tests()))); + """, + "TestToken" to AwsRuntimeType.awsCredentialTypesTestUtil(ctx.runtimeConfig).resolve("Token"), + "SharedTokenProvider" to + AwsRuntimeType.awsCredentialTypes(ctx.runtimeConfig) + .resolve("provider::token::SharedTokenProvider"), + ) + } + } + } + } +} diff --git a/aws/sdk/aws-models/codecatalyst.json b/aws/sdk/aws-models/codecatalyst.json new file mode 100644 index 0000000000..846a5a2ad0 --- /dev/null +++ b/aws/sdk/aws-models/codecatalyst.json @@ -0,0 +1,5574 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.codecatalyst#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.codecatalyst#AccessToken": { + "type": "resource", + "identifiers": { + "accessTokenId": { + "target": "com.amazonaws.codecatalyst#AccessTokenId" + } + }, + "create": { + "target": "com.amazonaws.codecatalyst#CreateAccessToken" + }, + "delete": { + "target": "com.amazonaws.codecatalyst#DeleteAccessToken" + }, + "list": { + "target": "com.amazonaws.codecatalyst#ListAccessTokens" + } + }, + "com.amazonaws.codecatalyst#AccessTokenId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 36 + } + } + }, + "com.amazonaws.codecatalyst#AccessTokenName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.codecatalyst#AccessTokenSecret": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 4000 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.codecatalyst#AccessTokenSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#AccessTokenSummary" + } + }, + "com.amazonaws.codecatalyst#AccessTokenSummary": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.codecatalyst#AccessTokenId", + "traits": { + "smithy.api#documentation": "

The system-generated ID of the personal access token.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "accessTokenId" + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#AccessTokenName", + "traits": { + "smithy.api#documentation": "

The friendly name of the personal access token.

", + "smithy.api#required": {} + } + }, + "expiresTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time when the personal access token will expire, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#timestampFormat": "date-time" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a specified personal access token (PAT).

" + } + }, + "com.amazonaws.codecatalyst#ClientToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + } + } + }, + "com.amazonaws.codecatalyst#CodeCatalyst": { + "type": "service", + "version": "2022-09-28", + "operations": [ + { + "target": "com.amazonaws.codecatalyst#GetUserDetails" + }, + { + "target": "com.amazonaws.codecatalyst#VerifySession" + } + ], + "resources": [ + { + "target": "com.amazonaws.codecatalyst#AccessToken" + }, + { + "target": "com.amazonaws.codecatalyst#Space" + } + ], + "errors": [ + { + "target": "com.amazonaws.codecatalyst#AccessDeniedException" + }, + { + "target": "com.amazonaws.codecatalyst#ConflictException" + }, + { + "target": "com.amazonaws.codecatalyst#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.codecatalyst#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.codecatalyst#ThrottlingException" + }, + { + "target": "com.amazonaws.codecatalyst#ValidationException" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "CodeCatalyst", + "endpointPrefix": "codecatalyst" + }, + "aws.protocols#restJson1": {}, + "smithy.api#documentation": "

Welcome to the Amazon CodeCatalyst API reference. This reference provides descriptions of operations and data types for Amazon CodeCatalyst. You can use the Amazon CodeCatalyst \n API to work with the following objects.

\n

Spaces, by calling the following:

\n
    \n
  • \n

    \n DeleteSpace, which deletes a space.

    \n
  • \n
  • \n

    \n GetSpace, which returns information about a space.

    \n
  • \n
  • \n

    \n GetSubscription, which returns information about the Amazon Web Services account used for billing purposes \n and the billing plan for the space.

    \n
  • \n
  • \n

    \n ListSpaces, which retrieves a list of spaces.

    \n
  • \n
  • \n

    \n UpdateSpace, which changes one or more values for a space.

    \n
  • \n
\n

Projects, by calling the following:

\n
    \n
  • \n

    \n CreateProject which creates a project in a specified space.

    \n
  • \n
  • \n

    \n GetProject, which returns information about a project.

    \n
  • \n
  • \n

    \n ListProjects, which retrieves a list of projects in a space.

    \n
  • \n
\n

Users, by calling the following:

\n
    \n
  • \n

    \n GetUserDetails, which returns information about a user in Amazon CodeCatalyst.

    \n
  • \n
\n

Source repositories, by calling the following:

\n \n

Dev Environments and the Amazon Web Services Toolkits, by calling the following:

\n \n

Workflows, by calling the following:

\n
    \n
  • \n

    \n GetWorkflow, which returns information about a workflow.

    \n
  • \n
  • \n

    \n GetWorkflowRun, which returns information about a specified run of a workflow.

    \n
  • \n
  • \n

    \n ListWorkflowRuns, which retrieves a list of runs of a specified workflow.

    \n
  • \n
  • \n

    \n ListWorkflows, which retrieves a list of workflows in a specified project.

    \n
  • \n
  • \n

    \n StartWorkflowRun, which starts a run of a specified workflow.

    \n
  • \n
\n

Security, activity, and resource management in Amazon CodeCatalyst, by calling the following:

\n
    \n
  • \n

    \n CreateAccessToken, which creates a personal access token (PAT) for the current user.

    \n
  • \n
  • \n

    \n DeleteAccessToken, which deletes a specified personal access token (PAT).

    \n
  • \n
  • \n

    \n ListAccessTokens, which lists all personal access tokens (PATs) associated with a user.

    \n
  • \n
  • \n

    \n ListEventLogs, which retrieves a list of events that occurred during a specified time period in a space.

    \n
  • \n
  • \n

    \n VerifySession, which verifies whether the calling user has a valid Amazon CodeCatalyst login and session.

    \n
  • \n
\n \n

If you are using the Amazon CodeCatalyst APIs with an SDK or the CLI, you must configure your computer to work with Amazon CodeCatalyst and single sign-on (SSO).\n For more information, see Setting up to use the CLI with Amazon CodeCatalyst\n and the SSO documentation for your SDK.

\n
", + "smithy.api#httpBearerAuth": {}, + "smithy.api#title": "Amazon CodeCatalyst", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "Boolean" + }, + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "String" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "not", + "argv": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ] + }, + { + "fn": "aws.partition", + "argv": [ + "us-west-2" + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + }, + false + ] + } + ], + "error": "Partition does not support FIPS.", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": "https://codecatalyst-fips.global.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, + { + "conditions": [], + "endpoint": { + "url": "https://codecatalyst.global.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + }, + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + }, + false + ] + } + ], + "error": "Partition does not support FIPS.", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": "https://codecatalyst-fips.global.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, + { + "conditions": [], + "endpoint": { + "url": "https://codecatalyst.global.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "version": "1", + "testCases": [ + { + "documentation": "Override endpoint", + "expect": { + "endpoint": { + "url": "https://test.codecatalyst.global.api.aws" + } + }, + "params": { + "Endpoint": "https://test.codecatalyst.global.api.aws" + } + }, + { + "documentation": "Default endpoint (region not set)", + "expect": { + "endpoint": { + "url": "https://codecatalyst.global.api.aws" + } + }, + "params": {} + }, + { + "documentation": "Default FIPS endpoint (region not set)", + "expect": { + "endpoint": { + "url": "https://codecatalyst-fips.global.api.aws" + } + }, + "params": { + "UseFIPS": true + } + }, + { + "documentation": "Default endpoint (region: aws-global)", + "expect": { + "endpoint": { + "url": "https://codecatalyst.global.api.aws" + } + }, + "params": { + "Region": "aws-global" + } + }, + { + "documentation": "Default FIPS endpoint (region: aws-global)", + "expect": { + "endpoint": { + "url": "https://codecatalyst-fips.global.api.aws" + } + }, + "params": { + "Region": "aws-global", + "UseFIPS": true + } + }, + { + "documentation": "Default endpoint for a valid home region (region: us-west-2)", + "expect": { + "endpoint": { + "url": "https://codecatalyst.global.api.aws" + } + }, + "params": { + "Region": "us-west-2" + } + }, + { + "documentation": "Default FIPS endpoint for a valid home region (region: us-west-2)", + "expect": { + "endpoint": { + "url": "https://codecatalyst-fips.global.api.aws" + } + }, + "params": { + "Region": "us-west-2", + "UseFIPS": true + } + }, + { + "documentation": "Default endpoint for an unavailable home region (region: us-east-1)", + "expect": { + "endpoint": { + "url": "https://codecatalyst.global.api.aws" + } + }, + "params": { + "Region": "us-east-1" + } + }, + { + "documentation": "Default FIPS endpoint for an unavailable home region (region: us-east-1)", + "expect": { + "endpoint": { + "url": "https://codecatalyst-fips.global.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true + } + } + ] + } + } + }, + "com.amazonaws.codecatalyst#ComparisonOperator": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "EQUALS", + "value": "EQ" + }, + { + "name": "GREATER_THAN", + "value": "GT" + }, + { + "name": "GREATER_THAN_OR_EQUALS", + "value": "GE" + }, + { + "name": "LESS_THAN", + "value": "LT" + }, + { + "name": "LESS_THAN_OR_EQUALS", + "value": "LE" + }, + { + "name": "BEGINS_WITH", + "value": "BEGINS_WITH" + } + ] + } + }, + "com.amazonaws.codecatalyst#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. \n Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.codecatalyst#CreateAccessToken": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#CreateAccessTokenRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#CreateAccessTokenResponse" + }, + "traits": { + "smithy.api#documentation": "

Creates a personal access token (PAT) for the current user. A personal access token (PAT) is similar to a password. \n It is associated with your user identity for use across all spaces and projects in Amazon CodeCatalyst. You use PATs to access CodeCatalyst \n from resources that include integrated development environments (IDEs) and Git-based source repositories. \n PATs represent you in Amazon CodeCatalyst and you can manage them in your user settings.For more information, see \n Managing personal access tokens in Amazon CodeCatalyst.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/accessTokens", + "code": 201 + } + } + }, + "com.amazonaws.codecatalyst#CreateAccessTokenRequest": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.codecatalyst#AccessTokenName", + "traits": { + "smithy.api#documentation": "

The friendly name of the personal access token.

", + "smithy.api#required": {} + } + }, + "expiresTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the personal access token expires, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#timestampFormat": "date-time" + } + } + } + }, + "com.amazonaws.codecatalyst#CreateAccessTokenResponse": { + "type": "structure", + "members": { + "secret": { + "target": "com.amazonaws.codecatalyst#AccessTokenSecret", + "traits": { + "smithy.api#documentation": "

The secret value of the personal access token.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#AccessTokenName", + "traits": { + "smithy.api#documentation": "

The friendly name of the personal access token.

", + "smithy.api#required": {} + } + }, + "expiresTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the personal access token expires, in coordinated universal time (UTC) timestamp format as specified in RFC 3339. If not specified, the default is one year from creation.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "accessTokenId": { + "target": "com.amazonaws.codecatalyst#AccessTokenId", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the access token.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#CreateDevEnvironment": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#CreateDevEnvironmentRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#CreateDevEnvironmentResponse" + }, + "traits": { + "smithy.api#documentation": "

Creates a Dev Environment in Amazon CodeCatalyst, a cloud-based development environment that you can use to quickly work on the code stored \n in the source repositories of your project.

\n \n

When created in the Amazon CodeCatalyst console, by default a Dev Environment is configured to have a 2 core processor, 4GB of RAM, and 16GB of persistent storage. None of these\n defaults apply to a Dev Environment created programmatically.

\n
", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments", + "code": 201 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#CreateDevEnvironmentRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "repositories": { + "target": "com.amazonaws.codecatalyst#RepositoriesInput", + "traits": { + "smithy.api#documentation": "

The source repository that contains the branch to clone into the Dev Environment.

" + } + }, + "clientToken": { + "target": "com.amazonaws.codecatalyst#ClientToken", + "traits": { + "smithy.api#documentation": "

A user-specified idempotency token. Idempotency ensures that an API request completes only once. \n With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.

" + } + }, + "alias": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The user-defined alias for a Dev Environment.

", + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]+(?:[-_\\.][a-zA-Z0-9]+)*$" + } + }, + "ides": { + "target": "com.amazonaws.codecatalyst#IdeConfigurationList", + "traits": { + "smithy.api#documentation": "

Information about the integrated development environment (IDE) configured for a\n Dev Environment.

\n \n

An IDE is required to create a Dev Environment. For Dev Environment creation, this field\n contains configuration information and must be provided.

\n
" + } + }, + "instanceType": { + "target": "com.amazonaws.codecatalyst#InstanceType", + "traits": { + "smithy.api#documentation": "

The Amazon EC2 instace type to use for the Dev Environment.

", + "smithy.api#required": {} + } + }, + "inactivityTimeoutMinutes": { + "target": "com.amazonaws.codecatalyst#InactivityTimeoutMinutes", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.

" + } + }, + "persistentStorage": { + "target": "com.amazonaws.codecatalyst#PersistentStorageConfiguration", + "traits": { + "smithy.api#documentation": "

Information about the amount of storage allocated to the Dev Environment.

\n \n

By default, a Dev Environment is configured to have 16GB of persistent storage when created from the Amazon CodeCatalyst console, but there is no default when programmatically\n creating a Dev Environment. \n Valid values for persistent storage are based on memory sizes in 16GB increments. Valid\n values are 16, 32, and 64.

\n
", + "smithy.api#required": {} + } + }, + "vpcConnectionName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the connection to use connect to a Amazon VPC.

" + } + } + } + }, + "com.amazonaws.codecatalyst#CreateDevEnvironmentResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "vpcConnectionName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the connection used to connect to Amazon VPC used when the Dev Environment was created, if any.

" + } + } + } + }, + "com.amazonaws.codecatalyst#CreateProject": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#CreateProjectRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#CreateProjectResponse" + }, + "traits": { + "smithy.api#documentation": "

Creates a project in a specified space.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/spaces/{spaceName}/projects", + "code": 201 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#CreateProjectRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.codecatalyst#ProjectDisplayName", + "traits": { + "smithy.api#documentation": "

The friendly name of the project that will be displayed to users.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.codecatalyst#ProjectDescription", + "traits": { + "smithy.api#documentation": "

The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose.

" + } + } + } + }, + "com.amazonaws.codecatalyst#CreateProjectResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

" + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "projectName" + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name of the project.

" + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the project.

" + } + } + } + }, + "com.amazonaws.codecatalyst#CreateSourceRepository": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#CreateSourceRepositoryRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#CreateSourceRepositoryResponse" + }, + "traits": { + "smithy.api#documentation": "

Creates an empty Git-based source repository in a specified project. The repository is\n created with an initial empty commit with a default branch named main.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{name}", + "code": 201 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#CreateSourceRepositoryBranch": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#CreateSourceRepositoryBranchRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#CreateSourceRepositoryBranchResponse" + }, + "traits": { + "smithy.api#documentation": "

Creates a branch in a specified source repository in Amazon CodeCatalyst.

\n \n

This API only creates a branch in a source repository hosted in Amazon CodeCatalyst. You cannot use this API to create a branch in a linked repository.

\n
", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/branches/{name}", + "code": 201 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#CreateSourceRepositoryBranchRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "sourceRepositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the repository where you want to create a branch.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchString", + "traits": { + "smithy.api#documentation": "

The name for the branch you're creating.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "sourceRepositoryBranchName" + } + }, + "headCommitId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The commit ID in an existing branch from which you want to create the new branch.

" + } + } + } + }, + "com.amazonaws.codecatalyst#CreateSourceRepositoryBranchResponse": { + "type": "structure", + "members": { + "ref": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchRefString", + "traits": { + "smithy.api#documentation": "

The Git reference name of the branch.

" + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchString", + "traits": { + "smithy.api#documentation": "

The name of the newly created branch.

" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time the branch was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#timestampFormat": "date-time" + } + }, + "headCommitId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The commit ID of the tip of the newly created branch.

" + } + } + } + }, + "com.amazonaws.codecatalyst#CreateSourceRepositoryRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository. For more information about name requirements, see Quotas for source repositories.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "sourceRepositoryName" + } + }, + "description": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryDescriptionString", + "traits": { + "smithy.api#documentation": "

The description of the source repository.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#CreateSourceRepositoryResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryDescriptionString", + "traits": { + "smithy.api#documentation": "

The description of the source repository.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#DeleteAccessToken": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#DeleteAccessTokenRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#DeleteAccessTokenResponse" + }, + "traits": { + "smithy.api#documentation": "

Deletes a specified personal access token (PAT). A personal access token can only be deleted by the user who created it.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/accessTokens/{id}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#DeleteAccessTokenRequest": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.codecatalyst#AccessTokenId", + "traits": { + "smithy.api#documentation": "

The ID of the personal access token to delete. You can find the IDs of all PATs associated with your Amazon Web Services Builder ID in a space by calling ListAccessTokens.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "accessTokenId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#DeleteAccessTokenResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#DeleteDevEnvironment": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#DeleteDevEnvironmentRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#DeleteDevEnvironmentResponse" + }, + "traits": { + "smithy.api#documentation": "

Deletes a Dev Environment.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#DeleteDevEnvironmentRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment you want to delete. To retrieve a list of Dev Environment IDs, use ListDevEnvironments.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + } + } + }, + "com.amazonaws.codecatalyst#DeleteDevEnvironmentResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the deleted Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + } + } + }, + "com.amazonaws.codecatalyst#DeleteProject": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#DeleteProjectRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#DeleteProjectResponse" + }, + "traits": { + "smithy.api#documentation": "

Deletes a project in a space.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/spaces/{spaceName}/projects/{name}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#DeleteProjectRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space. To retrieve a list of project names, use ListProjects.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "projectName" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#DeleteProjectResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "projectName" + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name displayed to users of the project in Amazon CodeCatalyst.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#DeleteSourceRepository": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#DeleteSourceRepositoryRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#DeleteSourceRepositoryResponse" + }, + "traits": { + "smithy.api#documentation": "

Deletes a source repository in Amazon CodeCatalyst. You cannot use this API to delete a linked repository. It can only be used to delete a Amazon CodeCatalyst source repository.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{name}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#DeleteSourceRepositoryRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "sourceRepositoryName" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#DeleteSourceRepositoryResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the repository.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#DeleteSpace": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#DeleteSpaceRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#DeleteSpaceResponse" + }, + "traits": { + "smithy.api#documentation": "

Deletes a space.

\n \n

Deleting a space cannot be undone. Additionally, since space names must be unique across Amazon CodeCatalyst, you cannot reuse names of deleted spaces.

\n
", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/spaces/{name}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#DeleteSpaceRequest": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space. To retrieve a list of space names, use ListSpaces.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "spaceName" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#DeleteSpaceResponse": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "spaceName" + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name of the space displayed to users of the space in Amazon CodeCatalyst.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#DevEnvironment": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "devEnvironmentId": { + "target": "com.amazonaws.codecatalyst#Uuid" + } + }, + "create": { + "target": "com.amazonaws.codecatalyst#CreateDevEnvironment" + }, + "read": { + "target": "com.amazonaws.codecatalyst#GetDevEnvironment" + }, + "update": { + "target": "com.amazonaws.codecatalyst#UpdateDevEnvironment" + }, + "delete": { + "target": "com.amazonaws.codecatalyst#DeleteDevEnvironment" + }, + "operations": [ + { + "target": "com.amazonaws.codecatalyst#ListDevEnvironmentSessions" + }, + { + "target": "com.amazonaws.codecatalyst#StartDevEnvironment" + }, + { + "target": "com.amazonaws.codecatalyst#StartDevEnvironmentSession" + }, + { + "target": "com.amazonaws.codecatalyst#StopDevEnvironment" + }, + { + "target": "com.amazonaws.codecatalyst#StopDevEnvironmentSession" + } + ] + }, + "com.amazonaws.codecatalyst#DevEnvironmentAccessDetails": { + "type": "structure", + "members": { + "streamUrl": { + "target": "com.amazonaws.codecatalyst#SensitiveString", + "traits": { + "smithy.api#documentation": "

The URL used to send commands to and from the Dev Environment.

", + "smithy.api#required": {} + } + }, + "tokenValue": { + "target": "com.amazonaws.codecatalyst#SensitiveString", + "traits": { + "smithy.api#documentation": "

An encrypted token value that contains session and caller information used to authenticate the connection.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about connection details for a Dev Environment.

", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentRepositorySummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentRepositorySummary" + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentRepositorySummary": { + "type": "structure", + "members": { + "repositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#required": {} + } + }, + "branchName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchString", + "traits": { + "smithy.api#documentation": "

The name of the branch in a source repository cloned into the Dev Environment.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the source repsitory for a Dev Environment.

" + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentSessionConfiguration": { + "type": "structure", + "members": { + "sessionType": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentSessionType", + "traits": { + "smithy.api#documentation": "

The type of the session.

", + "smithy.api#required": {} + } + }, + "executeCommandSessionConfiguration": { + "target": "com.amazonaws.codecatalyst#ExecuteCommandSessionConfiguration", + "traits": { + "smithy.api#documentation": "

Information about optional commands that will be run on the Dev Environment when the SSH session begins.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the configuration of a Dev Environment session.

" + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentSessionSummary": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "devEnvironmentId": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "startedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the session started, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment session.

", + "smithy.api#length": { + "min": 1, + "max": 96 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about active sessions for a Dev Environment.

" + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentSessionType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "SSM", + "value": "SSM" + }, + { + "name": "SSH", + "value": "SSH" + } + ] + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentSessionsSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentSessionSummary" + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "PENDING", + "value": "PENDING" + }, + { + "name": "RUNNING", + "value": "RUNNING" + }, + { + "name": "STARTING", + "value": "STARTING" + }, + { + "name": "STOPPING", + "value": "STOPPING" + }, + { + "name": "STOPPED", + "value": "STOPPED" + }, + { + "name": "FAILED", + "value": "FAILED" + }, + { + "name": "DELETING", + "value": "DELETING" + }, + { + "name": "DELETED", + "value": "DELETED" + } + ] + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentSummary": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

" + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

" + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID for the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the Dev Environment was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "creatorId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the user who created the Dev Environment.

", + "smithy.api#length": { + "max": 1024 + }, + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentStatus", + "traits": { + "smithy.api#documentation": "

The status of the Dev Environment.

", + "smithy.api#required": {} + } + }, + "statusReason": { + "target": "com.amazonaws.codecatalyst#StatusReason", + "traits": { + "smithy.api#documentation": "

The reason for the status.

" + } + }, + "repositories": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentRepositorySummaries", + "traits": { + "smithy.api#documentation": "

Information about the repositories that will be cloned into the Dev Environment. If no rvalue is specified, no repository is cloned.

", + "smithy.api#required": {} + } + }, + "alias": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The user-specified alias for the Dev Environment.

", + "smithy.api#length": { + "max": 128 + } + } + }, + "ides": { + "target": "com.amazonaws.codecatalyst#Ides", + "traits": { + "smithy.api#documentation": "

Information about the integrated development environment (IDE) configured for a Dev Environment.

" + } + }, + "instanceType": { + "target": "com.amazonaws.codecatalyst#InstanceType", + "traits": { + "smithy.api#documentation": "

The Amazon EC2 instace type used for the Dev Environment.

", + "smithy.api#required": {} + } + }, + "inactivityTimeoutMinutes": { + "target": "com.amazonaws.codecatalyst#InactivityTimeoutMinutes", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Dev Environments consume compute minutes when running.

", + "smithy.api#required": {} + } + }, + "persistentStorage": { + "target": "com.amazonaws.codecatalyst#PersistentStorage", + "traits": { + "smithy.api#documentation": "

Information about the configuration of persistent storage for the Dev Environment.

", + "smithy.api#required": {} + } + }, + "vpcConnectionName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the connection used to connect to Amazon VPC used when the Dev Environment was created, if any.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a Dev Environment.

" + } + }, + "com.amazonaws.codecatalyst#DevEnvironmentSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentSummary" + } + }, + "com.amazonaws.codecatalyst#EmailAddress": { + "type": "structure", + "members": { + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The email address.

" + } + }, + "verified": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Whether the email address has been verified.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about an email address.

" + } + }, + "com.amazonaws.codecatalyst#EventLogEntries": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#EventLogEntry" + } + }, + "com.amazonaws.codecatalyst#EventLogEntry": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the event.

", + "smithy.api#required": {} + } + }, + "eventName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the event.

", + "smithy.api#required": {} + } + }, + "eventType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The type of the event.

", + "smithy.api#required": {} + } + }, + "eventCategory": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The category for the event.

", + "smithy.api#required": {} + } + }, + "eventSource": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The source of the event.

", + "smithy.api#required": {} + } + }, + "eventTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time the event took place, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "operationType": { + "target": "com.amazonaws.codecatalyst#OperationType", + "traits": { + "smithy.api#documentation": "

The type of the event.

", + "smithy.api#required": {} + } + }, + "userIdentity": { + "target": "com.amazonaws.codecatalyst#UserIdentity", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the user whose actions are recorded in the event.

", + "smithy.api#required": {} + } + }, + "projectInformation": { + "target": "com.amazonaws.codecatalyst#ProjectInformation", + "traits": { + "smithy.api#documentation": "

Information about the project where the event occurred.

" + } + }, + "requestId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the request.

" + } + }, + "requestPayload": { + "target": "com.amazonaws.codecatalyst#EventPayload", + "traits": { + "smithy.api#documentation": "

Information about the payload of the request.

" + } + }, + "responsePayload": { + "target": "com.amazonaws.codecatalyst#EventPayload", + "traits": { + "smithy.api#documentation": "

Information about the payload of the response, if any.

" + } + }, + "errorCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The code of the error, if any.

" + } + }, + "sourceIpAddress": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The IP address of the user whose actions are recorded in the event.

" + } + }, + "userAgent": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The user agent whose actions are recorded in the event.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about an entry in an event log of Amazon CodeCatalyst activity.

" + } + }, + "com.amazonaws.codecatalyst#EventLogResource": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "eventLogId": { + "target": "smithy.api#String" + } + }, + "list": { + "target": "com.amazonaws.codecatalyst#ListEventLogs" + } + }, + "com.amazonaws.codecatalyst#EventPayload": { + "type": "structure", + "members": { + "contentType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The type of content in the event payload.

" + } + }, + "data": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The data included in the event payload.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the payload of an event recording Amazon CodeCatalyst activity.

" + } + }, + "com.amazonaws.codecatalyst#ExecuteCommandSessionConfiguration": { + "type": "structure", + "members": { + "command": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The command used at the beginning of the SSH session to a Dev Environment.

", + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#required": {} + } + }, + "arguments": { + "target": "com.amazonaws.codecatalyst#ExecuteCommandSessionConfigurationArguments", + "traits": { + "smithy.api#documentation": "

An array of arguments containing arguments and members.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the commands that will be run on a Dev Environment when an SSH session begins.

" + } + }, + "com.amazonaws.codecatalyst#ExecuteCommandSessionConfigurationArguments": { + "type": "list", + "member": { + "target": "smithy.api#String", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + } + } + } + }, + "com.amazonaws.codecatalyst#Filter": { + "type": "structure", + "members": { + "key": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A key that can be used to sort results.

", + "smithy.api#required": {} + } + }, + "values": { + "target": "com.amazonaws.codecatalyst#StringList", + "traits": { + "smithy.api#documentation": "

The values of the key.

", + "smithy.api#required": {} + } + }, + "comparisonOperator": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The operator used to compare the fields.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a filter used to limit results of a query.

" + } + }, + "com.amazonaws.codecatalyst#FilterKey": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "HAS_ACCESS_TO", + "value": "hasAccessTo" + }, + { + "name": "NAME", + "value": "name" + } + ] + } + }, + "com.amazonaws.codecatalyst#Filters": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#Filter" + } + }, + "com.amazonaws.codecatalyst#GetDevEnvironment": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetDevEnvironmentRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetDevEnvironmentResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about a Dev Environment for a source repository in a project. Dev Environments are specific to the user who creates them.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetDevEnvironmentRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment for which you want to view information. To retrieve a list of Dev Environment IDs, use ListDevEnvironments.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + } + } + }, + "com.amazonaws.codecatalyst#GetDevEnvironmentResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the Dev Environment was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "creatorId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the user who created the Dev Environment.

", + "smithy.api#length": { + "max": 1024 + }, + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentStatus", + "traits": { + "smithy.api#documentation": "

The current status of the Dev Environment.

", + "smithy.api#required": {} + } + }, + "statusReason": { + "target": "com.amazonaws.codecatalyst#StatusReason", + "traits": { + "smithy.api#documentation": "

The reason for the status.

" + } + }, + "repositories": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentRepositorySummaries", + "traits": { + "smithy.api#documentation": "

The source repository that contains the branch cloned into the Dev Environment.

", + "smithy.api#required": {} + } + }, + "alias": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The user-specified alias for the Dev Environment.

", + "smithy.api#length": { + "max": 128 + } + } + }, + "ides": { + "target": "com.amazonaws.codecatalyst#Ides", + "traits": { + "smithy.api#documentation": "

Information about the integrated development environment (IDE) configured for the Dev Environment.

" + } + }, + "instanceType": { + "target": "com.amazonaws.codecatalyst#InstanceType", + "traits": { + "smithy.api#documentation": "

The Amazon EC2 instace type to use for the Dev Environment.

", + "smithy.api#required": {} + } + }, + "inactivityTimeoutMinutes": { + "target": "com.amazonaws.codecatalyst#InactivityTimeoutMinutes", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The amount of time the Dev Environment will run without any activity detected before stopping, in minutes.

", + "smithy.api#required": {} + } + }, + "persistentStorage": { + "target": "com.amazonaws.codecatalyst#PersistentStorage", + "traits": { + "smithy.api#documentation": "

Information about the amount of storage allocated to the Dev Environment. By default, a Dev Environment is configured to have 16GB of persistent storage.

", + "smithy.api#required": {} + } + }, + "vpcConnectionName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the connection used to connect to Amazon VPC used when the Dev Environment was created, if any.

" + } + } + } + }, + "com.amazonaws.codecatalyst#GetProject": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetProjectRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetProjectResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about a project.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/spaces/{spaceName}/projects/{name}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetProjectRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "projectName" + } + } + } + }, + "com.amazonaws.codecatalyst#GetProjectResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name of the project displayed to users in Amazon CodeCatalyst.

" + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the project.

" + } + } + } + }, + "com.amazonaws.codecatalyst#GetSourceRepository": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetSourceRepositoryRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetSourceRepositoryResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about a source repository.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{name}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetSourceRepositoryCloneUrls": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetSourceRepositoryCloneUrlsRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetSourceRepositoryCloneUrlsResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about the URLs that can be used with a Git client to clone a source\n repository.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/cloneUrls", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetSourceRepositoryCloneUrlsRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "sourceRepositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#GetSourceRepositoryCloneUrlsResponse": { + "type": "structure", + "members": { + "https": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The HTTPS URL to use when cloning the source repository.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#GetSourceRepositoryRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "sourceRepositoryName" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#GetSourceRepositoryResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryDescriptionString", + "traits": { + "smithy.api#documentation": "

The description of the source repository.

" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time the source repository was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {} + } + }, + "createdTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time the source repository was created, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#GetSpace": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetSpaceRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetSpaceResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about an space.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/spaces/{name}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetSpaceRequest": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "spaceName" + } + } + } + }, + "com.amazonaws.codecatalyst#GetSpaceResponse": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "regionName": { + "target": "com.amazonaws.codecatalyst#RegionString", + "traits": { + "smithy.api#documentation": "

The Amazon Web Services Region where the space exists.

", + "smithy.api#required": {} + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name of the space displayed to users.

" + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the space.

" + } + } + } + }, + "com.amazonaws.codecatalyst#GetSubscription": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetSubscriptionRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetSubscriptionResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about the Amazon Web Services account used for billing purposes \n and the billing plan for the space.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/spaces/{spaceName}/subscription", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetSubscriptionRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#GetSubscriptionResponse": { + "type": "structure", + "members": { + "subscriptionType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The type of the billing plan for the space.

" + } + }, + "awsAccountName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The display name of the Amazon Web Services account used for billing for the space.

" + } + } + } + }, + "com.amazonaws.codecatalyst#GetUserDetails": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetUserDetailsRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetUserDetailsResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about a user.

", + "smithy.api#http": { + "method": "GET", + "uri": "/userDetails", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetUserDetailsRequest": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the user.

", + "smithy.api#httpQuery": "id", + "smithy.api#length": { + "min": 1, + "max": 256 + } + } + }, + "userName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the user as displayed in Amazon CodeCatalyst.

", + "smithy.api#httpQuery": "userName", + "smithy.api#length": { + "min": 3, + "max": 100 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]{3,100}$" + } + } + } + }, + "com.amazonaws.codecatalyst#GetUserDetailsResponse": { + "type": "structure", + "members": { + "userId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the user.

" + } + }, + "userName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the user as displayed in Amazon CodeCatalyst.

" + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name displayed for the user in Amazon CodeCatalyst.

" + } + }, + "primaryEmail": { + "target": "com.amazonaws.codecatalyst#EmailAddress", + "traits": { + "smithy.api#documentation": "

The email address provided by the user when they signed up.

" + } + }, + "version": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

" + } + } + } + }, + "com.amazonaws.codecatalyst#GetWorkflow": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetWorkflowRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetWorkflowResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about a workflow.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/workflows/{id}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetWorkflowRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The ID of the workflow. To rerieve a list of workflow IDs, use ListWorkflows.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "workflowId" + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#length": { + "min": 1 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#GetWorkflowResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The ID of the workflow.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "workflowId" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the workflow.

", + "smithy.api#required": {} + } + }, + "sourceRepositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository where the workflow YAML is stored.

" + } + }, + "sourceBranchName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchString", + "traits": { + "smithy.api#documentation": "

The name of the branch that contains the workflow YAML.

" + } + }, + "definition": { + "target": "com.amazonaws.codecatalyst#WorkflowDefinition", + "traits": { + "smithy.api#documentation": "

Information about the workflow definition file for the workflow.

", + "smithy.api#required": {} + } + }, + "createdTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow was created, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "runMode": { + "target": "com.amazonaws.codecatalyst#WorkflowRunMode", + "traits": { + "smithy.api#documentation": "

The behavior to use when multiple workflows occur at the same time. For more information, see \n https://docs.aws.amazon.com/codecatalyst/latest/userguide/workflows-configure-runs.html in the Amazon CodeCatalyst User Guide.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.codecatalyst#WorkflowStatus", + "traits": { + "smithy.api#documentation": "

The status of the workflow.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#GetWorkflowRun": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#GetWorkflowRunRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#GetWorkflowRunResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns information about a specified run of a workflow.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/workflowRuns/{id}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#GetWorkflowRunRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The ID of the workflow run. To retrieve a list of workflow run IDs, use ListWorkflowRuns.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "workflowRunId" + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#length": { + "min": 1 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#GetWorkflowRunResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The ID of the workflow run.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "workflowRunId" + } + }, + "workflowId": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The ID of the workflow.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.codecatalyst#WorkflowRunStatus", + "traits": { + "smithy.api#documentation": "

The status of the workflow run.

", + "smithy.api#required": {} + } + }, + "statusReasons": { + "target": "com.amazonaws.codecatalyst#WorkflowRunStatusReasons", + "traits": { + "smithy.api#documentation": "

Information about the reasons for the status of the workflow run.

" + } + }, + "startTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow run began, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "endTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow run ended, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#timestampFormat": "date-time" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow run status was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#Ide": { + "type": "structure", + "members": { + "runtime": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A link to the IDE runtime image.

", + "smithy.api#length": { + "min": 1, + "max": 400 + } + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the IDE.

", + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about an integrated development environment (IDE) used in a Dev Environment.

" + } + }, + "com.amazonaws.codecatalyst#IdeConfiguration": { + "type": "structure", + "members": { + "runtime": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A link to the IDE runtime image.

\n \n

This parameter is not required for VSCode.

\n
", + "smithy.api#length": { + "min": 1, + "max": 400 + } + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the IDE. Valid values include Cloud9, IntelliJ, PyCharm, GoLand, and VSCode.

", + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the configuration of an integrated development environment (IDE) for a Dev Environment.

" + } + }, + "com.amazonaws.codecatalyst#IdeConfigurationList": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#IdeConfiguration" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1 + } + } + }, + "com.amazonaws.codecatalyst#Ides": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#Ide" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1 + } + } + }, + "com.amazonaws.codecatalyst#InactivityTimeoutMinutes": { + "type": "integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#range": { + "min": 0, + "max": 1200 + } + } + }, + "com.amazonaws.codecatalyst#InstanceType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "DEV_STANDARD1_SMALL", + "value": "dev.standard1.small" + }, + { + "name": "DEV_STANDARD1_MEDIUM", + "value": "dev.standard1.medium" + }, + { + "name": "DEV_STANDARD1_LARGE", + "value": "dev.standard1.large" + }, + { + "name": "DEV_STANDARD1_XLARGE", + "value": "dev.standard1.xlarge" + } + ] + } + }, + "com.amazonaws.codecatalyst#ListAccessTokens": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListAccessTokensRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListAccessTokensResponse" + }, + "traits": { + "smithy.api#documentation": "

Lists all personal access tokens (PATs) associated with the user who calls the API. You can only list PATs associated with your Amazon Web Services Builder ID.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/accessTokens", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListAccessTokensRequest": { + "type": "structure", + "members": { + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#range": { + "max": 10 + } + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#length": { + "min": 1, + "max": 10000 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#ListAccessTokensResponse": { + "type": "structure", + "members": { + "items": { + "target": "com.amazonaws.codecatalyst#AccessTokenSummaries", + "traits": { + "smithy.api#documentation": "

A list of personal access tokens (PATs) associated with the calling user identity.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#ListDevEnvironmentSessions": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListDevEnvironmentSessionsRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListDevEnvironmentSessionsResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of active sessions for a Dev Environment in a project.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{devEnvironmentId}/sessions", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListDevEnvironmentSessionsRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "devEnvironmentId": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#length": { + "min": 1, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#ListDevEnvironmentSessionsResponse": { + "type": "structure", + "members": { + "items": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentSessionsSummaryList", + "traits": { + "smithy.api#documentation": "

Information about each session retrieved in the list.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#ListDevEnvironments": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListDevEnvironmentsRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListDevEnvironmentsResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of Dev Environments in a project.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces/{spaceName}/devEnvironments", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListDevEnvironmentsRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

" + } + }, + "filters": { + "target": "com.amazonaws.codecatalyst#Filters", + "traits": { + "smithy.api#documentation": "

Information about filters to apply to narrow the results returned in the list.

" + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#length": { + "min": 1, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + } + } + }, + "com.amazonaws.codecatalyst#ListDevEnvironmentsResponse": { + "type": "structure", + "members": { + "items": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentSummaryList", + "traits": { + "smithy.api#documentation": "

Information about the Dev Environments in a project.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + } + } + }, + "com.amazonaws.codecatalyst#ListEventLogs": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListEventLogsRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListEventLogsResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of events that occurred during a specific time in a space. You can\n use these events to audit user and system activity in a space. For more information, see\n Monitoring in the Amazon CodeCatalyst User Guide.

\n \n

ListEventLogs guarantees events for the last 30 days in a given space. You can also\n view and retrieve a list of management events over the last 90 days for Amazon CodeCatalyst in the\n CloudTrail console by viewing Event history, or by creating a trail to create\n and maintain a record of events that extends past 90 days. For more information, see Working with CloudTrail Event History and Working with\n CloudTrail trails.

\n
", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces/{spaceName}/eventLogs", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListEventLogsRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "startTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time when you want to start retrieving events, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "endTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time after which you do not want any events retrieved, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "eventName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the event.

" + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#length": { + "min": 1, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#range": { + "min": 1, + "max": 250 + } + } + } + } + }, + "com.amazonaws.codecatalyst#ListEventLogsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + }, + "items": { + "target": "com.amazonaws.codecatalyst#EventLogEntries", + "traits": { + "smithy.api#documentation": "

Information about each event retrieved in the list.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#ListProjects": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListProjectsRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListProjectsResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of projects.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces/{spaceName}/projects", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListProjectsRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#length": { + "min": 1, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "filters": { + "target": "com.amazonaws.codecatalyst#ProjectListFilters", + "traits": { + "smithy.api#documentation": "

Information about filters to apply to narrow the results returned in the list.

" + } + } + } + }, + "com.amazonaws.codecatalyst#ListProjectsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + }, + "items": { + "target": "com.amazonaws.codecatalyst#ProjectSummaries", + "traits": { + "smithy.api#documentation": "

Information about the projects.

" + } + } + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositories": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoriesRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoriesResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of source repositories in a project.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoriesItem": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryIdString", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the source repository.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryDescriptionString", + "traits": { + "smithy.api#documentation": "

The description of the repository, if any.

" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time the source repository was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {} + } + }, + "createdTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time the source repository was created, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a source repository returned in a list of source repositories.

" + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoriesItems": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoriesItem" + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoriesRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#length": { + "min": 1, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + } + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoriesResponse": { + "type": "structure", + "members": { + "items": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoriesItems", + "traits": { + "smithy.api#documentation": "

Information about the source repositories.

" + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + } + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoryBranches": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoryBranchesRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoryBranchesResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of branches in a specified source repository.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/branches", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoryBranchesItem": { + "type": "structure", + "members": { + "ref": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchRefString", + "traits": { + "smithy.api#documentation": "

The Git reference name of the branch.

" + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchString", + "traits": { + "smithy.api#documentation": "

The name of the branch.

" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The time the branch was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#timestampFormat": "date-time" + } + }, + "headCommitId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The commit ID of the tip of the branch at the time of the request, also known as the head commit.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a branch of a source repository returned in a list of branches.

" + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoryBranchesItems": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoryBranchesItem" + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoryBranchesRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "sourceRepositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#length": { + "min": 1, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + } + } + }, + "com.amazonaws.codecatalyst#ListSourceRepositoryBranchesResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + }, + "items": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoryBranchesItems", + "traits": { + "smithy.api#documentation": "

Information about the source branches.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#ListSpaces": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListSpacesRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListSpacesResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of spaces.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListSpacesRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#length": { + "min": 1, + "max": 10000 + } + } + } + } + }, + "com.amazonaws.codecatalyst#ListSpacesResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + }, + "items": { + "target": "com.amazonaws.codecatalyst#SpaceSummaries", + "traits": { + "smithy.api#documentation": "

Information about the spaces.

" + } + } + } + }, + "com.amazonaws.codecatalyst#ListWorkflowRuns": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListWorkflowRunsRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListWorkflowRunsResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of workflow runs of a specified workflow.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/workflowRuns", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListWorkflowRunsRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "workflowId": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The ID of the workflow. To retrieve a list of workflow IDs, use ListWorkflows.

", + "smithy.api#httpQuery": "workflowId" + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#length": { + "min": 1 + }, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#httpQuery": "nextToken", + "smithy.api#length": { + "min": 1, + "max": 2048 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + }, + "sortBy": { + "target": "com.amazonaws.codecatalyst#WorkflowRunSortCriteriaList", + "traits": { + "smithy.api#documentation": "

Information used to sort the items in the returned list.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#ListWorkflowRunsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + }, + "items": { + "target": "com.amazonaws.codecatalyst#WorkflowRunSummaries", + "traits": { + "smithy.api#documentation": "

Information about the runs of a workflow.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#ListWorkflows": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#ListWorkflowsRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#ListWorkflowsResponse" + }, + "traits": { + "smithy.api#documentation": "

Retrieves a list of workflows in a specified project.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/workflows", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#ListWorkflowsRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#length": { + "min": 1 + }, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

", + "smithy.api#httpQuery": "nextToken", + "smithy.api#length": { + "min": 1, + "max": 2048 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "sortBy": { + "target": "com.amazonaws.codecatalyst#WorkflowSortCriteriaList", + "traits": { + "smithy.api#documentation": "

Information used to sort the items in the returned list.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#ListWorkflowsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A token returned from a call to this API to indicate the next batch of results to return, if any.

" + } + }, + "items": { + "target": "com.amazonaws.codecatalyst#WorkflowSummaries", + "traits": { + "smithy.api#documentation": "

Information about the workflows in a project.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#NameString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 3, + "max": 63 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]+(?:[-_\\.][a-zA-Z0-9]+)*$" + } + }, + "com.amazonaws.codecatalyst#OperationType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "READONLY", + "value": "READONLY" + }, + { + "name": "MUTATION", + "value": "MUTATION" + } + ] + } + }, + "com.amazonaws.codecatalyst#PersistentStorage": { + "type": "structure", + "members": { + "sizeInGiB": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The size of the persistent storage in gigabytes (specifically GiB).

\n \n

Valid values for storage are based on memory sizes in 16GB increments. Valid values are\n 16, 32, and 64.

\n
", + "smithy.api#range": { + "min": 0, + "max": 64 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the persistent storage for a Dev Environment.

" + } + }, + "com.amazonaws.codecatalyst#PersistentStorageConfiguration": { + "type": "structure", + "members": { + "sizeInGiB": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The size of the persistent storage in gigabytes (specifically GiB).

\n \n

Valid values for storage are based on memory sizes in 16GB increments. Valid values are\n 16, 32, and 64.

\n
", + "smithy.api#range": { + "min": 0, + "max": 64 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the configuration of persistent storage for a Dev Environment.

" + } + }, + "com.amazonaws.codecatalyst#Project": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString" + } + }, + "create": { + "target": "com.amazonaws.codecatalyst#CreateProject" + }, + "read": { + "target": "com.amazonaws.codecatalyst#GetProject" + }, + "update": { + "target": "com.amazonaws.codecatalyst#UpdateProject" + }, + "delete": { + "target": "com.amazonaws.codecatalyst#DeleteProject" + }, + "list": { + "target": "com.amazonaws.codecatalyst#ListProjects" + }, + "resources": [ + { + "target": "com.amazonaws.codecatalyst#DevEnvironment" + }, + { + "target": "com.amazonaws.codecatalyst#SourceRepository" + }, + { + "target": "com.amazonaws.codecatalyst#Workflow" + }, + { + "target": "com.amazonaws.codecatalyst#WorkflowRun" + } + ] + }, + "com.amazonaws.codecatalyst#ProjectDescription": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]+(?:[-_a-zA-Z0-9.,;:/\\+=?&$% \n\t\r])*$" + } + }, + "com.amazonaws.codecatalyst#ProjectDisplayName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 3, + "max": 63 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]+(?:[-_\\. ][a-zA-Z0-9]+)*$" + } + }, + "com.amazonaws.codecatalyst#ProjectInformation": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

" + } + }, + "projectId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the project.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a project in a space.

" + } + }, + "com.amazonaws.codecatalyst#ProjectListFilter": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.codecatalyst#FilterKey", + "traits": { + "smithy.api#documentation": "

A key that can be used to sort results.

", + "smithy.api#required": {} + } + }, + "values": { + "target": "com.amazonaws.codecatalyst#StringList", + "traits": { + "smithy.api#documentation": "

The values of the key.

", + "smithy.api#required": {} + } + }, + "comparisonOperator": { + "target": "com.amazonaws.codecatalyst#ComparisonOperator", + "traits": { + "smithy.api#documentation": "

The operator used to compare the fields.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

nformation about the filter used to narrow the results returned in a list of projects.

" + } + }, + "com.amazonaws.codecatalyst#ProjectListFilters": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#ProjectListFilter" + } + }, + "com.amazonaws.codecatalyst#ProjectSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#ProjectSummary" + } + }, + "com.amazonaws.codecatalyst#ProjectSummary": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name displayed to users of the project in Amazon CodeCatalyst.

" + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the project.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a project.

" + } + }, + "com.amazonaws.codecatalyst#RegionString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 3, + "max": 16 + }, + "smithy.api#pattern": "^(us(?:-gov)?|af|ap|ca|cn|eu|sa)-(central|(?:north|south)?(?:east|west)?)-(\\d+)$" + } + }, + "com.amazonaws.codecatalyst#RepositoriesInput": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#RepositoryInput" + } + }, + "com.amazonaws.codecatalyst#RepositoryInput": { + "type": "structure", + "members": { + "repositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository.

", + "smithy.api#required": {} + } + }, + "branchName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchString", + "traits": { + "smithy.api#documentation": "

The name of the branch in a source repository.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a repository that will be cloned to a Dev Environment.

" + } + }, + "com.amazonaws.codecatalyst#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.codecatalyst#SensitiveString": { + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.codecatalyst#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce\n the number of resources, or change the tier if applicable.

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.codecatalyst#SourceRepository": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "sourceRepositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString" + } + }, + "put": { + "target": "com.amazonaws.codecatalyst#CreateSourceRepository" + }, + "read": { + "target": "com.amazonaws.codecatalyst#GetSourceRepository" + }, + "delete": { + "target": "com.amazonaws.codecatalyst#DeleteSourceRepository" + }, + "list": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositories" + }, + "operations": [ + { + "target": "com.amazonaws.codecatalyst#GetSourceRepositoryCloneUrls" + } + ], + "resources": [ + { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranch" + } + ], + "traits": { + "smithy.api#noReplace": {} + } + }, + "com.amazonaws.codecatalyst#SourceRepositoryBranch": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "sourceRepositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString" + }, + "sourceRepositoryBranchName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchString" + } + }, + "put": { + "target": "com.amazonaws.codecatalyst#CreateSourceRepositoryBranch" + }, + "list": { + "target": "com.amazonaws.codecatalyst#ListSourceRepositoryBranches" + }, + "traits": { + "smithy.api#noReplace": {} + } + }, + "com.amazonaws.codecatalyst#SourceRepositoryBranchRefString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + } + } + }, + "com.amazonaws.codecatalyst#SourceRepositoryBranchString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.codecatalyst#SourceRepositoryDescriptionString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + } + } + }, + "com.amazonaws.codecatalyst#SourceRepositoryIdString": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" + } + }, + "com.amazonaws.codecatalyst#SourceRepositoryNameString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^(?!.*[.]git$)[\\w\\-.]*$" + } + }, + "com.amazonaws.codecatalyst#Space": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + } + }, + "read": { + "target": "com.amazonaws.codecatalyst#GetSpace" + }, + "update": { + "target": "com.amazonaws.codecatalyst#UpdateSpace" + }, + "delete": { + "target": "com.amazonaws.codecatalyst#DeleteSpace" + }, + "list": { + "target": "com.amazonaws.codecatalyst#ListSpaces" + }, + "operations": [ + { + "target": "com.amazonaws.codecatalyst#ListDevEnvironments" + } + ], + "resources": [ + { + "target": "com.amazonaws.codecatalyst#EventLogResource" + }, + { + "target": "com.amazonaws.codecatalyst#Project" + }, + { + "target": "com.amazonaws.codecatalyst#Subscription" + } + ] + }, + "com.amazonaws.codecatalyst#SpaceDescription": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]+(?:[-_a-zA-Z0-9.,;:/\\+=?&$% \n\t\r])*$" + } + }, + "com.amazonaws.codecatalyst#SpaceSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#SpaceSummary" + } + }, + "com.amazonaws.codecatalyst#SpaceSummary": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "regionName": { + "target": "com.amazonaws.codecatalyst#RegionString", + "traits": { + "smithy.api#documentation": "

The Amazon Web Services Region\n where the space exists.

", + "smithy.api#required": {} + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name of the space displayed to users.

" + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the space.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about an space.

" + } + }, + "com.amazonaws.codecatalyst#StartDevEnvironment": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#StartDevEnvironmentRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#StartDevEnvironmentResponse" + }, + "traits": { + "smithy.api#documentation": "

Starts a specified Dev Environment and puts it into an active state.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/start", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#StartDevEnvironmentRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "ides": { + "target": "com.amazonaws.codecatalyst#IdeConfigurationList", + "traits": { + "smithy.api#documentation": "

Information about the integrated development environment (IDE) configured for a Dev Environment.

" + } + }, + "instanceType": { + "target": "com.amazonaws.codecatalyst#InstanceType", + "traits": { + "smithy.api#documentation": "

The Amazon EC2 instace type to use for the Dev Environment.

" + } + }, + "inactivityTimeoutMinutes": { + "target": "com.amazonaws.codecatalyst#InactivityTimeoutMinutes", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.

" + } + } + } + }, + "com.amazonaws.codecatalyst#StartDevEnvironmentResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "status": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentStatus", + "traits": { + "smithy.api#documentation": "

The status of the Dev Environment.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#StartDevEnvironmentSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#StartDevEnvironmentSessionRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#StartDevEnvironmentSessionResponse" + }, + "traits": { + "smithy.api#documentation": "

Starts a session for a specified Dev Environment.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/session", + "code": 200 + } + } + }, + "com.amazonaws.codecatalyst#StartDevEnvironmentSessionRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "sessionConfiguration": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentSessionConfiguration", + "traits": { + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#StartDevEnvironmentSessionResponse": { + "type": "structure", + "members": { + "accessDetails": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentAccessDetails", + "traits": { + "smithy.api#required": {} + } + }, + "sessionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment session.

", + "smithy.api#length": { + "min": 1, + "max": 96 + } + } + }, + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + } + } + }, + "com.amazonaws.codecatalyst#StartWorkflowRun": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#StartWorkflowRunRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#StartWorkflowRunResponse" + }, + "traits": { + "smithy.api#documentation": "

Begins a run of a specified workflow.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/workflowRuns", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#StartWorkflowRunRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#length": { + "min": 1 + }, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#length": { + "min": 1 + }, + "smithy.api#required": {} + } + }, + "workflowId": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the workflow. To retrieve a list of workflow IDs, use ListWorkflows.

", + "smithy.api#httpQuery": "workflowId", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A user-specified idempotency token. Idempotency ensures that an API request completes only once. \n With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.

", + "smithy.api#idempotencyToken": {}, + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]+(?:[-_\\.][a-zA-Z0-9]+)*$" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#StartWorkflowRunResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the workflow run.

", + "smithy.api#required": {} + } + }, + "workflowId": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the workflow.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#StatusReason": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 1024 + } + } + }, + "com.amazonaws.codecatalyst#StopDevEnvironment": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#StopDevEnvironmentRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#StopDevEnvironmentResponse" + }, + "traits": { + "smithy.api#documentation": "

Pauses a specified Dev Environment and places it in a non-running state. Stopped Dev Environments do not consume compute minutes.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/stop", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#StopDevEnvironmentRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + } + } + }, + "com.amazonaws.codecatalyst#StopDevEnvironmentResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "status": { + "target": "com.amazonaws.codecatalyst#DevEnvironmentStatus", + "traits": { + "smithy.api#documentation": "

The status of the Dev Environment.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#StopDevEnvironmentSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#StopDevEnvironmentSessionRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#StopDevEnvironmentSessionResponse" + }, + "traits": { + "smithy.api#documentation": "

Stops a session for a specified Dev Environment.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/session/{sessionId}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#StopDevEnvironmentSessionRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment. To obtain this ID, use ListDevEnvironments.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "sessionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment session. This ID is returned by StartDevEnvironmentSession.

", + "smithy.api#httpLabel": {}, + "smithy.api#length": { + "min": 1, + "max": 96 + }, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#StopDevEnvironmentSessionResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "sessionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment session.

", + "smithy.api#length": { + "min": 1, + "max": 96 + }, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.codecatalyst#StringList": { + "type": "list", + "member": { + "target": "smithy.api#String" + } + }, + "com.amazonaws.codecatalyst#Subscription": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + } + }, + "read": { + "target": "com.amazonaws.codecatalyst#GetSubscription" + } + }, + "com.amazonaws.codecatalyst#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied due to request throttling.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.codecatalyst#Timestamp": { + "type": "timestamp", + "traits": { + "smithy.api#timestampFormat": "date-time" + } + }, + "com.amazonaws.codecatalyst#UpdateDevEnvironment": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#UpdateDevEnvironmentRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#UpdateDevEnvironmentResponse" + }, + "traits": { + "smithy.api#documentation": "

Changes one or more values for a Dev Environment. Updating certain values of the Dev Environment will cause a restart.

", + "smithy.api#http": { + "method": "PATCH", + "uri": "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#UpdateDevEnvironmentRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "alias": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The user-specified alias for the Dev Environment. Changing this value will not cause a restart.

", + "smithy.api#length": { + "max": 128 + }, + "smithy.api#pattern": "^$|^[a-zA-Z0-9]+(?:[-_\\.][a-zA-Z0-9]+)*$" + } + }, + "ides": { + "target": "com.amazonaws.codecatalyst#IdeConfigurationList", + "traits": { + "smithy.api#documentation": "

Information about the integrated development environment (IDE) configured for a Dev Environment.

" + } + }, + "instanceType": { + "target": "com.amazonaws.codecatalyst#InstanceType", + "traits": { + "smithy.api#documentation": "

The Amazon EC2 instace type to use for the Dev Environment.

\n \n

Changing this value will cause a restart of the Dev Environment if it is running.

\n
" + } + }, + "inactivityTimeoutMinutes": { + "target": "com.amazonaws.codecatalyst#InactivityTimeoutMinutes", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. \n Only whole integers are allowed. Dev Environments consume compute minutes when running.

\n \n

Changing this value will cause a restart of the Dev Environment if it is running.

\n
" + } + }, + "clientToken": { + "target": "com.amazonaws.codecatalyst#ClientToken", + "traits": { + "smithy.api#documentation": "

A user-specified idempotency token. Idempotency ensures that an API request completes only once. \n With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.

" + } + } + } + }, + "com.amazonaws.codecatalyst#UpdateDevEnvironmentResponse": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the Dev Environment.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "devEnvironmentId" + } + }, + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#required": {} + } + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project in the space.

", + "smithy.api#required": {} + } + }, + "alias": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The user-specified alias for the Dev Environment.

", + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]+(?:[-_\\.][a-zA-Z0-9]+)*$" + } + }, + "ides": { + "target": "com.amazonaws.codecatalyst#IdeConfigurationList", + "traits": { + "smithy.api#documentation": "

Information about the integrated development environment (IDE) configured for the Dev Environment.

" + } + }, + "instanceType": { + "target": "com.amazonaws.codecatalyst#InstanceType", + "traits": { + "smithy.api#documentation": "

The Amazon EC2 instace type to use for the Dev Environment.

" + } + }, + "inactivityTimeoutMinutes": { + "target": "com.amazonaws.codecatalyst#InactivityTimeoutMinutes", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The amount of time the Dev Environment will run without any activity detected before stopping, in minutes.

" + } + }, + "clientToken": { + "target": "com.amazonaws.codecatalyst#ClientToken", + "traits": { + "smithy.api#documentation": "

A user-specified idempotency token. Idempotency ensures that an API request completes only once. \n With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.

" + } + } + } + }, + "com.amazonaws.codecatalyst#UpdateProject": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#UpdateProjectRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#UpdateProjectResponse" + }, + "traits": { + "smithy.api#documentation": "

Changes one or more values for a project.

", + "smithy.api#http": { + "method": "PATCH", + "uri": "/v1/spaces/{spaceName}/projects/{name}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#UpdateProjectRequest": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "projectName" + } + }, + "description": { + "target": "com.amazonaws.codecatalyst#ProjectDescription", + "traits": { + "smithy.api#documentation": "

The description of the project.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#UpdateProjectResponse": { + "type": "structure", + "members": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

" + } + }, + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the project.

" + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name of the project displayed to users in Amazon CodeCatalyst.

" + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the project.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#UpdateSpace": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecatalyst#UpdateSpaceRequest" + }, + "output": { + "target": "com.amazonaws.codecatalyst#UpdateSpaceResponse" + }, + "traits": { + "smithy.api#documentation": "

Changes one or more values for a space.

", + "smithy.api#http": { + "method": "PATCH", + "uri": "/v1/spaces/{name}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.codecatalyst#UpdateSpaceRequest": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "spaceName" + } + }, + "description": { + "target": "com.amazonaws.codecatalyst#SpaceDescription", + "traits": { + "smithy.api#documentation": "

The description of the space.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecatalyst#UpdateSpaceResponse": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.codecatalyst#NameString", + "traits": { + "smithy.api#documentation": "

The name of the space.

" + } + }, + "displayName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The friendly name of the space displayed to users in Amazon CodeCatalyst.

" + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the space.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.codecatalyst#UserIdentity": { + "type": "structure", + "members": { + "userType": { + "target": "com.amazonaws.codecatalyst#UserType", + "traits": { + "smithy.api#documentation": "

The role assigned to the user in a Amazon CodeCatalyst space or project when the event occurred.

", + "smithy.api#required": {} + } + }, + "principalId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The ID of the Amazon CodeCatalyst service principal.

", + "smithy.api#required": {} + } + }, + "userName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The display name of the user in Amazon CodeCatalyst.

" + } + }, + "awsAccountId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The Amazon Web Services account number of the user in Amazon Web Services, if any.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a user whose activity is recorded in an event for a space.

" + } + }, + "com.amazonaws.codecatalyst#UserType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "USER", + "value": "USER" + }, + { + "name": "AWS_ACCOUNT", + "value": "AWS_ACCOUNT" + }, + { + "name": "UNKNOWN", + "value": "UNKNOWN" + } + ] + } + }, + "com.amazonaws.codecatalyst#Uuid": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" + } + }, + "com.amazonaws.codecatalyst#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.codecatalyst#VerifySession": { + "type": "operation", + "input": { + "target": "smithy.api#Unit" + }, + "output": { + "target": "com.amazonaws.codecatalyst#VerifySessionResponse" + }, + "traits": { + "smithy.api#documentation": "

Verifies whether the calling user has a valid Amazon CodeCatalyst login and session. If successful, this returns the ID of the user in Amazon CodeCatalyst.

", + "smithy.api#http": { + "method": "GET", + "uri": "/session", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.codecatalyst#VerifySessionResponse": { + "type": "structure", + "members": { + "identity": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the user in Amazon CodeCatalyst.

", + "smithy.api#length": { + "min": 1, + "max": 256 + } + } + } + } + }, + "com.amazonaws.codecatalyst#Workflow": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "workflowId": { + "target": "com.amazonaws.codecatalyst#Uuid" + } + }, + "read": { + "target": "com.amazonaws.codecatalyst#GetWorkflow" + }, + "list": { + "target": "com.amazonaws.codecatalyst#ListWorkflows" + } + }, + "com.amazonaws.codecatalyst#WorkflowDefinition": { + "type": "structure", + "members": { + "path": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The path to the workflow definition file stored in the source repository for the project, including the file name.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a workflow definition file.

" + } + }, + "com.amazonaws.codecatalyst#WorkflowDefinitionSummary": { + "type": "structure", + "members": { + "path": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The path to the workflow definition file stored in the source repository for the project, including the file name.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a workflow definition.

" + } + }, + "com.amazonaws.codecatalyst#WorkflowRun": { + "type": "resource", + "identifiers": { + "spaceName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "projectName": { + "target": "com.amazonaws.codecatalyst#NameString" + }, + "workflowRunId": { + "target": "com.amazonaws.codecatalyst#Uuid" + } + }, + "create": { + "target": "com.amazonaws.codecatalyst#StartWorkflowRun" + }, + "read": { + "target": "com.amazonaws.codecatalyst#GetWorkflowRun" + }, + "list": { + "target": "com.amazonaws.codecatalyst#ListWorkflowRuns" + } + }, + "com.amazonaws.codecatalyst#WorkflowRunMode": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "QUEUED", + "value": "QUEUED" + }, + { + "name": "PARALLEL", + "value": "PARALLEL" + }, + { + "name": "SUPERSEDED", + "value": "SUPERSEDED" + } + ] + } + }, + "com.amazonaws.codecatalyst#WorkflowRunSortCriteria": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "

Information used to sort workflow runs in the returned list.

" + } + }, + "com.amazonaws.codecatalyst#WorkflowRunSortCriteriaList": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#WorkflowRunSortCriteria" + }, + "traits": { + "smithy.api#length": { + "max": 1 + } + } + }, + "com.amazonaws.codecatalyst#WorkflowRunStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "SUCCEEDED", + "value": "SUCCEEDED" + }, + { + "name": "FAILED", + "value": "FAILED" + }, + { + "name": "STOPPED", + "value": "STOPPED" + }, + { + "name": "SUPERSEDED", + "value": "SUPERSEDED" + }, + { + "name": "CANCELLED", + "value": "CANCELLED" + }, + { + "name": "NOT_RUN", + "value": "NOT_RUN" + }, + { + "name": "VALIDATING", + "value": "VALIDATING" + }, + { + "name": "PROVISIONING", + "value": "PROVISIONING" + }, + { + "name": "IN_PROGRESS", + "value": "IN_PROGRESS" + }, + { + "name": "STOPPING", + "value": "STOPPING" + }, + { + "name": "ABANDONED", + "value": "ABANDONED" + } + ] + } + }, + "com.amazonaws.codecatalyst#WorkflowRunStatusReason": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "

Information about the status of a workflow run.

" + } + }, + "com.amazonaws.codecatalyst#WorkflowRunStatusReasons": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#WorkflowRunStatusReason" + } + }, + "com.amazonaws.codecatalyst#WorkflowRunSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#WorkflowRunSummary" + } + }, + "com.amazonaws.codecatalyst#WorkflowRunSummary": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the workflow run.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "workflowRunId" + } + }, + "workflowId": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of the workflow.

", + "smithy.api#required": {} + } + }, + "workflowName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the workflow.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.codecatalyst#WorkflowRunStatus", + "traits": { + "smithy.api#documentation": "

The status of the workflow run.

", + "smithy.api#required": {} + } + }, + "statusReasons": { + "target": "com.amazonaws.codecatalyst#WorkflowRunStatusReasons", + "traits": { + "smithy.api#documentation": "

The reasons for the workflow run status.

" + } + }, + "startTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow run began, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "endTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow run ended, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#timestampFormat": "date-time" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a workflow run.

" + } + }, + "com.amazonaws.codecatalyst#WorkflowSortCriteria": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "

Information used to sort workflows in the returned list.

" + } + }, + "com.amazonaws.codecatalyst#WorkflowSortCriteriaList": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#WorkflowSortCriteria" + }, + "traits": { + "smithy.api#length": { + "max": 1 + } + } + }, + "com.amazonaws.codecatalyst#WorkflowStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "INVALID", + "value": "INVALID" + }, + { + "name": "ACTIVE", + "value": "ACTIVE" + } + ] + } + }, + "com.amazonaws.codecatalyst#WorkflowSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.codecatalyst#WorkflowSummary" + } + }, + "com.amazonaws.codecatalyst#WorkflowSummary": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.codecatalyst#Uuid", + "traits": { + "smithy.api#documentation": "

The system-generated unique ID of a workflow.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "workflowId" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the workflow.

", + "smithy.api#required": {} + } + }, + "sourceRepositoryName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryNameString", + "traits": { + "smithy.api#documentation": "

The name of the source repository where the workflow definition file is stored.

", + "smithy.api#required": {} + } + }, + "sourceBranchName": { + "target": "com.amazonaws.codecatalyst#SourceRepositoryBranchString", + "traits": { + "smithy.api#documentation": "

The name of the branch of the source repository where the workflow definition file is stored.

", + "smithy.api#required": {} + } + }, + "definition": { + "target": "com.amazonaws.codecatalyst#WorkflowDefinitionSummary", + "traits": { + "smithy.api#documentation": "

Information about the workflow definition file.

", + "smithy.api#required": {} + } + }, + "createdTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow was created, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "lastUpdatedTime": { + "target": "com.amazonaws.codecatalyst#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time the workflow was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339\n

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "runMode": { + "target": "com.amazonaws.codecatalyst#WorkflowRunMode", + "traits": { + "smithy.api#documentation": "

The run mode of the workflow.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.codecatalyst#WorkflowStatus", + "traits": { + "smithy.api#documentation": "

The status of the workflow.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a workflow.

" + } + } + } +} diff --git a/aws/sdk/integration-tests/Cargo.toml b/aws/sdk/integration-tests/Cargo.toml index 546c557175..a35c46448c 100644 --- a/aws/sdk/integration-tests/Cargo.toml +++ b/aws/sdk/integration-tests/Cargo.toml @@ -3,6 +3,7 @@ [workspace] resolver = "2" members = [ + "codecatalyst", "dynamodb", "ec2", "glacier", diff --git a/aws/sdk/integration-tests/codecatalyst/Cargo.toml b/aws/sdk/integration-tests/codecatalyst/Cargo.toml new file mode 100644 index 0000000000..d4fb2c8088 --- /dev/null +++ b/aws/sdk/integration-tests/codecatalyst/Cargo.toml @@ -0,0 +1,17 @@ +# This Cargo.toml is unused in generated code. It exists solely to enable these tests to compile in-situ +[package] +name = "codecatalyst-tests" +version = "0.1.0" +authors = ["AWS Rust SDK Team "] +edition = "2021" +license = "Apache-2.0" +repository = "https://github.com/smithy-lang/smithy-rs" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +aws-sdk-codecatalyst = { path = "../../build/aws-sdk/sdk/codecatalyst", features = ["behavior-version-latest", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "wire-mock", "test-util"] } +tokio = { version = "1.23.1", features = ["full", "test-util"] } +tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.json b/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.json new file mode 100644 index 0000000000..7ffb08573a --- /dev/null +++ b/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.json @@ -0,0 +1,126 @@ +{ + "events": [ + { + "connection_id": 0, + "action": { + "Request": { + "request": { + "uri": "https://codecatalyst.global.api.aws/v1/spaces", + "headers": { + "x-amz-user-agent": [ + "aws-sdk-rust/0.123.test api/test-service/0.123 os/windows/XPSP3 lang/rust/1.50.0" + ], + "authorization": [ + "Bearer sso_bearer_auth_test" + ], + "content-length": [ + "2" + ], + "user-agent": [ + "aws-sdk-rust/0.123.test os/windows/XPSP3 lang/rust/1.50.0" + ], + "content-type": [ + "application/json" + ], + "amz-sdk-request": [ + "attempt=1; max=1" + ] + }, + "method": "POST" + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "{}" + }, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Response": { + "response": { + "Ok": { + "status": 200, + "headers": { + "x-amzn-served-from": [ + "us-west-2,us-west-2" + ], + "access-control-allow-credentials": [ + "true" + ], + "content-type": [ + "application/json; charset=utf-8" + ], + "strict-transport-security": [ + "max-age=63072000; includeSubDomains" + ], + "access-control-expose-headers": [ + "anti-csrftoken-a2z,x-amzn-requestid" + ], + "date": [ + "Tue, 27 Feb 2024 00:12:28 GMT" + ], + "vary": [ + "Origin" + ], + "x-amzn-requestid": [ + "some-request-id" + ] + } + } + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "{\"nextToken\":\"\",\"items\":[{\"name\":\"somespacename\",\"regionName\":\"us-west-2\",\"displayName\":\"somedisplayname\"}]}" + }, + "direction": "Response" + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "" + }, + "direction": "Response" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Response" + } + } + } + ], + "docs": "todo docs", + "version": "V0" +} diff --git a/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs b/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs new file mode 100644 index 0000000000..d499fb0243 --- /dev/null +++ b/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs @@ -0,0 +1,31 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_sdk_codecatalyst::config::{ProvideToken, Token}; + +#[tokio::test] +async fn sso_bearer_auth() { + let replay = aws_smithy_runtime::client::http::test_util::dvr::ReplayingClient::from_file( + "tests/sso_bearer_auth.json", + ) + .unwrap(); + + let config = aws_sdk_codecatalyst::Config::builder() + .with_test_defaults() + .http_client(replay.clone()) + .token_provider(Token::new("sso_bearer_auth_test", None)) + .build(); + let client = aws_sdk_codecatalyst::Client::from_conf(config); + + let response = client + .list_spaces() + .send() + .await + .expect("successful response"); + let item = &response.items.unwrap()[0]; + assert_eq!("somespacename", item.name); + + replay.full_validate("application/json").await.unwrap(); +} diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecorator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecorator.kt index 676700e6d6..db2eee3090 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecorator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecorator.kt @@ -26,6 +26,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.Writable import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.RuntimeConfig +import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.util.dq import software.amazon.smithy.rust.codegen.core.util.getTrait import software.amazon.smithy.rust.codegen.core.util.letIf @@ -37,6 +38,7 @@ private fun codegenScope(runtimeConfig: RuntimeConfig): Array> val authHttp = smithyRuntime.resolve("client::auth::http") val authHttpApi = smithyRuntimeApi.resolve("client::auth::http") return arrayOf( + "IntoShared" to RuntimeType.smithyRuntimeApi(runtimeConfig).resolve("shared::IntoShared"), "Token" to configReexport(smithyRuntimeApi.resolve("client::identity::http::Token")), "Login" to configReexport(smithyRuntimeApi.resolve("client::identity::http::Login")), "ResolveIdentity" to configReexport(smithyRuntimeApi.resolve("client::identity::ResolveIdentity")), @@ -229,7 +231,7 @@ private class HttpAuthConfigCustomization( pub fn api_key_resolver(mut self, api_key_resolver: impl #{ResolveIdentity} + 'static) -> Self { self.runtime_components.set_identity_resolver( #{HTTP_API_KEY_AUTH_SCHEME_ID}, - #{SharedIdentityResolver}::new(api_key_resolver) + #{IntoShared}::<#{SharedIdentityResolver}>::into_shared(api_key_resolver) ); self } @@ -249,7 +251,7 @@ private class HttpAuthConfigCustomization( pub fn bearer_token_resolver(mut self, bearer_token_resolver: impl #{ResolveIdentity} + 'static) -> Self { self.runtime_components.set_identity_resolver( #{HTTP_BEARER_AUTH_SCHEME_ID}, - #{SharedIdentityResolver}::new(bearer_token_resolver) + #{IntoShared}::<#{SharedIdentityResolver}>::into_shared(bearer_token_resolver) ); self } @@ -269,7 +271,7 @@ private class HttpAuthConfigCustomization( pub fn basic_auth_login_resolver(mut self, basic_auth_resolver: impl #{ResolveIdentity} + 'static) -> Self { self.runtime_components.set_identity_resolver( #{HTTP_BASIC_AUTH_SCHEME_ID}, - #{SharedIdentityResolver}::new(basic_auth_resolver) + #{IntoShared}::<#{SharedIdentityResolver}>::into_shared(basic_auth_resolver) ); self } @@ -289,7 +291,7 @@ private class HttpAuthConfigCustomization( pub fn digest_auth_login_resolver(mut self, digest_auth_resolver: impl #{ResolveIdentity} + 'static) -> Self { self.runtime_components.set_identity_resolver( #{HTTP_DIGEST_AUTH_SCHEME_ID}, - #{SharedIdentityResolver}::new(digest_auth_resolver) + #{IntoShared}::<#{SharedIdentityResolver}>::into_shared(digest_auth_resolver) ); self } diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/Util.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/Util.kt index 24831d0027..8b857b741d 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/Util.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/Util.kt @@ -148,8 +148,13 @@ class AuthSchemeLister : RuleValueVisitor> { } /** - * Returns a service's supported auth schemes + * SigV4a doesn't have a Smithy auth trait yet, so this is a hack to determine if a service supports it. + * + * In the future, Smithy's `ServiceIndex.getEffectiveAuthSchemes` should be used instead. */ -fun ServiceShape.supportedAuthSchemes(): Set = - this.getTrait()?.ruleSet?.let { EndpointRuleSet.fromNode(it) }?.also { it.typeCheck() } - ?.let { AuthSchemeLister.authSchemesForRuleset(it) } ?: setOf() +fun ServiceShape.usesSigV4a(): Boolean { + val endpointAuthSchemes = + getTrait()?.ruleSet?.let { EndpointRuleSet.fromNode(it) }?.also { it.typeCheck() } + ?.let { AuthSchemeLister.authSchemesForRuleset(it) } ?: setOf() + return endpointAuthSchemes.contains("sigv4a") +} diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/identity/http.rs b/rust-runtime/aws-smithy-runtime-api/src/client/identity/http.rs index 2666ef2a01..be0e8f247f 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/identity/http.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/identity/http.rs @@ -52,6 +52,12 @@ impl Token { pub fn expiration(&self) -> Option { self.0.expiration } + + /// Creates a `Token` for tests. + #[cfg(feature = "test-util")] + pub fn for_tests() -> Self { + Self::new("test-token", None) + } } impl From<&str> for Token { @@ -75,7 +81,19 @@ impl ResolveIdentity for Token { _runtime_components: &'a RuntimeComponents, _config_bag: &'a ConfigBag, ) -> IdentityFuture<'a> { - IdentityFuture::ready(Ok(Identity::new(self.clone(), self.0.expiration))) + IdentityFuture::ready(Ok(self.into())) + } +} + +impl From<&Token> for Identity { + fn from(value: &Token) -> Self { + Identity::new(value.clone(), value.0.expiration) + } +} +impl From for Identity { + fn from(value: Token) -> Self { + let expiration = value.0.expiration; + Identity::new(value, expiration) } } From 48d3ea4170c5f1a4326fd6157dd6941848a0300d Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Tue, 27 Feb 2024 11:08:26 -0800 Subject: [PATCH 2/9] Minor fixes --- aws/rust-runtime/aws-credential-types/external-types.toml | 1 + aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/aws/rust-runtime/aws-credential-types/external-types.toml b/aws/rust-runtime/aws-credential-types/external-types.toml index f8b06e0f47..5c3337a067 100644 --- a/aws/rust-runtime/aws-credential-types/external-types.toml +++ b/aws/rust-runtime/aws-credential-types/external-types.toml @@ -3,6 +3,7 @@ allowed_external_types = [ "aws_smithy_async::rt::sleep::SharedAsyncSleep", "aws_smithy_runtime_api::client::identity::ResolveIdentity", "aws_smithy_runtime_api::client::identity::http::Token", + "aws_smithy_runtime_api::shared::FromUnshared", "aws_smithy_types::config_bag::storable::Storable", "aws_smithy_types::config_bag::storable::StoreReplace", "aws_smithy_types::config_bag::storable::Storer", diff --git a/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs b/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs index d499fb0243..99b2b24812 100644 --- a/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs +++ b/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -use aws_sdk_codecatalyst::config::{ProvideToken, Token}; +use aws_sdk_codecatalyst::config::Token; #[tokio::test] async fn sso_bearer_auth() { From e7cf9763cebe65d226eeb6cc62800071844095ba Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Wed, 28 Feb 2024 14:59:29 -0800 Subject: [PATCH 3/9] Make the ServiceSpecificDecorator more generic --- .../smithy/rustsdk/ConditionalDecorator.kt | 180 ++++++++++++++++++ .../customize/ServiceSpecificDecorator.kt | 178 +---------------- 2 files changed, 186 insertions(+), 172 deletions(-) create mode 100644 aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt new file mode 100644 index 0000000000..5424e829c7 --- /dev/null +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt @@ -0,0 +1,180 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package software.amazon.smithy.rustsdk + +import software.amazon.smithy.model.Model +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.ServiceShape +import software.amazon.smithy.model.shapes.ShapeId +import software.amazon.smithy.model.shapes.ToShapeId +import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext +import software.amazon.smithy.rust.codegen.client.smithy.ClientRustSettings +import software.amazon.smithy.rust.codegen.client.smithy.customize.AuthSchemeOption +import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator +import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientProtocolMap +import software.amazon.smithy.rust.codegen.client.smithy.endpoint.EndpointCustomization +import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationCustomization +import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginCustomization +import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization +import software.amazon.smithy.rust.codegen.client.smithy.generators.error.ErrorCustomization +import software.amazon.smithy.rust.codegen.client.smithy.generators.protocol.ProtocolTestGenerator +import software.amazon.smithy.rust.codegen.core.smithy.RustCrate +import software.amazon.smithy.rust.codegen.core.smithy.customize.AdHocCustomization +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderCustomization +import software.amazon.smithy.rust.codegen.core.smithy.generators.LibRsCustomization +import software.amazon.smithy.rust.codegen.core.smithy.generators.ManifestCustomizations +import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureCustomization +import software.amazon.smithy.rust.codegen.core.smithy.generators.error.ErrorImplCustomization + +/** + * Delegating decorator that only applies when a condition is true + */ +class ConditionalDecorator( + /** Decorator to delegate to */ + private val delegateTo: ClientCodegenDecorator, + /** Service ID this decorator is active for */ + private val predicate: (ClientCodegenContext?, ShapeId?) -> Boolean, +) : ClientCodegenDecorator { + override val name: String = delegateTo.name + override val order: Byte = delegateTo.order + + private fun T.maybeApply( + codegenContext: ClientCodegenContext? = null, + serviceShapeId: ToShapeId? = null, + delegatedValue: () -> T, + ): T = + if (predicate(codegenContext, (serviceShapeId ?: codegenContext?.serviceShape)?.toShapeId())) { + delegatedValue() + } else { + this + } + + // This kind of decorator gets explicitly added to the root sdk-codegen decorator + override fun classpathDiscoverable(): Boolean = false + + override fun authOptions( + codegenContext: ClientCodegenContext, + operationShape: OperationShape, + baseAuthSchemeOptions: List, + ): List = + baseAuthSchemeOptions.maybeApply(codegenContext) { + delegateTo.authOptions(codegenContext, operationShape, baseAuthSchemeOptions) + } + + override fun builderCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations.maybeApply(codegenContext) { + delegateTo.builderCustomizations(codegenContext, baseCustomizations) + } + + override fun configCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations.maybeApply(codegenContext) { + delegateTo.configCustomizations(codegenContext, baseCustomizations) + } + + override fun crateManifestCustomizations(codegenContext: ClientCodegenContext): ManifestCustomizations = + emptyMap().maybeApply(codegenContext) { + delegateTo.crateManifestCustomizations(codegenContext) + } + + override fun endpointCustomizations(codegenContext: ClientCodegenContext): List = + emptyList().maybeApply(codegenContext) { + delegateTo.endpointCustomizations(codegenContext) + } + + override fun errorCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations.maybeApply(codegenContext) { + delegateTo.errorCustomizations(codegenContext, baseCustomizations) + } + + override fun errorImplCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations.maybeApply(codegenContext) { + delegateTo.errorImplCustomizations(codegenContext, baseCustomizations) + } + + override fun extras( + codegenContext: ClientCodegenContext, + rustCrate: RustCrate, + ) { + maybeApply(codegenContext) { + delegateTo.extras(codegenContext, rustCrate) + } + } + + override fun libRsCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations.maybeApply(codegenContext) { + delegateTo.libRsCustomizations(codegenContext, baseCustomizations) + } + + override fun operationCustomizations( + codegenContext: ClientCodegenContext, + operation: OperationShape, + baseCustomizations: List, + ): List = + baseCustomizations.maybeApply(codegenContext) { + delegateTo.operationCustomizations(codegenContext, operation, baseCustomizations) + } + + override fun protocols( + serviceId: ShapeId, + currentProtocols: ClientProtocolMap, + ): ClientProtocolMap = + currentProtocols.maybeApply(serviceShapeId = serviceId) { + delegateTo.protocols(serviceId, currentProtocols) + } + + override fun structureCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations.maybeApply(codegenContext) { + delegateTo.structureCustomizations(codegenContext, baseCustomizations) + } + + override fun transformModel( + service: ServiceShape, + model: Model, + settings: ClientRustSettings, + ): Model = + model.maybeApply(serviceShapeId = service) { + delegateTo.transformModel(service, model, settings) + } + + override fun serviceRuntimePluginCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations.maybeApply(codegenContext) { + delegateTo.serviceRuntimePluginCustomizations(codegenContext, baseCustomizations) + } + + override fun protocolTestGenerator( + codegenContext: ClientCodegenContext, + baseGenerator: ProtocolTestGenerator, + ): ProtocolTestGenerator = + baseGenerator.maybeApply(codegenContext) { + delegateTo.protocolTestGenerator(codegenContext, baseGenerator) + } + + override fun extraSections(codegenContext: ClientCodegenContext): List = + listOf().maybeApply(codegenContext) { + delegateTo.extraSections(codegenContext) + } +} diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/ServiceSpecificDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/ServiceSpecificDecorator.kt index 7a493f702d..78e49cccd9 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/ServiceSpecificDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/ServiceSpecificDecorator.kt @@ -5,184 +5,18 @@ package software.amazon.smithy.rustsdk.customize -import software.amazon.smithy.model.Model -import software.amazon.smithy.model.shapes.OperationShape -import software.amazon.smithy.model.shapes.ServiceShape import software.amazon.smithy.model.shapes.ShapeId -import software.amazon.smithy.model.shapes.ToShapeId -import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext -import software.amazon.smithy.rust.codegen.client.smithy.ClientRustSettings -import software.amazon.smithy.rust.codegen.client.smithy.customize.AuthSchemeOption import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator -import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientProtocolMap -import software.amazon.smithy.rust.codegen.client.smithy.endpoint.EndpointCustomization -import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationCustomization -import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginCustomization -import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization -import software.amazon.smithy.rust.codegen.client.smithy.generators.error.ErrorCustomization -import software.amazon.smithy.rust.codegen.client.smithy.generators.protocol.ProtocolTestGenerator -import software.amazon.smithy.rust.codegen.core.smithy.RustCrate -import software.amazon.smithy.rust.codegen.core.smithy.customize.AdHocCustomization -import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderCustomization -import software.amazon.smithy.rust.codegen.core.smithy.generators.LibRsCustomization -import software.amazon.smithy.rust.codegen.core.smithy.generators.ManifestCustomizations -import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureCustomization -import software.amazon.smithy.rust.codegen.core.smithy.generators.error.ErrorImplCustomization +import software.amazon.smithy.rustsdk.ConditionalDecorator /** Only apply this decorator to the given service ID */ fun ClientCodegenDecorator.onlyApplyTo(serviceId: String): List = - listOf(ServiceSpecificDecorator(ShapeId.from(serviceId), this)) + listOf( + ConditionalDecorator(this) { _, serviceShapeId -> + serviceShapeId == ShapeId.from(serviceId) + }, + ) /** Apply the given decorators only to this service ID */ fun String.applyDecorators(vararg decorators: ClientCodegenDecorator): List = decorators.map { it.onlyApplyTo(this) }.flatten() - -/** - * Delegating decorator that only applies to a configured service ID - */ -class ServiceSpecificDecorator( - /** Service ID this decorator is active for */ - private val appliesToServiceId: ShapeId, - /** Decorator to delegate to */ - private val delegateTo: ClientCodegenDecorator, - /** Decorator name */ - override val name: String = "${appliesToServiceId.namespace}.${appliesToServiceId.name}", - /** Decorator order */ - override val order: Byte = 0, -) : ClientCodegenDecorator { - private fun T.maybeApply( - serviceId: ToShapeId, - delegatedValue: () -> T, - ): T = - if (appliesToServiceId == serviceId.toShapeId()) { - delegatedValue() - } else { - this - } - - // This kind of decorator gets explicitly added to the root sdk-codegen decorator - override fun classpathDiscoverable(): Boolean = false - - override fun authOptions( - codegenContext: ClientCodegenContext, - operationShape: OperationShape, - baseAuthSchemeOptions: List, - ): List = - baseAuthSchemeOptions.maybeApply(codegenContext.serviceShape) { - delegateTo.authOptions(codegenContext, operationShape, baseAuthSchemeOptions) - } - - override fun builderCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.maybeApply(codegenContext.serviceShape) { - delegateTo.builderCustomizations(codegenContext, baseCustomizations) - } - - override fun configCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.maybeApply(codegenContext.serviceShape) { - delegateTo.configCustomizations(codegenContext, baseCustomizations) - } - - override fun crateManifestCustomizations(codegenContext: ClientCodegenContext): ManifestCustomizations = - emptyMap().maybeApply(codegenContext.serviceShape) { - delegateTo.crateManifestCustomizations(codegenContext) - } - - override fun endpointCustomizations(codegenContext: ClientCodegenContext): List = - emptyList().maybeApply(codegenContext.serviceShape) { - delegateTo.endpointCustomizations(codegenContext) - } - - override fun errorCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.maybeApply(codegenContext.serviceShape) { - delegateTo.errorCustomizations(codegenContext, baseCustomizations) - } - - override fun errorImplCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.maybeApply(codegenContext.serviceShape) { - delegateTo.errorImplCustomizations(codegenContext, baseCustomizations) - } - - override fun extras( - codegenContext: ClientCodegenContext, - rustCrate: RustCrate, - ) { - maybeApply(codegenContext.serviceShape) { - delegateTo.extras(codegenContext, rustCrate) - } - } - - override fun libRsCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.maybeApply(codegenContext.serviceShape) { - delegateTo.libRsCustomizations(codegenContext, baseCustomizations) - } - - override fun operationCustomizations( - codegenContext: ClientCodegenContext, - operation: OperationShape, - baseCustomizations: List, - ): List = - baseCustomizations.maybeApply(codegenContext.serviceShape) { - delegateTo.operationCustomizations(codegenContext, operation, baseCustomizations) - } - - override fun protocols( - serviceId: ShapeId, - currentProtocols: ClientProtocolMap, - ): ClientProtocolMap = - currentProtocols.maybeApply(serviceId) { - delegateTo.protocols(serviceId, currentProtocols) - } - - override fun structureCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.maybeApply(codegenContext.serviceShape) { - delegateTo.structureCustomizations(codegenContext, baseCustomizations) - } - - override fun transformModel( - service: ServiceShape, - model: Model, - settings: ClientRustSettings, - ): Model = - model.maybeApply(service) { - delegateTo.transformModel(service, model, settings) - } - - override fun serviceRuntimePluginCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.maybeApply(codegenContext.serviceShape) { - delegateTo.serviceRuntimePluginCustomizations(codegenContext, baseCustomizations) - } - - override fun protocolTestGenerator( - codegenContext: ClientCodegenContext, - baseGenerator: ProtocolTestGenerator, - ): ProtocolTestGenerator = - baseGenerator.maybeApply(codegenContext.serviceShape) { - delegateTo.protocolTestGenerator(codegenContext, baseGenerator) - } - - override fun extraSections(codegenContext: ClientCodegenContext): List = - listOf().maybeApply(codegenContext.serviceShape) { - delegateTo.extraSections(codegenContext) - } -} From 374b39ff288697b2a8c7c552ed66b1130af5ce4e Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Wed, 28 Feb 2024 16:08:16 -0800 Subject: [PATCH 4/9] Use ConditionalDecorator --- .../smithy/rustsdk/ConditionalDecorator.kt | 37 +++-- .../rustsdk/CredentialProvidersDecorator.kt | 72 ++++----- .../smithy/rustsdk/SigV4AuthDecorator.kt | 150 ++++++++---------- .../smithy/rustsdk/TokenProvidersDecorator.kt | 53 +++---- 4 files changed, 148 insertions(+), 164 deletions(-) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt index 5424e829c7..214b7f4009 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt @@ -32,11 +32,10 @@ import software.amazon.smithy.rust.codegen.core.smithy.generators.error.ErrorImp /** * Delegating decorator that only applies when a condition is true */ -class ConditionalDecorator( +open class ConditionalDecorator( /** Decorator to delegate to */ private val delegateTo: ClientCodegenDecorator, - /** Service ID this decorator is active for */ - private val predicate: (ClientCodegenContext?, ShapeId?) -> Boolean, + private val predicate: (ClientCodegenContext?, ToShapeId?) -> Boolean, ) : ClientCodegenDecorator { override val name: String = delegateTo.name override val order: Byte = delegateTo.order @@ -55,7 +54,7 @@ class ConditionalDecorator( // This kind of decorator gets explicitly added to the root sdk-codegen decorator override fun classpathDiscoverable(): Boolean = false - override fun authOptions( + final override fun authOptions( codegenContext: ClientCodegenContext, operationShape: OperationShape, baseAuthSchemeOptions: List, @@ -64,7 +63,7 @@ class ConditionalDecorator( delegateTo.authOptions(codegenContext, operationShape, baseAuthSchemeOptions) } - override fun builderCustomizations( + final override fun builderCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = @@ -72,7 +71,7 @@ class ConditionalDecorator( delegateTo.builderCustomizations(codegenContext, baseCustomizations) } - override fun configCustomizations( + final override fun configCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = @@ -80,17 +79,17 @@ class ConditionalDecorator( delegateTo.configCustomizations(codegenContext, baseCustomizations) } - override fun crateManifestCustomizations(codegenContext: ClientCodegenContext): ManifestCustomizations = + final override fun crateManifestCustomizations(codegenContext: ClientCodegenContext): ManifestCustomizations = emptyMap().maybeApply(codegenContext) { delegateTo.crateManifestCustomizations(codegenContext) } - override fun endpointCustomizations(codegenContext: ClientCodegenContext): List = + final override fun endpointCustomizations(codegenContext: ClientCodegenContext): List = emptyList().maybeApply(codegenContext) { delegateTo.endpointCustomizations(codegenContext) } - override fun errorCustomizations( + final override fun errorCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = @@ -98,7 +97,7 @@ class ConditionalDecorator( delegateTo.errorCustomizations(codegenContext, baseCustomizations) } - override fun errorImplCustomizations( + final override fun errorImplCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = @@ -106,7 +105,7 @@ class ConditionalDecorator( delegateTo.errorImplCustomizations(codegenContext, baseCustomizations) } - override fun extras( + final override fun extras( codegenContext: ClientCodegenContext, rustCrate: RustCrate, ) { @@ -115,7 +114,7 @@ class ConditionalDecorator( } } - override fun libRsCustomizations( + final override fun libRsCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = @@ -123,7 +122,7 @@ class ConditionalDecorator( delegateTo.libRsCustomizations(codegenContext, baseCustomizations) } - override fun operationCustomizations( + final override fun operationCustomizations( codegenContext: ClientCodegenContext, operation: OperationShape, baseCustomizations: List, @@ -132,7 +131,7 @@ class ConditionalDecorator( delegateTo.operationCustomizations(codegenContext, operation, baseCustomizations) } - override fun protocols( + final override fun protocols( serviceId: ShapeId, currentProtocols: ClientProtocolMap, ): ClientProtocolMap = @@ -140,7 +139,7 @@ class ConditionalDecorator( delegateTo.protocols(serviceId, currentProtocols) } - override fun structureCustomizations( + final override fun structureCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = @@ -148,7 +147,7 @@ class ConditionalDecorator( delegateTo.structureCustomizations(codegenContext, baseCustomizations) } - override fun transformModel( + final override fun transformModel( service: ServiceShape, model: Model, settings: ClientRustSettings, @@ -157,7 +156,7 @@ class ConditionalDecorator( delegateTo.transformModel(service, model, settings) } - override fun serviceRuntimePluginCustomizations( + final override fun serviceRuntimePluginCustomizations( codegenContext: ClientCodegenContext, baseCustomizations: List, ): List = @@ -165,7 +164,7 @@ class ConditionalDecorator( delegateTo.serviceRuntimePluginCustomizations(codegenContext, baseCustomizations) } - override fun protocolTestGenerator( + final override fun protocolTestGenerator( codegenContext: ClientCodegenContext, baseGenerator: ProtocolTestGenerator, ): ProtocolTestGenerator = @@ -173,7 +172,7 @@ class ConditionalDecorator( delegateTo.protocolTestGenerator(codegenContext, baseGenerator) } - override fun extraSections(codegenContext: ClientCodegenContext): List = + final override fun extraSections(codegenContext: ClientCodegenContext): List = listOf().maybeApply(codegenContext) { delegateTo.extraSections(codegenContext) } diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt index 73b60cf8b6..a382dce282 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt @@ -24,48 +24,46 @@ import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType.Companion.pre import software.amazon.smithy.rust.codegen.core.smithy.RustCrate import software.amazon.smithy.rust.codegen.core.smithy.customize.AdHocCustomization import software.amazon.smithy.rust.codegen.core.smithy.customize.adhocCustomization -import software.amazon.smithy.rust.codegen.core.util.letIf -class CredentialsProviderDecorator : ClientCodegenDecorator { - override val name: String = "CredentialsProvider" - override val order: Byte = 0 +class CredentialsProviderDecorator : ConditionalDecorator( + predicate = { codegenContext, _ -> + codegenContext?.let { + ServiceIndex.of(it.model).getEffectiveAuthSchemes(it.serviceShape) + .containsKey(SigV4Trait.ID) || it.serviceShape.usesSigV4a() + } ?: false + }, + delegateTo = + object : ClientCodegenDecorator { + override val name: String = "CredentialsProviderDecorator" + override val order: Byte = 0 - private fun applies(codegenContext: ClientCodegenContext): Boolean = - ServiceIndex.of(codegenContext.model).getEffectiveAuthSchemes(codegenContext.serviceShape) - .containsKey(SigV4Trait.ID) || codegenContext.serviceShape.usesSigV4a() + override fun configCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = baseCustomizations + CredentialProviderConfig(codegenContext) - override fun configCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.letIf(applies(codegenContext)) { it + CredentialProviderConfig(codegenContext) } + override fun extraSections(codegenContext: ClientCodegenContext): List = + listOf( + adhocCustomization { section -> + rust("${section.serviceConfigBuilder}.set_credentials_provider(${section.sdkConfig}.credentials_provider());") + }, + ) - override fun extraSections(codegenContext: ClientCodegenContext): List = - emptyList().letIf(applies(codegenContext)) { - it + - adhocCustomization { section -> - rust("${section.serviceConfigBuilder}.set_credentials_provider(${section.sdkConfig}.credentials_provider());") - } - } - - override fun extras( - codegenContext: ClientCodegenContext, - rustCrate: RustCrate, - ) { - if (!applies(codegenContext)) { - return - } - - rustCrate.mergeFeature(TestUtilFeature.copy(deps = listOf("aws-credential-types/test-util"))) + override fun extras( + codegenContext: ClientCodegenContext, + rustCrate: RustCrate, + ) { + rustCrate.mergeFeature(TestUtilFeature.copy(deps = listOf("aws-credential-types/test-util"))) - rustCrate.withModule(ClientRustModule.config) { - rust( - "pub use #T::Credentials;", - AwsRuntimeType.awsCredentialTypes(codegenContext.runtimeConfig), - ) - } - } -} + rustCrate.withModule(ClientRustModule.config) { + rust( + "pub use #T::Credentials;", + AwsRuntimeType.awsCredentialTypes(codegenContext.runtimeConfig), + ) + } + } + }, +) /** * Add a `.credentials_provider` field and builder to the `Config` for a given service diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt index f942f36314..fe8c0dc109 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt @@ -35,94 +35,80 @@ import software.amazon.smithy.rust.codegen.core.util.getTrait import software.amazon.smithy.rust.codegen.core.util.hasEventStreamOperations import software.amazon.smithy.rust.codegen.core.util.hasTrait import software.amazon.smithy.rust.codegen.core.util.isInputEventStream -import software.amazon.smithy.rust.codegen.core.util.letIf import software.amazon.smithy.rust.codegen.core.util.thenSingletonListOf -class SigV4AuthDecorator : ClientCodegenDecorator { - override val name: String get() = "SigV4AuthDecorator" - override val order: Byte = 0 +class SigV4AuthDecorator : ConditionalDecorator( + predicate = { codegenContext, _ -> + codegenContext?.let { + ServiceIndex.of(it.model).getEffectiveAuthSchemes(it.serviceShape) + .containsKey(SigV4Trait.ID) || it.serviceShape.usesSigV4a() + } ?: false + }, + delegateTo = + object : ClientCodegenDecorator { + override val name: String get() = "SigV4AuthDecorator" + override val order: Byte = 0 - private val sigv4a = "sigv4a" + private val sigv4a = "sigv4a" - private fun applies(codegenContext: ClientCodegenContext): Boolean = - ServiceIndex.of(codegenContext.model).getEffectiveAuthSchemes(codegenContext.serviceShape) - .containsKey(SigV4Trait.ID) || codegenContext.serviceShape.usesSigV4a() + private fun sigv4(runtimeConfig: RuntimeConfig) = + writable { + val awsRuntimeAuthModule = AwsRuntimeType.awsRuntime(runtimeConfig).resolve("auth") + rust("#T", awsRuntimeAuthModule.resolve("sigv4::SCHEME_ID")) + } - private fun sigv4(runtimeConfig: RuntimeConfig) = - writable { - val awsRuntimeAuthModule = AwsRuntimeType.awsRuntime(runtimeConfig).resolve("auth") - rust("#T", awsRuntimeAuthModule.resolve("sigv4::SCHEME_ID")) - } + private fun sigv4a(runtimeConfig: RuntimeConfig) = + writable { + val awsRuntimeAuthModule = AwsRuntimeType.awsRuntime(runtimeConfig).resolve("auth") + featureGateBlock(sigv4a) { + rust("#T", awsRuntimeAuthModule.resolve("sigv4a::SCHEME_ID")) + } + } - private fun sigv4a(runtimeConfig: RuntimeConfig) = - writable { - val awsRuntimeAuthModule = AwsRuntimeType.awsRuntime(runtimeConfig).resolve("auth") - featureGateBlock(sigv4a) { - rust("#T", awsRuntimeAuthModule.resolve("sigv4a::SCHEME_ID")) + override fun authOptions( + codegenContext: ClientCodegenContext, + operationShape: OperationShape, + baseAuthSchemeOptions: List, + ): List { + val supportsSigV4a = + codegenContext.serviceShape.usesSigV4a() + .thenSingletonListOf { sigv4a(codegenContext.runtimeConfig) } + return baseAuthSchemeOptions + + AuthSchemeOption.StaticAuthSchemeOption( + SigV4Trait.ID, + listOf(sigv4(codegenContext.runtimeConfig)) + supportsSigV4a, + ) } - } - - override fun authOptions( - codegenContext: ClientCodegenContext, - operationShape: OperationShape, - baseAuthSchemeOptions: List, - ): List { - if (!applies(codegenContext)) { - return baseAuthSchemeOptions - } - val supportsSigV4a = - codegenContext.serviceShape.usesSigV4a() - .thenSingletonListOf { sigv4a(codegenContext.runtimeConfig) } - return baseAuthSchemeOptions + - AuthSchemeOption.StaticAuthSchemeOption( - SigV4Trait.ID, - listOf(sigv4(codegenContext.runtimeConfig)) + supportsSigV4a, - ) - } + override fun serviceRuntimePluginCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations + listOf(AuthServiceRuntimePluginCustomization(codegenContext)) - override fun serviceRuntimePluginCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.letIf(applies(codegenContext)) { - it + - listOf( - AuthServiceRuntimePluginCustomization( - codegenContext, - ), - ) - } + override fun operationCustomizations( + codegenContext: ClientCodegenContext, + operation: OperationShape, + baseCustomizations: List, + ): List = baseCustomizations + AuthOperationCustomization(codegenContext) - override fun operationCustomizations( - codegenContext: ClientCodegenContext, - operation: OperationShape, - baseCustomizations: List, - ): List = - baseCustomizations.letIf(applies(codegenContext)) { it + AuthOperationCustomization(codegenContext) } + override fun configCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = + baseCustomizations + SigV4SigningConfig(codegenContext.runtimeConfig, codegenContext.serviceShape.getTrait()) - override fun configCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - baseCustomizations.letIf(applies(codegenContext)) { - it + - SigV4SigningConfig( - codegenContext.runtimeConfig, - codegenContext.serviceShape.getTrait(), - ) - } - - override fun extras( - codegenContext: ClientCodegenContext, - rustCrate: RustCrate, - ) { - if (codegenContext.serviceShape.usesSigV4a()) { - // Add optional feature for SigV4a support - rustCrate.mergeFeature(Feature("sigv4a", true, listOf("aws-runtime/sigv4a"))) - } - } -} + override fun extras( + codegenContext: ClientCodegenContext, + rustCrate: RustCrate, + ) { + if (codegenContext.serviceShape.usesSigV4a()) { + // Add optional feature for SigV4a support + rustCrate.mergeFeature(Feature("sigv4a", true, listOf("aws-runtime/sigv4a"))) + } + } + }, +) private class SigV4SigningConfig( runtimeConfig: RuntimeConfig, @@ -189,7 +175,9 @@ private class AuthServiceRuntimePluginCustomization(private val codegenContext: arrayOf( "SigV4AuthScheme" to awsRuntime.resolve("auth::sigv4::SigV4AuthScheme"), "SigV4aAuthScheme" to awsRuntime.resolve("auth::sigv4a::SigV4aAuthScheme"), - "SharedAuthScheme" to RuntimeType.smithyRuntimeApiClient(runtimeConfig).resolve("client::auth::SharedAuthScheme"), + "SharedAuthScheme" to + RuntimeType.smithyRuntimeApiClient(runtimeConfig) + .resolve("client::auth::SharedAuthScheme"), ) } @@ -197,11 +185,13 @@ private class AuthServiceRuntimePluginCustomization(private val codegenContext: writable { when (section) { is ServiceRuntimePluginSection.RegisterRuntimeComponents -> { - val serviceHasEventStream = codegenContext.serviceShape.hasEventStreamOperations(codegenContext.model) + val serviceHasEventStream = + codegenContext.serviceShape.hasEventStreamOperations(codegenContext.model) if (serviceHasEventStream) { // enable the aws-runtime `sign-eventstream` feature addDependency( - AwsCargoDependency.awsRuntime(runtimeConfig).withFeature("event-stream").toType().toSymbol(), + AwsCargoDependency.awsRuntime(runtimeConfig).withFeature("event-stream").toType() + .toSymbol(), ) } section.registerAuthScheme(this) { diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt index 5a9864a3ed..15912824a9 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt @@ -19,35 +19,31 @@ import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.smithy.customize.AdHocCustomization import software.amazon.smithy.rust.codegen.core.smithy.customize.adhocCustomization -class TokenProvidersDecorator : ClientCodegenDecorator { - override val name: String get() = "TokenProvidersDecorator" - override val order: Byte = 0 +class TokenProvidersDecorator : ConditionalDecorator( + predicate = { codegenContext, _ -> + codegenContext?.let { + ServiceIndex.of(codegenContext.model).getEffectiveAuthSchemes(codegenContext.serviceShape) + .containsKey(HttpBearerAuthTrait.ID) + } ?: false + }, + delegateTo = + object : ClientCodegenDecorator { + override val name: String get() = "TokenProvidersDecorator" + override val order: Byte = 0 - private fun applies(codegenContext: ClientCodegenContext): Boolean = - ServiceIndex.of(codegenContext.model).getEffectiveAuthSchemes(codegenContext.serviceShape) - .containsKey(HttpBearerAuthTrait.ID) + override fun configCustomizations( + codegenContext: ClientCodegenContext, + baseCustomizations: List, + ): List = baseCustomizations + TokenProviderConfig(codegenContext) - override fun configCustomizations( - codegenContext: ClientCodegenContext, - baseCustomizations: List, - ): List = - if (applies(codegenContext)) { - baseCustomizations + TokenProviderConfig(codegenContext) - } else { - baseCustomizations - } - - override fun extraSections(codegenContext: ClientCodegenContext): List = - if (applies(codegenContext)) { - listOf( - adhocCustomization { section -> - rust("${section.serviceConfigBuilder}.set_token_provider(${section.sdkConfig}.token_provider());") - }, - ) - } else { - emptyList() - } -} + override fun extraSections(codegenContext: ClientCodegenContext): List = + listOf( + adhocCustomization { section -> + rust("${section.serviceConfigBuilder}.set_token_provider(${section.sdkConfig}.token_provider());") + }, + ) + }, +) /** * Add a `.token_provider` field and builder to the `Config` for a given service @@ -71,7 +67,8 @@ class TokenProviderConfig(private val codegenContext: ClientCodegenContext) : Co "TestToken" to AwsRuntimeType.awsCredentialTypesTestUtil(runtimeConfig).resolve("Token"), "HTTP_BEARER_AUTH_SCHEME_ID" to CargoDependency.smithyRuntimeApiClient(runtimeConfig) - .withFeature("http-auth").toType().resolve("client::auth::http").resolve("HTTP_BEARER_AUTH_SCHEME_ID"), + .withFeature("http-auth").toType().resolve("client::auth::http") + .resolve("HTTP_BEARER_AUTH_SCHEME_ID"), ) override fun section(section: ServiceConfig) = From 51c925ba2d5ae0cdf0270edb8acd544c0a0024df Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Wed, 28 Feb 2024 16:28:12 -0800 Subject: [PATCH 5/9] Refactor sig auth detection --- .../rustsdk/CredentialProvidersDecorator.kt | 12 ++----- .../smithy/rustsdk/SigV4AuthDecorator.kt | 34 +++++++++++++------ .../codegen/client/smithy/endpoint/Util.kt | 15 -------- 3 files changed, 25 insertions(+), 36 deletions(-) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt index a382dce282..6034939f3f 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt @@ -5,14 +5,11 @@ package software.amazon.smithy.rustsdk -import software.amazon.smithy.aws.traits.auth.SigV4Trait -import software.amazon.smithy.model.knowledge.ServiceIndex import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.ClientRustModule import software.amazon.smithy.rust.codegen.client.smithy.configReexport import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator import software.amazon.smithy.rust.codegen.client.smithy.customize.TestUtilFeature -import software.amazon.smithy.rust.codegen.client.smithy.endpoint.usesSigV4a import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ServiceConfig import software.amazon.smithy.rust.codegen.core.rustlang.featureGateBlock @@ -26,12 +23,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.customize.AdHocCustomizat import software.amazon.smithy.rust.codegen.core.smithy.customize.adhocCustomization class CredentialsProviderDecorator : ConditionalDecorator( - predicate = { codegenContext, _ -> - codegenContext?.let { - ServiceIndex.of(it.model).getEffectiveAuthSchemes(it.serviceShape) - .containsKey(SigV4Trait.ID) || it.serviceShape.usesSigV4a() - } ?: false - }, + predicate = { codegenContext, _ -> codegenContext?.usesSigAuth() ?: false }, delegateTo = object : ClientCodegenDecorator { override val name: String = "CredentialsProviderDecorator" @@ -134,7 +126,7 @@ class CredentialProviderConfig(private val codegenContext: ClientCodegenContext) """, *codegenScope, ) { - if (codegenContext.serviceShape.usesSigV4a()) { + if (codegenContext.usesSigV4a()) { featureGateBlock("sigv4a") { rustTemplate( "self.runtime_components.set_identity_resolver(#{SIGV4A_SCHEME_ID}, credentials_provider.clone());", diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt index fe8c0dc109..58247b019e 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt @@ -11,10 +11,12 @@ import software.amazon.smithy.model.knowledge.ServiceIndex import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.ServiceShape import software.amazon.smithy.model.shapes.ShapeId +import software.amazon.smithy.rulesengine.language.EndpointRuleSet +import software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.customize.AuthSchemeOption import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator -import software.amazon.smithy.rust.codegen.client.smithy.endpoint.usesSigV4a +import software.amazon.smithy.rust.codegen.client.smithy.endpoint.AuthSchemeLister import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationSection import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginCustomization @@ -37,13 +39,24 @@ import software.amazon.smithy.rust.codegen.core.util.hasTrait import software.amazon.smithy.rust.codegen.core.util.isInputEventStream import software.amazon.smithy.rust.codegen.core.util.thenSingletonListOf +internal fun ClientCodegenContext.usesSigAuth(): Boolean = + ServiceIndex.of(model).getEffectiveAuthSchemes(serviceShape).containsKey(SigV4Trait.ID) || + usesSigV4a() + +/** + * SigV4a doesn't have a Smithy auth trait yet, so this is a hack to determine if a service supports it. + * + * In the future, Smithy's `ServiceIndex.getEffectiveAuthSchemes` should be used instead. + */ +internal fun ClientCodegenContext.usesSigV4a(): Boolean { + val endpointAuthSchemes = + serviceShape.getTrait()?.ruleSet?.let { EndpointRuleSet.fromNode(it) } + ?.also { it.typeCheck() }?.let { AuthSchemeLister.authSchemesForRuleset(it) } ?: setOf() + return endpointAuthSchemes.contains("sigv4a") +} + class SigV4AuthDecorator : ConditionalDecorator( - predicate = { codegenContext, _ -> - codegenContext?.let { - ServiceIndex.of(it.model).getEffectiveAuthSchemes(it.serviceShape) - .containsKey(SigV4Trait.ID) || it.serviceShape.usesSigV4a() - } ?: false - }, + predicate = { codegenContext, _ -> codegenContext?.usesSigAuth() ?: false }, delegateTo = object : ClientCodegenDecorator { override val name: String get() = "SigV4AuthDecorator" @@ -71,8 +84,7 @@ class SigV4AuthDecorator : ConditionalDecorator( baseAuthSchemeOptions: List, ): List { val supportsSigV4a = - codegenContext.serviceShape.usesSigV4a() - .thenSingletonListOf { sigv4a(codegenContext.runtimeConfig) } + codegenContext.usesSigV4a().thenSingletonListOf { sigv4a(codegenContext.runtimeConfig) } return baseAuthSchemeOptions + AuthSchemeOption.StaticAuthSchemeOption( SigV4Trait.ID, @@ -102,7 +114,7 @@ class SigV4AuthDecorator : ConditionalDecorator( codegenContext: ClientCodegenContext, rustCrate: RustCrate, ) { - if (codegenContext.serviceShape.usesSigV4a()) { + if (codegenContext.usesSigV4a()) { // Add optional feature for SigV4a support rustCrate.mergeFeature(Feature("sigv4a", true, listOf("aws-runtime/sigv4a"))) } @@ -198,7 +210,7 @@ private class AuthServiceRuntimePluginCustomization(private val codegenContext: rustTemplate("#{SharedAuthScheme}::new(#{SigV4AuthScheme}::new())", *codegenScope) } - if (codegenContext.serviceShape.usesSigV4a()) { + if (codegenContext.usesSigV4a()) { featureGateBlock("sigv4a") { section.registerAuthScheme(this) { rustTemplate("#{SharedAuthScheme}::new(#{SigV4aAuthScheme}::new())", *codegenScope) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/Util.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/Util.kt index 8b857b741d..43b79f16fc 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/Util.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/Util.kt @@ -6,7 +6,6 @@ package software.amazon.smithy.rust.codegen.client.smithy.endpoint import software.amazon.smithy.codegen.core.Symbol -import software.amazon.smithy.model.shapes.ServiceShape import software.amazon.smithy.rulesengine.language.Endpoint import software.amazon.smithy.rulesengine.language.EndpointRuleSet import software.amazon.smithy.rulesengine.language.syntax.Identifier @@ -17,7 +16,6 @@ import software.amazon.smithy.rulesengine.language.syntax.parameters.ParameterTy import software.amazon.smithy.rulesengine.language.syntax.rule.Rule import software.amazon.smithy.rulesengine.language.syntax.rule.RuleValueVisitor import software.amazon.smithy.rulesengine.traits.ContextParamTrait -import software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait import software.amazon.smithy.rust.codegen.client.smithy.endpoint.generators.EndpointStdLib import software.amazon.smithy.rust.codegen.client.smithy.endpoint.generators.FunctionRegistry import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency @@ -31,7 +29,6 @@ import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.smithy.makeOptional import software.amazon.smithy.rust.codegen.core.smithy.rustType import software.amazon.smithy.rust.codegen.core.smithy.unsafeToRustName -import software.amazon.smithy.rust.codegen.core.util.getTrait import software.amazon.smithy.rust.codegen.core.util.letIf import software.amazon.smithy.rust.codegen.core.util.orNull @@ -146,15 +143,3 @@ class AuthSchemeLister : RuleValueVisitor> { return setOf() } } - -/** - * SigV4a doesn't have a Smithy auth trait yet, so this is a hack to determine if a service supports it. - * - * In the future, Smithy's `ServiceIndex.getEffectiveAuthSchemes` should be used instead. - */ -fun ServiceShape.usesSigV4a(): Boolean { - val endpointAuthSchemes = - getTrait()?.ruleSet?.let { EndpointRuleSet.fromNode(it) }?.also { it.typeCheck() } - ?.let { AuthSchemeLister.authSchemesForRuleset(it) } ?: setOf() - return endpointAuthSchemes.contains("sigv4a") -} From e7bfbce9e8e3881c18f10e57ebadb119af31aa2c Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Wed, 28 Feb 2024 16:28:29 -0800 Subject: [PATCH 6/9] Use IntoShared --- .../software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt index 15912824a9..9021fb7620 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt @@ -53,6 +53,7 @@ class TokenProviderConfig(private val codegenContext: ClientCodegenContext) : Co private val codegenScope = arrayOf( *RuntimeType.preludeScope, + "IntoShared" to RuntimeType.smithyRuntimeApi(runtimeConfig).resolve("shared::IntoShared"), "Token" to configReexport(AwsRuntimeType.awsCredentialTypes(runtimeConfig).resolve("Token")), "ProvideToken" to configReexport( @@ -79,7 +80,7 @@ class TokenProviderConfig(private val codegenContext: ClientCodegenContext) : Co """ /// Sets the access token provider for this service pub fn token_provider(mut self, token_provider: impl #{ProvideToken} + 'static) -> Self { - self.set_token_provider(#{Some}(#{SharedTokenProvider}::new(token_provider))); + self.set_token_provider(#{Some}(#{IntoShared}::<#{SharedTokenProvider}>::into_shared(token_provider))); self } From 10105e992482362f08fe39f74292a23ddd6e894f Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Thu, 29 Feb 2024 16:53:36 -0800 Subject: [PATCH 7/9] Move ConditionalDecorator into codegen-client --- .../amazon/smithy/rustsdk/CredentialProvidersDecorator.kt | 1 + .../software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt | 1 + .../amazon/smithy/rustsdk/TokenProvidersDecorator.kt | 1 + .../smithy/rustsdk/customize/ServiceSpecificDecorator.kt | 2 +- .../codegen/client/smithy/customize}/ConditionalDecorator.kt | 5 +---- 5 files changed, 5 insertions(+), 5 deletions(-) rename {aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk => codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize}/ConditionalDecorator.kt (96%) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt index 6034939f3f..3d698e379e 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProvidersDecorator.kt @@ -9,6 +9,7 @@ import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.ClientRustModule import software.amazon.smithy.rust.codegen.client.smithy.configReexport import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator +import software.amazon.smithy.rust.codegen.client.smithy.customize.ConditionalDecorator import software.amazon.smithy.rust.codegen.client.smithy.customize.TestUtilFeature import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ServiceConfig diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt index 58247b019e..707957a243 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecorator.kt @@ -16,6 +16,7 @@ import software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.customize.AuthSchemeOption import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator +import software.amazon.smithy.rust.codegen.client.smithy.customize.ConditionalDecorator import software.amazon.smithy.rust.codegen.client.smithy.endpoint.AuthSchemeLister import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationSection diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt index 9021fb7620..af6dc58586 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt @@ -9,6 +9,7 @@ import software.amazon.smithy.model.traits.HttpBearerAuthTrait import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.configReexport import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator +import software.amazon.smithy.rust.codegen.client.smithy.customize.ConditionalDecorator import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ServiceConfig import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/ServiceSpecificDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/ServiceSpecificDecorator.kt index 78e49cccd9..c0a4586cde 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/ServiceSpecificDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/ServiceSpecificDecorator.kt @@ -7,7 +7,7 @@ package software.amazon.smithy.rustsdk.customize import software.amazon.smithy.model.shapes.ShapeId import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator -import software.amazon.smithy.rustsdk.ConditionalDecorator +import software.amazon.smithy.rust.codegen.client.smithy.customize.ConditionalDecorator /** Only apply this decorator to the given service ID */ fun ClientCodegenDecorator.onlyApplyTo(serviceId: String): List = diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/ConditionalDecorator.kt similarity index 96% rename from aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt rename to codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/ConditionalDecorator.kt index 214b7f4009..355d49b41f 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/ConditionalDecorator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/ConditionalDecorator.kt @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package software.amazon.smithy.rustsdk +package software.amazon.smithy.rust.codegen.client.smithy.customize import software.amazon.smithy.model.Model import software.amazon.smithy.model.shapes.OperationShape @@ -12,9 +12,6 @@ import software.amazon.smithy.model.shapes.ShapeId import software.amazon.smithy.model.shapes.ToShapeId import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.ClientRustSettings -import software.amazon.smithy.rust.codegen.client.smithy.customize.AuthSchemeOption -import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator -import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientProtocolMap import software.amazon.smithy.rust.codegen.client.smithy.endpoint.EndpointCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginCustomization From f742a351a24a478ec5becfcadd7ba7f26bb1e8b5 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Thu, 29 Feb 2024 17:06:25 -0800 Subject: [PATCH 8/9] Set test token in `ConfigLoader::test_credentials` --- aws/rust-runtime/aws-config/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aws/rust-runtime/aws-config/src/lib.rs b/aws/rust-runtime/aws-config/src/lib.rs index 6148a42978..f6d374d04f 100644 --- a/aws/rust-runtime/aws-config/src/lib.rs +++ b/aws/rust-runtime/aws-config/src/lib.rs @@ -494,7 +494,14 @@ mod loader { /// Set test credentials for use when signing requests pub fn test_credentials(self) -> Self { - self.credentials_provider(Credentials::for_tests()) + #[allow(unused_mut)] + let mut ret = self.credentials_provider(Credentials::for_tests()); + #[cfg(all(feature = "sso", feature = "test-util"))] + { + use aws_smithy_runtime_api::client::identity::http::Token; + ret = ret.token_provider(Token::for_tests()); + } + ret } /// Override the access token provider used to build [`SdkConfig`]. From 3d924d6abc3e845a0b5102effd8476a5f01eda83 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Thu, 29 Feb 2024 17:25:34 -0800 Subject: [PATCH 9/9] Improve doc comments on token provider config methods --- .../smithy/rustsdk/TokenProvidersDecorator.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt index af6dc58586..d8ea105075 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/TokenProvidersDecorator.kt @@ -80,12 +80,26 @@ class TokenProviderConfig(private val codegenContext: ClientCodegenContext) : Co rustTemplate( """ /// Sets the access token provider for this service + /// + /// Note: the [`Self::bearer_token`] and [`Self::bearer_token_resolver`] methods are + /// equivalent to this method, but take the [`Token`] and [`ResolveIdentity`] types + /// respectively. + /// + /// [`Token`]: crate::config::Token + /// [`ResolveIdentity`]: crate::config::ResolveIdentity pub fn token_provider(mut self, token_provider: impl #{ProvideToken} + 'static) -> Self { self.set_token_provider(#{Some}(#{IntoShared}::<#{SharedTokenProvider}>::into_shared(token_provider))); self } /// Sets the access token provider for this service + /// + /// Note: the [`Self::bearer_token`] and [`Self::bearer_token_resolver`] methods are + /// equivalent to this method, but take the [`Token`] and [`ResolveIdentity`] types + /// respectively. + /// + /// [`Token`]: crate::config::Token + /// [`ResolveIdentity`]: crate::config::ResolveIdentity pub fn set_token_provider(&mut self, token_provider: #{Option}<#{SharedTokenProvider}>) -> &mut Self { if let Some(token_provider) = token_provider { self.runtime_components.set_identity_resolver(#{HTTP_BEARER_AUTH_SCHEME_ID}, token_provider);