diff --git a/.changelog/141125587f684a628fe76093e7f302bd.json b/.changelog/141125587f684a628fe76093e7f302bd.json new file mode 100644 index 00000000000..95fcbce6053 --- /dev/null +++ b/.changelog/141125587f684a628fe76093e7f302bd.json @@ -0,0 +1,8 @@ +{ + "id": "14112558-7f68-4a62-8fe7-6093e7f302bd", + "type": "feature", + "description": "Add new operation delete-kx-cluster-node and add status parameter to list-kx-cluster-node operation.", + "modules": [ + "service/finspace" + ] +} \ No newline at end of file diff --git a/.changelog/3c3f66e1023046af912de83651d9a8dc.json b/.changelog/3c3f66e1023046af912de83651d9a8dc.json new file mode 100644 index 00000000000..bd9bf7b5c68 --- /dev/null +++ b/.changelog/3c3f66e1023046af912de83651d9a8dc.json @@ -0,0 +1,8 @@ +{ + "id": "3c3f66e1-0230-46af-912d-e83651d9a8dc", + "type": "documentation", + "description": "This is a documentation update for Amazon ECS.", + "modules": [ + "service/ecs" + ] +} \ No newline at end of file diff --git a/.changelog/75ce1db9db5e47b3b500ce1aa554c7cf.json b/.changelog/75ce1db9db5e47b3b500ce1aa554c7cf.json new file mode 100644 index 00000000000..f8e7e4d9040 --- /dev/null +++ b/.changelog/75ce1db9db5e47b3b500ce1aa554c7cf.json @@ -0,0 +1,8 @@ +{ + "id": "75ce1db9-db5e-47b3-b500-ce1aa554c7cf", + "type": "feature", + "description": "Adds support for backfill of cost allocation tags, with new StartCostAllocationTagBackfill and ListCostAllocationTagBackfillHistory API.", + "modules": [ + "service/costexplorer" + ] +} \ No newline at end of file diff --git a/.changelog/78180083d8114b709991b4b076f1c183.json b/.changelog/78180083d8114b709991b4b076f1c183.json new file mode 100644 index 00000000000..46f527c5cd4 --- /dev/null +++ b/.changelog/78180083d8114b709991b4b076f1c183.json @@ -0,0 +1,8 @@ +{ + "id": "78180083-d811-4b70-9991-b4b076f1c183", + "type": "feature", + "description": "Documentation updates for Elastic Compute Cloud (EC2).", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/ec73224d5c7e4941ac80f3e30b2b4c07.json b/.changelog/ec73224d5c7e4941ac80f3e30b2b4c07.json new file mode 100644 index 00000000000..9a0fb422676 --- /dev/null +++ b/.changelog/ec73224d5c7e4941ac80f3e30b2b4c07.json @@ -0,0 +1,8 @@ +{ + "id": "ec73224d-5c7e-4941-ac80-f3e30b2b4c07", + "type": "feature", + "description": "This release adds support to customize prompts sent through the RetrieveAndGenerate API in Agents for Amazon Bedrock.", + "modules": [ + "service/bedrockagentruntime" + ] +} \ No newline at end of file diff --git a/internal/repotools/cmd/docextractor/index.go b/internal/repotools/cmd/docextractor/index.go index e578589a937..78f8aac65b6 100644 --- a/internal/repotools/cmd/docextractor/index.go +++ b/internal/repotools/cmd/docextractor/index.go @@ -6,13 +6,12 @@ import ( ) type astIndex struct { - Types map[string]*ast.TypeSpec + Types map[string]*ast.TypeSpec Functions map[string]*ast.FuncDecl - Fields map[string]*ast.Field - Other []*ast.GenDecl + Fields map[string]*ast.Field + Other []*ast.GenDecl } - func indexFromAst(p *ast.Package, index *astIndex) { ast.Inspect(p, func(n ast.Node) bool { switch x := n.(type) { @@ -88,4 +87,4 @@ func indexFromAst(p *ast.Package, index *astIndex) { } return true }) -} \ No newline at end of file +} diff --git a/service/bedrockagentruntime/api_op_InvokeAgent.go b/service/bedrockagentruntime/api_op_InvokeAgent.go index 7a4354d7b77..177d657c20e 100644 --- a/service/bedrockagentruntime/api_op_InvokeAgent.go +++ b/service/bedrockagentruntime/api_op_InvokeAgent.go @@ -75,7 +75,9 @@ type InvokeAgentInput struct { // Specifies whether to end the session with the agent or not. EndSession *bool - // Contains parameters that specify various attributes of the session. + // Contains parameters that specify various attributes of the session. For more + // information, see Control session context (https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html) + // . SessionState *types.SessionState noSmithyDocumentSerde diff --git a/service/bedrockagentruntime/api_op_Retrieve.go b/service/bedrockagentruntime/api_op_Retrieve.go index fd8da213fb9..edb4d74465e 100644 --- a/service/bedrockagentruntime/api_op_Retrieve.go +++ b/service/bedrockagentruntime/api_op_Retrieve.go @@ -34,7 +34,7 @@ type RetrieveInput struct { // This member is required. KnowledgeBaseId *string - // The query to send the knowledge base. + // Contains the query to send the knowledge base. // // This member is required. RetrievalQuery *types.KnowledgeBaseQuery @@ -44,7 +44,9 @@ type RetrieveInput struct { // retrieve the next batch of results. NextToken *string - // Contains details about how the results should be returned. + // Contains configurations for the knowledge base query and retrieval process. For + // more information, see Query configurations (https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) + // . RetrievalConfiguration *types.KnowledgeBaseRetrievalConfiguration noSmithyDocumentSerde diff --git a/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go b/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go index 87ac49b4660..57047fcb191 100644 --- a/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go +++ b/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go @@ -13,9 +13,7 @@ import ( // Queries a knowledge base and generates responses based on the retrieved // results. The response cites up to five sources but only selects the ones that -// are relevant to the query. The numberOfResults field is currently unsupported -// for RetrieveAndGenerate . Don't include it in the vectorSearchConfiguration (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_KnowledgeBaseVectorSearchConfiguration.html) -// object. +// are relevant to the query. func (c *Client) RetrieveAndGenerate(ctx context.Context, params *RetrieveAndGenerateInput, optFns ...func(*Options)) (*RetrieveAndGenerateOutput, error) { if params == nil { params = &RetrieveAndGenerateInput{} @@ -33,13 +31,14 @@ func (c *Client) RetrieveAndGenerate(ctx context.Context, params *RetrieveAndGen type RetrieveAndGenerateInput struct { - // Contains the query made to the knowledge base. + // Contains the query to be made to the knowledge base. // // This member is required. Input *types.RetrieveAndGenerateInput - // Contains details about the resource being queried and the foundation model used - // for generation. + // Contains configurations for the knowledge base query and retrieval process. For + // more information, see Query configurations (https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) + // . RetrieveAndGenerateConfiguration *types.RetrieveAndGenerateConfiguration // Contains details about the session with the knowledge base. diff --git a/service/bedrockagentruntime/serializers.go b/service/bedrockagentruntime/serializers.go index 0e2f5fc3c19..d1256faf480 100644 --- a/service/bedrockagentruntime/serializers.go +++ b/service/bedrockagentruntime/serializers.go @@ -335,6 +335,20 @@ func awsRestjson1_serializeOpDocumentRetrieveAndGenerateInput(v *RetrieveAndGene return nil } +func awsRestjson1_serializeDocumentGenerationConfiguration(v *types.GenerationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PromptTemplate != nil { + ok := object.Key("promptTemplate") + if err := awsRestjson1_serializeDocumentPromptTemplate(v.PromptTemplate, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentKnowledgeBaseQuery(v *types.KnowledgeBaseQuery, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -365,6 +379,13 @@ func awsRestjson1_serializeDocumentKnowledgeBaseRetrieveAndGenerateConfiguration object := value.Object() defer object.Close() + if v.GenerationConfiguration != nil { + ok := object.Key("generationConfiguration") + if err := awsRestjson1_serializeDocumentGenerationConfiguration(v.GenerationConfiguration, ok); err != nil { + return err + } + } + if v.KnowledgeBaseId != nil { ok := object.Key("knowledgeBaseId") ok.String(*v.KnowledgeBaseId) @@ -413,6 +434,18 @@ func awsRestjson1_serializeDocumentPromptSessionAttributesMap(v map[string]strin return nil } +func awsRestjson1_serializeDocumentPromptTemplate(v *types.PromptTemplate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TextPromptTemplate != nil { + ok := object.Key("textPromptTemplate") + ok.String(*v.TextPromptTemplate) + } + + return nil +} + func awsRestjson1_serializeDocumentRetrieveAndGenerateConfiguration(v *types.RetrieveAndGenerateConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/bedrockagentruntime/types/types.go b/service/bedrockagentruntime/types/types.go index 191a961f1ce..87d41cda689 100644 --- a/service/bedrockagentruntime/types/types.go +++ b/service/bedrockagentruntime/types/types.go @@ -47,7 +47,12 @@ type Attribution struct { } // An object containing a segment of the generated response that is based on a -// source in the knowledge base, alongside information about the source. +// source in the knowledge base, alongside information about the source. This data +// type is used in the following API operations: +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the citations field +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the citations field type Citation struct { // Contains the generated response and metadata @@ -81,7 +86,11 @@ type FinalResponse struct { } // Contains metadata about a part of the generated response that is accompanied by -// a citation. +// a citation. This data type is used in the following API operations: +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the generatedResponsePart field +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the generatedResponsePart field type GeneratedResponsePart struct { // Contains metadata about a textual part of the generated response that is @@ -91,6 +100,18 @@ type GeneratedResponsePart struct { noSmithyDocumentSerde } +// Contains configurations for response generation based on the knowledge base +// query results. This data type is used in the following API operations: +// - RetrieveAndGenerate request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +type GenerationConfiguration struct { + + // Contains the template for the prompt that's sent to the model for response + // generation. + PromptTemplate *PromptTemplate + + noSmithyDocumentSerde +} + // Specifications about the inference parameters that were provided alongside the // prompt. These are specified in the PromptOverrideConfiguration (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) // object that was set when the agent was created or updated. For more information, @@ -169,7 +190,10 @@ type KnowledgeBaseLookupOutput struct { noSmithyDocumentSerde } -// Contains the query made to the knowledge base. +// Contains the query made to the knowledge base. This data type is used in the +// following API operations: +// - Retrieve request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) +// – in the retrievalQuery field type KnowledgeBaseQuery struct { // The text of the query made to the knowledge base. @@ -180,14 +204,18 @@ type KnowledgeBaseQuery struct { noSmithyDocumentSerde } -// Contains details about how the results should be returned. This data type is -// used in the following API operations: -// - Retrieve request body (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) -// - RetrieveAndGenerate request body (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +// Contains configurations for the knowledge base query and retrieval process. For +// more information, see Query configurations (https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) +// . This data type is used in the following API operations: +// - Retrieve request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) +// – in the retrievalConfiguration field +// - RetrieveAndGenerate request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +// – in the retrievalConfiguration field type KnowledgeBaseRetrievalConfiguration struct { // Contains details about how the results from the vector search should be - // returned. + // returned. For more information, see Query configurations (https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) + // . // // This member is required. VectorSearchConfiguration *KnowledgeBaseVectorSearchConfiguration @@ -195,7 +223,10 @@ type KnowledgeBaseRetrievalConfiguration struct { noSmithyDocumentSerde } -// Details about a result from querying the knowledge base. +// Details about a result from querying the knowledge base. This data type is used +// in the following API operations: +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the retrievalResults field type KnowledgeBaseRetrievalResult struct { // Contains a chunk of text from a data source in the knowledge base. @@ -212,7 +243,12 @@ type KnowledgeBaseRetrievalResult struct { noSmithyDocumentSerde } -// Contains details about the resource being queried. +// Contains details about the resource being queried. This data type is used in +// the following API operations: +// - Retrieve request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) +// – in the knowledgeBaseConfiguration field +// - RetrieveAndGenerate request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +// – in the knowledgeBaseConfiguration field type KnowledgeBaseRetrieveAndGenerateConfiguration struct { // The unique identifier of the knowledge base that is queried and the foundation @@ -226,18 +262,26 @@ type KnowledgeBaseRetrieveAndGenerateConfiguration struct { // This member is required. ModelArn *string + // Contains configurations for response generation based on the knowwledge base + // query results. + GenerationConfiguration *GenerationConfiguration + // Contains configurations for how to retrieve and return the knowledge base query. RetrievalConfiguration *KnowledgeBaseRetrievalConfiguration noSmithyDocumentSerde } -// Configurations for how to carry out the search. +// Configurations for how to perform the search query and return results. For more +// information, see Query configurations (https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) +// . This data type is used in the following API operations: +// - Retrieve request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) +// – in the vectorSearchConfiguration field +// - RetrieveAndGenerate request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +// – in the vectorSearchConfiguration field type KnowledgeBaseVectorSearchConfiguration struct { - // The number of results to return. The numberOfResults field is currently - // unsupported for RetrieveAndGenerate . Don't include it in this field if you are - // sending a RetrieveAndGenerate request. + // The number of source chunks to retrieve. NumberOfResults *int32 // By default, Amazon Bedrock decides a search strategy for you. If you're using @@ -527,6 +571,24 @@ type PreProcessingTraceMemberModelInvocationOutput struct { func (*PreProcessingTraceMemberModelInvocationOutput) isPreProcessingTrace() {} +// Contains the template for the prompt that's sent to the model for response +// generation. For more information, see Knowledge base prompt templates (https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt) +// . This data type is used in the following API operations: +// - RetrieveAndGenerate request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +type PromptTemplate struct { + + // The template for the prompt that's sent to the model for response generation. + // You can include prompt placeholders, which become replaced before the prompt is + // sent to the model to provide instructions and context to the model. In addition, + // you can include XML tags to delineate meaningful sections of the prompt + // template. For more information, see the following resources: + // - Knowledge base prompt templates (https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt) + // - Use XML tags with Anthropic Claude models (https://docs.anthropic.com/claude/docs/use-xml-tags) + TextPromptTemplate *string + + noSmithyDocumentSerde +} + // Contains the reasoning, based on the input, that the agent uses to justify // carrying out an action group or getting information from a knowledge base. type Rationale struct { @@ -595,7 +657,14 @@ type ResponseStreamMemberTrace struct { func (*ResponseStreamMemberTrace) isResponseStream() {} -// Contains the cited text from the data source. +// Contains the cited text from the data source. This data type is used in the +// following API operations: +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the content field +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the content field +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the content field type RetrievalResultContent struct { // The cited text from the data source. @@ -606,7 +675,14 @@ type RetrievalResultContent struct { noSmithyDocumentSerde } -// Contains information about the location of the data source. +// Contains information about the location of the data source. This data type is +// used in the following API operations: +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the location field +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the location field +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the locatino field type RetrievalResultLocation struct { // The type of the location of the data source. @@ -620,7 +696,14 @@ type RetrievalResultLocation struct { noSmithyDocumentSerde } -// Contains the S3 location of the data source. +// Contains the S3 location of the data source. This data type is used in the +// following API operations: +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the s3Location field +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the s3Location field +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the s3Location field type RetrievalResultS3Location struct { // The S3 URI of the data source. @@ -629,7 +712,10 @@ type RetrievalResultS3Location struct { noSmithyDocumentSerde } -// Contains details about the resource being queried. +// Contains details about the resource being queried. This data type is used in +// the following API operations: +// - RetrieveAndGenerate request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +// – in the retrieveAndGenerateConfiguration field type RetrieveAndGenerateConfiguration struct { // The type of resource that is queried by the request. @@ -643,7 +729,10 @@ type RetrieveAndGenerateConfiguration struct { noSmithyDocumentSerde } -// Contains the query made to the knowledge base. +// Contains the query made to the knowledge base. This data type is used in the +// following API operations: +// - RetrieveAndGenerate request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +// – in the input field type RetrieveAndGenerateInput struct { // The query made to the knowledge base. @@ -654,7 +743,10 @@ type RetrieveAndGenerateInput struct { noSmithyDocumentSerde } -// Contains the response generated from querying the knowledge base. +// Contains the response generated from querying the knowledge base. This data +// type is used in the following API operations: +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the output field type RetrieveAndGenerateOutput struct { // The response generated from querying the knowledge base. @@ -665,7 +757,10 @@ type RetrieveAndGenerateOutput struct { noSmithyDocumentSerde } -// Contains configuration about the session with the knowledge base. +// Contains configuration about the session with the knowledge base. This data +// type is used in the following API operations: +// - RetrieveAndGenerate request (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) +// – in the sessionConfiguration field type RetrieveAndGenerateSessionConfiguration struct { // The ARN of the KMS key encrypting the session. @@ -676,7 +771,12 @@ type RetrieveAndGenerateSessionConfiguration struct { noSmithyDocumentSerde } -// Contains metadata about a sources cited for the generated response. +// Contains metadata about a source cited for the generated response. This data +// type is used in the following API operations: +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the retrievedReferences field +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the retrievedReferences field type RetrievedReference struct { // Contains the cited text from the data source. @@ -694,7 +794,7 @@ type RetrievedReference struct { // for an action group or pass them when making an InvokeAgent (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) // request. Use session state attributes to control and provide conversational // context for your agent and to help customize your agent's behavior. For more -// information, see Session context (https://docs.aws.amazon.com/bedrock/latest/userguide/sessionstate.html) +// information, see Control session context (https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html) // . type SessionState struct { @@ -713,7 +813,11 @@ type SessionState struct { } // Contains information about where the text with a citation begins and ends in -// the generated output. +// the generated output. This data type is used in the following API operations: +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the span field +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the span field type Span struct { // Where the text with a citation ends in the generated output. @@ -726,7 +830,12 @@ type Span struct { } // Contains the part of the generated text that contains a citation, alongside -// where it begins and ends. +// where it begins and ends. This data type is used in the following API +// operations: +// - RetrieveAndGenerate response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) +// – in the textResponsePart field +// - Retrieve response (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) +// – in the textResponsePart field type TextResponsePart struct { // Contains information about where the text with a citation begins and ends in diff --git a/service/chimesdkmediapipelines/internal/endpoints/endpoints.go b/service/chimesdkmediapipelines/internal/endpoints/endpoints.go index 267fd63ce39..e78c4197af1 100644 --- a/service/chimesdkmediapipelines/internal/endpoints/endpoints.go +++ b/service/chimesdkmediapipelines/internal/endpoints/endpoints.go @@ -139,12 +139,30 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, diff --git a/service/costexplorer/api_op_ListCostAllocationTagBackfillHistory.go b/service/costexplorer/api_op_ListCostAllocationTagBackfillHistory.go new file mode 100644 index 00000000000..c214c5f8431 --- /dev/null +++ b/service/costexplorer/api_op_ListCostAllocationTagBackfillHistory.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costexplorer + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of your historical cost allocation tag backfill requests. +func (c *Client) ListCostAllocationTagBackfillHistory(ctx context.Context, params *ListCostAllocationTagBackfillHistoryInput, optFns ...func(*Options)) (*ListCostAllocationTagBackfillHistoryOutput, error) { + if params == nil { + params = &ListCostAllocationTagBackfillHistoryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCostAllocationTagBackfillHistory", params, optFns, c.addOperationListCostAllocationTagBackfillHistoryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCostAllocationTagBackfillHistoryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCostAllocationTagBackfillHistoryInput struct { + + // The maximum number of objects that are returned for this request. + MaxResults *int32 + + // The token to retrieve the next set of results. Amazon Web Services provides the + // token when the response from a previous call has more results than the maximum + // page size. + NextToken *string + + noSmithyDocumentSerde +} + +type ListCostAllocationTagBackfillHistoryOutput struct { + + // The list of historical cost allocation tag backfill requests. + BackfillRequests []types.CostAllocationTagBackfillRequest + + // The token to retrieve the next set of results. Amazon Web Services provides the + // token when the response from a previous call has more results than the maximum + // page size. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCostAllocationTagBackfillHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCostAllocationTagBackfillHistory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCostAllocationTagBackfillHistory(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListCostAllocationTagBackfillHistoryAPIClient is a client that implements the +// ListCostAllocationTagBackfillHistory operation. +type ListCostAllocationTagBackfillHistoryAPIClient interface { + ListCostAllocationTagBackfillHistory(context.Context, *ListCostAllocationTagBackfillHistoryInput, ...func(*Options)) (*ListCostAllocationTagBackfillHistoryOutput, error) +} + +var _ ListCostAllocationTagBackfillHistoryAPIClient = (*Client)(nil) + +// ListCostAllocationTagBackfillHistoryPaginatorOptions is the paginator options +// for ListCostAllocationTagBackfillHistory +type ListCostAllocationTagBackfillHistoryPaginatorOptions struct { + // The maximum number of objects that are returned for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListCostAllocationTagBackfillHistoryPaginator is a paginator for +// ListCostAllocationTagBackfillHistory +type ListCostAllocationTagBackfillHistoryPaginator struct { + options ListCostAllocationTagBackfillHistoryPaginatorOptions + client ListCostAllocationTagBackfillHistoryAPIClient + params *ListCostAllocationTagBackfillHistoryInput + nextToken *string + firstPage bool +} + +// NewListCostAllocationTagBackfillHistoryPaginator returns a new +// ListCostAllocationTagBackfillHistoryPaginator +func NewListCostAllocationTagBackfillHistoryPaginator(client ListCostAllocationTagBackfillHistoryAPIClient, params *ListCostAllocationTagBackfillHistoryInput, optFns ...func(*ListCostAllocationTagBackfillHistoryPaginatorOptions)) *ListCostAllocationTagBackfillHistoryPaginator { + if params == nil { + params = &ListCostAllocationTagBackfillHistoryInput{} + } + + options := ListCostAllocationTagBackfillHistoryPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCostAllocationTagBackfillHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCostAllocationTagBackfillHistoryPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCostAllocationTagBackfillHistory page. +func (p *ListCostAllocationTagBackfillHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCostAllocationTagBackfillHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListCostAllocationTagBackfillHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListCostAllocationTagBackfillHistory(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCostAllocationTagBackfillHistory", + } +} diff --git a/service/costexplorer/api_op_StartCostAllocationTagBackfill.go b/service/costexplorer/api_op_StartCostAllocationTagBackfill.go new file mode 100644 index 00000000000..63a67e4757b --- /dev/null +++ b/service/costexplorer/api_op_StartCostAllocationTagBackfill.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costexplorer + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Request a cost allocation tag backfill. This will backfill the activation +// status (either active or inactive ) for all tag keys from para:BackfillFrom up +// to the when this request is made. You can request a backfill once every 24 +// hours. +func (c *Client) StartCostAllocationTagBackfill(ctx context.Context, params *StartCostAllocationTagBackfillInput, optFns ...func(*Options)) (*StartCostAllocationTagBackfillOutput, error) { + if params == nil { + params = &StartCostAllocationTagBackfillInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartCostAllocationTagBackfill", params, optFns, c.addOperationStartCostAllocationTagBackfillMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartCostAllocationTagBackfillOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartCostAllocationTagBackfillInput struct { + + // The date you want the backfill to start from. The date can only be a first day + // of the month (a billing start date). Dates can't precede the previous twelve + // months, or in the future. + // + // This member is required. + BackfillFrom *string + + noSmithyDocumentSerde +} + +type StartCostAllocationTagBackfillOutput struct { + + // An object containing detailed metadata of your new backfill request. + BackfillRequest *types.CostAllocationTagBackfillRequest + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartCostAllocationTagBackfillMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartCostAllocationTagBackfill{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartCostAllocationTagBackfill{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartCostAllocationTagBackfill"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpStartCostAllocationTagBackfillValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCostAllocationTagBackfill(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartCostAllocationTagBackfill(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartCostAllocationTagBackfill", + } +} diff --git a/service/costexplorer/deserializers.go b/service/costexplorer/deserializers.go index d1201a741e3..f05613ca328 100644 --- a/service/costexplorer/deserializers.go +++ b/service/costexplorer/deserializers.go @@ -3055,6 +3055,116 @@ func awsAwsjson11_deserializeOpErrorGetUsageForecast(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory struct { +} + +func (*awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(response, &metadata) + } + output := &ListCostAllocationTagBackfillHistoryOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListCostAllocationTagBackfillHistoryOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListCostAllocationTags struct { } @@ -3602,6 +3712,116 @@ func awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response *smithyhttp. } } +type awsAwsjson11_deserializeOpStartCostAllocationTagBackfill struct { +} + +func (*awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response, &metadata) + } + output := &StartCostAllocationTagBackfillOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentStartCostAllocationTagBackfillOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("BackfillLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorBackfillLimitExceededException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration struct { } @@ -4384,6 +4604,41 @@ func awsAwsjson11_deserializeOpErrorUpdateCostCategoryDefinition(response *smith } } +func awsAwsjson11_deserializeErrorBackfillLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.BackfillLimitExceededException{} + err := awsAwsjson11_deserializeDocumentBackfillLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorBillExpirationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5409,6 +5664,46 @@ func awsAwsjson11_deserializeDocumentAttributes(v *map[string]string, value inte return nil } +func awsAwsjson11_deserializeDocumentBackfillLimitExceededException(v **types.BackfillLimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BackfillLimitExceededException + if *v == nil { + sv = &types.BackfillLimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentBillExpirationException(v **types.BillExpirationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5525,6 +5820,116 @@ func awsAwsjson11_deserializeDocumentCostAllocationTag(v **types.CostAllocationT return nil } +func awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequest(v **types.CostAllocationTagBackfillRequest, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CostAllocationTagBackfillRequest + if *v == nil { + sv = &types.CostAllocationTagBackfillRequest{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BackfillFrom": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.BackfillFrom = ptr.String(jtv) + } + + case "BackfillStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CostAllocationTagBackfillStatus to be of type string, got %T instead", value) + } + sv.BackfillStatus = types.CostAllocationTagBackfillStatus(jtv) + } + + case "CompletedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.CompletedAt = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.LastUpdatedAt = ptr.String(jtv) + } + + case "RequestedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.RequestedAt = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequestList(v *[]types.CostAllocationTagBackfillRequest, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.CostAllocationTagBackfillRequest + if *v == nil { + cv = []types.CostAllocationTagBackfillRequest{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CostAllocationTagBackfillRequest + destAddr := &col + if err := awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequest(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentCostAllocationTagList(v *[]types.CostAllocationTag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14292,6 +14697,51 @@ func awsAwsjson11_deserializeOpDocumentGetUsageForecastOutput(v **GetUsageForeca return nil } +func awsAwsjson11_deserializeOpDocumentListCostAllocationTagBackfillHistoryOutput(v **ListCostAllocationTagBackfillHistoryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCostAllocationTagBackfillHistoryOutput + if *v == nil { + sv = &ListCostAllocationTagBackfillHistoryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BackfillRequests": + if err := awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequestList(&sv.BackfillRequests, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListCostAllocationTagsOutput(v **ListCostAllocationTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14503,6 +14953,42 @@ func awsAwsjson11_deserializeOpDocumentProvideAnomalyFeedbackOutput(v **ProvideA return nil } +func awsAwsjson11_deserializeOpDocumentStartCostAllocationTagBackfillOutput(v **StartCostAllocationTagBackfillOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartCostAllocationTagBackfillOutput + if *v == nil { + sv = &StartCostAllocationTagBackfillOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BackfillRequest": + if err := awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequest(&sv.BackfillRequest, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentStartSavingsPlansPurchaseRecommendationGenerationOutput(v **StartSavingsPlansPurchaseRecommendationGenerationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/costexplorer/generated.json b/service/costexplorer/generated.json index 3836d745f95..cf013609d9e 100644 --- a/service/costexplorer/generated.json +++ b/service/costexplorer/generated.json @@ -35,11 +35,13 @@ "api_op_GetSavingsPlansUtilizationDetails.go", "api_op_GetTags.go", "api_op_GetUsageForecast.go", + "api_op_ListCostAllocationTagBackfillHistory.go", "api_op_ListCostAllocationTags.go", "api_op_ListCostCategoryDefinitions.go", "api_op_ListSavingsPlansPurchaseRecommendationGeneration.go", "api_op_ListTagsForResource.go", "api_op_ProvideAnomalyFeedback.go", + "api_op_StartCostAllocationTagBackfill.go", "api_op_StartSavingsPlansPurchaseRecommendationGeneration.go", "api_op_TagResource.go", "api_op_UntagResource.go", diff --git a/service/costexplorer/serializers.go b/service/costexplorer/serializers.go index c51b8648146..76af7876c61 100644 --- a/service/costexplorer/serializers.go +++ b/service/costexplorer/serializers.go @@ -1501,6 +1501,61 @@ func (m *awsAwsjson11_serializeOpGetUsageForecast) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory struct { +} + +func (*awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListCostAllocationTagBackfillHistoryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListCostAllocationTagBackfillHistory") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListCostAllocationTagBackfillHistoryInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListCostAllocationTags struct { } @@ -1776,6 +1831,61 @@ func (m *awsAwsjson11_serializeOpProvideAnomalyFeedback) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpStartCostAllocationTagBackfill struct { +} + +func (*awsAwsjson11_serializeOpStartCostAllocationTagBackfill) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStartCostAllocationTagBackfill) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartCostAllocationTagBackfillInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.StartCostAllocationTagBackfill") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStartCostAllocationTagBackfillInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpStartSavingsPlansPurchaseRecommendationGeneration struct { } @@ -3930,6 +4040,23 @@ func awsAwsjson11_serializeOpDocumentGetUsageForecastInput(v *GetUsageForecastIn return nil } +func awsAwsjson11_serializeOpDocumentListCostAllocationTagBackfillHistoryInput(v *ListCostAllocationTagBackfillHistoryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListCostAllocationTagsInput(v *ListCostAllocationTagsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4044,6 +4171,18 @@ func awsAwsjson11_serializeOpDocumentProvideAnomalyFeedbackInput(v *ProvideAnoma return nil } +func awsAwsjson11_serializeOpDocumentStartCostAllocationTagBackfillInput(v *StartCostAllocationTagBackfillInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BackfillFrom != nil { + ok := object.Key("BackfillFrom") + ok.String(*v.BackfillFrom) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentStartSavingsPlansPurchaseRecommendationGenerationInput(v *StartSavingsPlansPurchaseRecommendationGenerationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/costexplorer/snapshot_test.go b/service/costexplorer/snapshot_test.go index 13317c14ff3..0fd367f4ab3 100644 --- a/service/costexplorer/snapshot_test.go +++ b/service/costexplorer/snapshot_test.go @@ -386,6 +386,18 @@ func TestCheckSnapshot_GetUsageForecast(t *testing.T) { } } +func TestCheckSnapshot_ListCostAllocationTagBackfillHistory(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCostAllocationTagBackfillHistory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListCostAllocationTagBackfillHistory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListCostAllocationTags(t *testing.T) { svc := New(Options{}) _, err := svc.ListCostAllocationTags(context.Background(), nil, func(o *Options) { @@ -446,6 +458,18 @@ func TestCheckSnapshot_ProvideAnomalyFeedback(t *testing.T) { } } +func TestCheckSnapshot_StartCostAllocationTagBackfill(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartCostAllocationTagBackfill(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartCostAllocationTagBackfill") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartSavingsPlansPurchaseRecommendationGeneration(t *testing.T) { svc := New(Options{}) _, err := svc.StartSavingsPlansPurchaseRecommendationGeneration(context.Background(), nil, func(o *Options) { @@ -853,6 +877,18 @@ func TestUpdateSnapshot_GetUsageForecast(t *testing.T) { } } +func TestUpdateSnapshot_ListCostAllocationTagBackfillHistory(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCostAllocationTagBackfillHistory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListCostAllocationTagBackfillHistory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListCostAllocationTags(t *testing.T) { svc := New(Options{}) _, err := svc.ListCostAllocationTags(context.Background(), nil, func(o *Options) { @@ -913,6 +949,18 @@ func TestUpdateSnapshot_ProvideAnomalyFeedback(t *testing.T) { } } +func TestUpdateSnapshot_StartCostAllocationTagBackfill(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartCostAllocationTagBackfill(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartCostAllocationTagBackfill") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartSavingsPlansPurchaseRecommendationGeneration(t *testing.T) { svc := New(Options{}) _, err := svc.StartSavingsPlansPurchaseRecommendationGeneration(context.Background(), nil, func(o *Options) { diff --git a/service/costexplorer/types/enums.go b/service/costexplorer/types/enums.go index 66e897323bc..476b0048719 100644 --- a/service/costexplorer/types/enums.go +++ b/service/costexplorer/types/enums.go @@ -99,6 +99,27 @@ func (Context) Values() []Context { } } +type CostAllocationTagBackfillStatus string + +// Enum values for CostAllocationTagBackfillStatus +const ( + CostAllocationTagBackfillStatusSucceeded CostAllocationTagBackfillStatus = "SUCCEEDED" + CostAllocationTagBackfillStatusProcessing CostAllocationTagBackfillStatus = "PROCESSING" + CostAllocationTagBackfillStatusFailed CostAllocationTagBackfillStatus = "FAILED" +) + +// Values returns all known values for CostAllocationTagBackfillStatus. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (CostAllocationTagBackfillStatus) Values() []CostAllocationTagBackfillStatus { + return []CostAllocationTagBackfillStatus{ + "SUCCEEDED", + "PROCESSING", + "FAILED", + } +} + type CostAllocationTagStatus string // Enum values for CostAllocationTagStatus diff --git a/service/costexplorer/types/errors.go b/service/costexplorer/types/errors.go index 73db8b057cc..f6d6ab08efa 100644 --- a/service/costexplorer/types/errors.go +++ b/service/costexplorer/types/errors.go @@ -7,6 +7,33 @@ import ( smithy "github.com/aws/smithy-go" ) +// A request to backfill is already in progress. Once the previous request is +// complete, you can create another request. +type BackfillLimitExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *BackfillLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *BackfillLimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *BackfillLimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "BackfillLimitExceededException" + } + return *e.ErrorCodeOverride +} +func (e *BackfillLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The requested report expired. Update the date interval and try again. type BillExpirationException struct { Message *string diff --git a/service/costexplorer/types/types.go b/service/costexplorer/types/types.go index ca06977c6c0..c448987a872 100644 --- a/service/costexplorer/types/types.go +++ b/service/costexplorer/types/types.go @@ -285,6 +285,28 @@ type CostAllocationTag struct { noSmithyDocumentSerde } +// The cost allocation tag backfill request structure that contains metadata and +// details of a certain backfill. +type CostAllocationTagBackfillRequest struct { + + // The date the backfill starts from. + BackfillFrom *string + + // The status of the cost allocation tag backfill request. + BackfillStatus CostAllocationTagBackfillStatus + + // The backfill completion time. + CompletedAt *string + + // The time when the backfill status was last updated. + LastUpdatedAt *string + + // The time when the backfill was requested. + RequestedAt *string + + noSmithyDocumentSerde +} + // The cost allocation tag status. The status of a key can either be active or // inactive. type CostAllocationTagStatusEntry struct { diff --git a/service/costexplorer/validators.go b/service/costexplorer/validators.go index 0758bd3a82b..e3fc5e2f218 100644 --- a/service/costexplorer/validators.go +++ b/service/costexplorer/validators.go @@ -550,6 +550,26 @@ func (m *validateOpProvideAnomalyFeedback) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpStartCostAllocationTagBackfill struct { +} + +func (*validateOpStartCostAllocationTagBackfill) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartCostAllocationTagBackfill) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartCostAllocationTagBackfillInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartCostAllocationTagBackfillInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -778,6 +798,10 @@ func addOpProvideAnomalyFeedbackValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpProvideAnomalyFeedback{}, middleware.After) } +func addOpStartCostAllocationTagBackfillValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartCostAllocationTagBackfill{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -1670,6 +1694,21 @@ func validateOpProvideAnomalyFeedbackInput(v *ProvideAnomalyFeedbackInput) error } } +func validateOpStartCostAllocationTagBackfillInput(v *StartCostAllocationTagBackfillInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartCostAllocationTagBackfillInput"} + if v.BackfillFrom == nil { + invalidParams.Add(smithy.NewErrParamRequired("BackfillFrom")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/ec2/api_op_SearchTransitGatewayRoutes.go b/service/ec2/api_op_SearchTransitGatewayRoutes.go index 89037e62bcd..486961974c7 100644 --- a/service/ec2/api_op_SearchTransitGatewayRoutes.go +++ b/service/ec2/api_op_SearchTransitGatewayRoutes.go @@ -62,8 +62,7 @@ type SearchTransitGatewayRoutesInput struct { // UnauthorizedOperation . DryRun *bool - // The maximum number of routes to return. If a value is not provided, the default - // is 1000. + // The maximum number of routes to return. MaxResults *int32 noSmithyDocumentSerde diff --git a/service/ecs/api_op_CreateService.go b/service/ecs/api_op_CreateService.go index 90bc8009a9c..62ce332b56a 100644 --- a/service/ecs/api_op_CreateService.go +++ b/service/ecs/api_op_CreateService.go @@ -14,13 +14,14 @@ import ( // Runs and maintains your desired number of tasks from a specified task // definition. If the number of tasks running in a service drops below the // desiredCount , Amazon ECS runs another copy of the task in the specified -// cluster. To update an existing service, see the UpdateService action. The -// following change began on March 21, 2024. When the task definition revision is -// not specified, Amazon ECS resolves the task definition revision before it -// authorizes the task definition. In addition to maintaining the desired count of -// tasks in your service, you can optionally run your service behind one or more -// load balancers. The load balancers distribute traffic across the tasks that are -// associated with the service. For more information, see Service load balancing (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) +// cluster. To update an existing service, see the UpdateService action. On March +// 21, 2024, a change was made to resolve the task definition revision before +// authorization. When a task definition revision is not specified, authorization +// will occur using the latest revision of a task definition. In addition to +// maintaining the desired count of tasks in your service, you can optionally run +// your service behind one or more load balancers. The load balancers distribute +// traffic across the tasks that are associated with the service. For more +// information, see Service load balancing (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) // in the Amazon Elastic Container Service Developer Guide. You can attach Amazon // EBS volumes to Amazon ECS tasks by configuring the volume when creating or // updating a service. volumeConfigurations is only supported for REPLICA service diff --git a/service/ecs/api_op_CreateTaskSet.go b/service/ecs/api_op_CreateTaskSet.go index 367bdf1ddb8..35697f7f27d 100644 --- a/service/ecs/api_op_CreateTaskSet.go +++ b/service/ecs/api_op_CreateTaskSet.go @@ -14,11 +14,11 @@ import ( // Create a task set in the specified cluster and service. This is used when a // service uses the EXTERNAL deployment controller type. For more information, see // Amazon ECS deployment types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) -// in the Amazon Elastic Container Service Developer Guide. The following change -// began on March 21, 2024. When the task definition revision is not specified, -// Amazon ECS resolves the task definition revision before it authorizes the task -// definition. For information about the maximum number of task sets and otther -// quotas, see Amazon ECS service quotas (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html) +// in the Amazon Elastic Container Service Developer Guide. On March 21, 2024, a +// change was made to resolve the task definition revision before authorization. +// When a task definition revision is not specified, authorization will occur using +// the latest revision of a task definition. For information about the maximum +// number of task sets and otther quotas, see Amazon ECS service quotas (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html) // in the Amazon Elastic Container Service Developer Guide. func (c *Client) CreateTaskSet(ctx context.Context, params *CreateTaskSetInput, optFns ...func(*Options)) (*CreateTaskSetOutput, error) { if params == nil { diff --git a/service/ecs/api_op_RunTask.go b/service/ecs/api_op_RunTask.go index 140b811dd25..2a0299084e4 100644 --- a/service/ecs/api_op_RunTask.go +++ b/service/ecs/api_op_RunTask.go @@ -11,12 +11,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Starts a new task using the specified task definition. The following change -// began on March 21, 2024. When the task definition revision is not specified, -// Amazon ECS resolves the task definition revision before it authorizes the task -// definition. You can allow Amazon ECS to place tasks for you, or you can -// customize how Amazon ECS places tasks using placement constraints and placement -// strategies. For more information, see Scheduling Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) +// Starts a new task using the specified task definition. On March 21, 2024, a +// change was made to resolve the task definition revision before authorization. +// When a task definition revision is not specified, authorization will occur using +// the latest revision of a task definition. You can allow Amazon ECS to place +// tasks for you, or you can customize how Amazon ECS places tasks using placement +// constraints and placement strategies. For more information, see Scheduling Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) // in the Amazon Elastic Container Service Developer Guide. Alternatively, you can // use StartTask to use your own scheduler or place tasks manually on specific // container instances. Starting April 15, 2023, Amazon Web Services will not diff --git a/service/ecs/api_op_StartTask.go b/service/ecs/api_op_StartTask.go index 0dd9d0c3541..116d063f30c 100644 --- a/service/ecs/api_op_StartTask.go +++ b/service/ecs/api_op_StartTask.go @@ -12,17 +12,18 @@ import ( ) // Starts a new task from the specified task definition on the specified container -// instance or instances. The following change began on March 21, 2024. When the -// task definition revision is not specified, Amazon ECS resolves the task -// definition revision before it authorizes the task definition. Starting April 15, -// 2023, Amazon Web Services will not onboard new customers to Amazon Elastic -// Inference (EI), and will help current customers migrate their workloads to -// options that offer better price and performance. After April 15, 2023, new -// customers will not be able to launch instances with Amazon EI accelerators in -// Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used -// Amazon EI at least once during the past 30-day period are considered current -// customers and will be able to continue using the service. Alternatively, you can -// use RunTask to place tasks for you. For more information, see Scheduling Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) +// instance or instances. On March 21, 2024, a change was made to resolve the task +// definition revision before authorization. When a task definition revision is not +// specified, authorization will occur using the latest revision of a task +// definition. Starting April 15, 2023, Amazon Web Services will not onboard new +// customers to Amazon Elastic Inference (EI), and will help current customers +// migrate their workloads to options that offer better price and performance. +// After April 15, 2023, new customers will not be able to launch instances with +// Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, +// customers who have used Amazon EI at least once during the past 30-day period +// are considered current customers and will be able to continue using the service. +// Alternatively, you can use RunTask to place tasks for you. For more +// information, see Scheduling Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) // in the Amazon Elastic Container Service Developer Guide. You can attach Amazon // EBS volumes to Amazon ECS tasks by configuring the volume when creating or // updating a service. For more infomation, see Amazon EBS volumes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) diff --git a/service/ecs/api_op_UpdateService.go b/service/ecs/api_op_UpdateService.go index c5561e3e6a0..8e3f0dfa3fc 100644 --- a/service/ecs/api_op_UpdateService.go +++ b/service/ecs/api_op_UpdateService.go @@ -11,17 +11,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Modifies the parameters of a service. The following change began on March 21, -// 2024. When the task definition revision is not specified, Amazon ECS resolves -// the task definition revision before it authorizes the task definition. For -// services using the rolling update ( ECS ) you can update the desired count, -// deployment configuration, network configuration, load balancers, service -// registries, enable ECS managed tags option, propagate tags option, task -// placement constraints and strategies, and task definition. When you update any -// of these parameters, Amazon ECS starts new tasks with the new configuration. You -// can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when -// starting or running a task, or when creating or updating a service. For more -// infomation, see Amazon EBS volumes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) +// Modifies the parameters of a service. On March 21, 2024, a change was made to +// resolve the task definition revision before authorization. When a task +// definition revision is not specified, authorization will occur using the latest +// revision of a task definition. For services using the rolling update ( ECS ) you +// can update the desired count, deployment configuration, network configuration, +// load balancers, service registries, enable ECS managed tags option, propagate +// tags option, task placement constraints and strategies, and task definition. +// When you update any of these parameters, Amazon ECS starts new tasks with the +// new configuration. You can attach Amazon EBS volumes to Amazon ECS tasks by +// configuring the volume when starting or running a task, or when creating or +// updating a service. For more infomation, see Amazon EBS volumes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) // in the Amazon Elastic Container Service Developer Guide. You can update your // volume configurations and trigger a new deployment. volumeConfigurations is // only supported for REPLICA service and not DAEMON service. If you leave diff --git a/service/finspace/api_op_CreateKxChangeset.go b/service/finspace/api_op_CreateKxChangeset.go index df98d205d51..fdae74f0868 100644 --- a/service/finspace/api_op_CreateKxChangeset.go +++ b/service/finspace/api_op_CreateKxChangeset.go @@ -32,7 +32,7 @@ func (c *Client) CreateKxChangeset(ctx context.Context, params *CreateKxChangese type CreateKxChangesetInput struct { // A list of change request objects that are run in order. A change request object - // consists of changeType , s3Path , and dbPath . A changeType can has the + // consists of changeType , s3Path , and dbPath . A changeType can have the // following values: // - PUT – Adds or updates files in a database. // - DELETE – Deletes files in a database. diff --git a/service/finspace/api_op_DeleteKxClusterNode.go b/service/finspace/api_op_DeleteKxClusterNode.go new file mode 100644 index 00000000000..8fd16dad56d --- /dev/null +++ b/service/finspace/api_op_DeleteKxClusterNode.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package finspace + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified nodes from a cluster. +func (c *Client) DeleteKxClusterNode(ctx context.Context, params *DeleteKxClusterNodeInput, optFns ...func(*Options)) (*DeleteKxClusterNodeOutput, error) { + if params == nil { + params = &DeleteKxClusterNodeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteKxClusterNode", params, optFns, c.addOperationDeleteKxClusterNodeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteKxClusterNodeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteKxClusterNodeInput struct { + + // The name of the cluster, for which you want to delete the nodes. + // + // This member is required. + ClusterName *string + + // A unique identifier for the kdb environment. + // + // This member is required. + EnvironmentId *string + + // A unique identifier for the node that you want to delete. + // + // This member is required. + NodeId *string + + noSmithyDocumentSerde +} + +type DeleteKxClusterNodeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteKxClusterNodeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteKxClusterNode{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteKxClusterNode{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteKxClusterNode"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = addRestJsonContentTypeCustomization(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteKxClusterNodeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteKxClusterNode(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteKxClusterNode(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteKxClusterNode", + } +} diff --git a/service/finspace/deserializers.go b/service/finspace/deserializers.go index a73ec472c52..cb7a8c48023 100644 --- a/service/finspace/deserializers.go +++ b/service/finspace/deserializers.go @@ -2432,6 +2432,101 @@ func awsRestjson1_deserializeOpErrorDeleteKxCluster(response *smithyhttp.Respons } } +type awsRestjson1_deserializeOpDeleteKxClusterNode struct { +} + +func (*awsRestjson1_deserializeOpDeleteKxClusterNode) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteKxClusterNode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteKxClusterNode(response, &metadata) + } + output := &DeleteKxClusterNodeOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteKxClusterNode(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDeleteKxDatabase struct { } @@ -12673,6 +12768,15 @@ func awsRestjson1_deserializeDocumentKxNode(v **types.KxNode, value interface{}) sv.NodeId = ptr.String(jtv) } + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KxNodeStatus to be of type string, got %T instead", value) + } + sv.Status = types.KxNodeStatus(jtv) + } + default: _, _ = key, value diff --git a/service/finspace/generated.json b/service/finspace/generated.json index 46731dca097..cdcda3ebc36 100644 --- a/service/finspace/generated.json +++ b/service/finspace/generated.json @@ -19,6 +19,7 @@ "api_op_CreateKxVolume.go", "api_op_DeleteEnvironment.go", "api_op_DeleteKxCluster.go", + "api_op_DeleteKxClusterNode.go", "api_op_DeleteKxDatabase.go", "api_op_DeleteKxDataview.go", "api_op_DeleteKxEnvironment.go", diff --git a/service/finspace/serializers.go b/service/finspace/serializers.go index 2dd4b18d63d..4fcff1925d1 100644 --- a/service/finspace/serializers.go +++ b/service/finspace/serializers.go @@ -1277,6 +1277,89 @@ func awsRestjson1_serializeOpHttpBindingsDeleteKxClusterInput(v *DeleteKxCluster return nil } +type awsRestjson1_serializeOpDeleteKxClusterNode struct { +} + +func (*awsRestjson1_serializeOpDeleteKxClusterNode) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteKxClusterNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteKxClusterNodeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/kx/environments/{environmentId}/clusters/{clusterName}/nodes/{nodeId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteKxClusterNodeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteKxClusterNodeInput(v *DeleteKxClusterNodeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClusterName == nil || len(*v.ClusterName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} + } + if v.ClusterName != nil { + if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { + return err + } + } + + if v.EnvironmentId == nil || len(*v.EnvironmentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member environmentId must not be empty")} + } + if v.EnvironmentId != nil { + if err := encoder.SetURI("environmentId").String(*v.EnvironmentId); err != nil { + return err + } + } + + if v.NodeId == nil || len(*v.NodeId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nodeId must not be empty")} + } + if v.NodeId != nil { + if err := encoder.SetURI("nodeId").String(*v.NodeId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteKxDatabase struct { } diff --git a/service/finspace/snapshot_test.go b/service/finspace/snapshot_test.go index ff643899efb..899c51002ee 100644 --- a/service/finspace/snapshot_test.go +++ b/service/finspace/snapshot_test.go @@ -194,6 +194,18 @@ func TestCheckSnapshot_DeleteKxCluster(t *testing.T) { } } +func TestCheckSnapshot_DeleteKxClusterNode(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteKxClusterNode(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteKxClusterNode") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteKxDatabase(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteKxDatabase(context.Background(), nil, func(o *Options) { @@ -781,6 +793,18 @@ func TestUpdateSnapshot_DeleteKxCluster(t *testing.T) { } } +func TestUpdateSnapshot_DeleteKxClusterNode(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteKxClusterNode(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteKxClusterNode") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteKxDatabase(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteKxDatabase(context.Background(), nil, func(o *Options) { diff --git a/service/finspace/types/enums.go b/service/finspace/types/enums.go index 6adc73563ea..de3d7ff1d5d 100644 --- a/service/finspace/types/enums.go +++ b/service/finspace/types/enums.go @@ -341,6 +341,24 @@ func (KxNAS1Type) Values() []KxNAS1Type { } } +type KxNodeStatus string + +// Enum values for KxNodeStatus +const ( + KxNodeStatusRunning KxNodeStatus = "RUNNING" + KxNodeStatusProvisioning KxNodeStatus = "PROVISIONING" +) + +// Values returns all known values for KxNodeStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (KxNodeStatus) Values() []KxNodeStatus { + return []KxNodeStatus{ + "RUNNING", + "PROVISIONING", + } +} + type KxSavedownStorageType string // Enum values for KxSavedownStorageType diff --git a/service/finspace/types/types.go b/service/finspace/types/types.go index dff00582294..b6f0e6a1bdb 100644 --- a/service/finspace/types/types.go +++ b/service/finspace/types/types.go @@ -727,7 +727,9 @@ type KxEnvironment struct { // (NAS_1) file system volume. type KxNAS1Configuration struct { - // The size of the network attached storage. + // The size of the network attached storage. For storage type SSD_1000 and SSD_250 + // you can select the minimum size as 1200 GB or increments of 2400 GB. For storage + // type HDD_12 you can select the minimum size as 6000 GB or increments of 6000 GB. Size *int32 // The type of the network attached storage. @@ -751,6 +753,11 @@ type KxNode struct { // A unique identifier for the node. NodeId *string + // Specifies the status of the cluster nodes. + // - RUNNING – The node is actively serving. + // - PROVISIONING – The node is being prepared. + Status KxNodeStatus + noSmithyDocumentSerde } diff --git a/service/finspace/validators.go b/service/finspace/validators.go index 34e21a22275..7e5e70c4050 100644 --- a/service/finspace/validators.go +++ b/service/finspace/validators.go @@ -230,6 +230,26 @@ func (m *validateOpDeleteKxCluster) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpDeleteKxClusterNode struct { +} + +func (*validateOpDeleteKxClusterNode) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteKxClusterNode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteKxClusterNodeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteKxClusterNodeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteKxDatabase struct { } @@ -994,6 +1014,10 @@ func addOpDeleteKxClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteKxCluster{}, middleware.After) } +func addOpDeleteKxClusterNodeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteKxClusterNode{}, middleware.After) +} + func addOpDeleteKxDatabaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteKxDatabase{}, middleware.After) } @@ -1814,6 +1838,27 @@ func validateOpDeleteKxClusterInput(v *DeleteKxClusterInput) error { } } +func validateOpDeleteKxClusterNodeInput(v *DeleteKxClusterNodeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteKxClusterNodeInput"} + if v.EnvironmentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EnvironmentId")) + } + if v.ClusterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) + } + if v.NodeId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NodeId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteKxDatabaseInput(v *DeleteKxDatabaseInput) error { if v == nil { return nil