diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c4f6f3d844..adcf3df690a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# Release (2024-05-09) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/bedrockagentruntime`: [v1.9.0](service/bedrockagentruntime/CHANGELOG.md#v190-2024-05-09) + * **Feature**: This release adds support to provide guardrail configuration and modify inference parameters that are then used in RetrieveAndGenerate API in Agents for Amazon Bedrock. +* `github.com/aws/aws-sdk-go-v2/service/pinpoint`: [v1.30.0](service/pinpoint/CHANGELOG.md#v1300-2024-05-09) + * **Feature**: This release adds support for specifying email message headers for Email Templates, Campaigns, Journeys and Send Messages. +* `github.com/aws/aws-sdk-go-v2/service/route53resolver`: [v1.28.2](service/route53resolver/CHANGELOG.md#v1282-2024-05-09) + * **Documentation**: Update the DNS Firewall settings to correct a spelling issue. +* `github.com/aws/aws-sdk-go-v2/service/ssmsap`: [v1.13.0](service/ssmsap/CHANGELOG.md#v1130-2024-05-09) + * **Feature**: Added support for application-aware start/stop of SAP applications running on EC2 instances, with SSM for SAP +* `github.com/aws/aws-sdk-go-v2/service/verifiedpermissions`: [v1.14.0](service/verifiedpermissions/CHANGELOG.md#v1140-2024-05-09) + * **Feature**: Adds policy effect and actions fields to Policy API's. + # Release (2024-05-08) ## General Highlights diff --git a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json index f31a18b8655..cf7d1e63f12 100644 --- a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json +++ b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json @@ -84,6 +84,27 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockagentruntime#AdditionalModelRequestFields": { + "type": "map", + "key": { + "target": "com.amazonaws.bedrockagentruntime#AdditionalModelRequestFieldsKey" + }, + "value": { + "target": "com.amazonaws.bedrockagentruntime#AdditionalModelRequestFieldsValue" + } + }, + "com.amazonaws.bedrockagentruntime#AdditionalModelRequestFieldsKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.bedrockagentruntime#AdditionalModelRequestFieldsValue": { + "type": "document" + }, "com.amazonaws.bedrockagentruntime#AgentAliasId": { "type": "string", "traits": { @@ -850,7 +871,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains information about the API operation that the agent predicts should be called.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains information about the API operation that the agent predicts should be called.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#ApiParameter": { @@ -876,7 +897,7 @@ } }, "traits": { - "smithy.api#documentation": "

Information about a parameter to provide to the API request.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Information about a parameter to provide to the API request.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#ApiParameters": { @@ -902,7 +923,7 @@ } }, "traits": { - "smithy.api#documentation": "

The request body to provide for the API request, as the agent elicited from the user.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

The request body to provide for the API request, as the agent elicited from the user.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#ApiResult": { @@ -930,7 +951,7 @@ "responseBody": { "target": "com.amazonaws.bedrockagentruntime#ResponseBody", "traits": { - "smithy.api#documentation": "

The response body from the API operation. The key of the object is the content type. The response may be returned directly or from the Lambda function.

" + "smithy.api#documentation": "

The response body from the API operation. The key of the object is the content type (currently, only TEXT is supported). The response may be returned directly or from the Lambda function.

" } }, "httpStatusCode": { @@ -947,7 +968,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains information about the API operation that was called from the action group and the response body that was returned.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains information about the API operation that was called from the action group and the response body that was returned.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#Attribution": { @@ -1049,7 +1070,7 @@ } }, "traits": { - "smithy.api#documentation": "

An object containing a segment of the generated response that is based on a source in the knowledge base, alongside information about the source.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

An object containing a segment of the generated response that is based on a source in the knowledge base, alongside information about the source.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#Citations": { @@ -1082,7 +1103,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains the body of the API response.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains the body of the API response.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#ContentMap": { @@ -1200,6 +1221,24 @@ "traits": { "smithy.api#documentation": "

Contain the textPromptTemplate string for the external source wrapper object.

" } + }, + "guardrailConfiguration": { + "target": "com.amazonaws.bedrockagentruntime#GuardrailConfiguration", + "traits": { + "smithy.api#documentation": "

The configuration details for the guardrail.

" + } + }, + "inferenceConfig": { + "target": "com.amazonaws.bedrockagentruntime#InferenceConfig", + "traits": { + "smithy.api#documentation": "

Configuration settings for inference when using RetrieveAndGenerate to generate responses while using an external source.

" + } + }, + "additionalModelRequestFields": { + "target": "com.amazonaws.bedrockagentruntime#AdditionalModelRequestFields", + "traits": { + "smithy.api#documentation": "

Additional model parameters and their corresponding values not included in the textInferenceConfig structure for an external source. Takes in custom model parameters specific to the language model being used.

" + } } }, "traits": { @@ -1345,7 +1384,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains information about the function that the agent predicts should be called.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains information about the function that the agent predicts should be called.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#FunctionParameter": { @@ -1371,7 +1410,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains information about a parameter of the function.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains information about a parameter of the function.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#FunctionParameters": { @@ -1399,7 +1438,7 @@ "responseBody": { "target": "com.amazonaws.bedrockagentruntime#ResponseBody", "traits": { - "smithy.api#documentation": "

The response from the function call using the parameters. The response may be returned directly or from the Lambda function.

" + "smithy.api#documentation": "

The response from the function call using the parameters. The key of the object is the content type (currently, only TEXT is supported). The response may be returned directly or from the Lambda function.

" } }, "responseState": { @@ -1410,7 +1449,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains information about the function that was called from the action group and the response that was returned.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains information about the function that was called from the action group and the response that was returned.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#GeneratedResponsePart": { @@ -1424,7 +1463,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains metadata about a part of the generated response that is accompanied by a citation.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains metadata about a part of the generated response that is accompanied by a citation.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#GenerationConfiguration": { @@ -1435,12 +1474,78 @@ "traits": { "smithy.api#documentation": "

Contains the template for the prompt that's sent to the model for response generation.

" } + }, + "guardrailConfiguration": { + "target": "com.amazonaws.bedrockagentruntime#GuardrailConfiguration", + "traits": { + "smithy.api#documentation": "

The configuration details for the guardrail.

" + } + }, + "inferenceConfig": { + "target": "com.amazonaws.bedrockagentruntime#InferenceConfig", + "traits": { + "smithy.api#documentation": "

Configuration settings for inference when using RetrieveAndGenerate to generate responses while using a knowledge base as a source.

" + } + }, + "additionalModelRequestFields": { + "target": "com.amazonaws.bedrockagentruntime#AdditionalModelRequestFields", + "traits": { + "smithy.api#documentation": "

Additional model parameters and corresponding values not included in the textInferenceConfig structure for a knowledge base. This allows users to provide custom model parameters specific to the language model being used.

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

Contains configurations for response generation based on the knowledge base query results.

\n

This data type is used in the following API operations:

\n " } }, + "com.amazonaws.bedrockagentruntime#GuadrailAction": { + "type": "enum", + "members": { + "INTERVENED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INTERVENED" + } + }, + "NONE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NONE" + } + } + } + }, + "com.amazonaws.bedrockagentruntime#GuardrailConfiguration": { + "type": "structure", + "members": { + "guardrailId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The unique identifier for the guardrail.

", + "smithy.api#length": { + "max": 64 + }, + "smithy.api#pattern": "^[a-z0-9]+$", + "smithy.api#required": {} + } + }, + "guardrailVersion": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The version of the guardrail.

", + "smithy.api#length": { + "min": 1, + "max": 5 + }, + "smithy.api#pattern": "^(([1-9][0-9]{0,7})|(DRAFT))$", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The configuration details for the guardrail.

" + } + }, "com.amazonaws.bedrockagentruntime#Identifier": { "type": "string", "traits": { @@ -1451,6 +1556,20 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockagentruntime#InferenceConfig": { + "type": "structure", + "members": { + "textInferenceConfig": { + "target": "com.amazonaws.bedrockagentruntime#TextInferenceConfig", + "traits": { + "smithy.api#documentation": "

Configuration settings specific to text generation while generating responses using RetrieveAndGenerate.

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

The configuration for inference settings when generating responses using RetrieveAndGenerate.

" + } + }, "com.amazonaws.bedrockagentruntime#InferenceConfiguration": { "type": "structure", "members": { @@ -1569,7 +1688,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains details about the API operation or function that the agent predicts should be called.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains details about the API operation or function that the agent predicts should be called.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#InvocationInputs": { @@ -1601,7 +1720,7 @@ } }, "traits": { - "smithy.api#documentation": "

A result from the action group invocation.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

A result from the invocation of an action. For more information, see Return control to the agent developer and Control session context.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#InvocationType": { @@ -1665,7 +1784,7 @@ } ], "traits": { - "smithy.api#documentation": "

Sends a prompt for the agent to process and respond to. Use return control event type for function calling.

\n \n

The CLI doesn't support InvokeAgent.

\n
\n \n

The response is returned in the bytes field of the chunk object.

\n ", + "smithy.api#documentation": "\n

The CLI doesn't support InvokeAgent.

\n
\n

Sends a prompt for the agent to process and respond to. Note the following fields for the request:

\n \n

The response is returned in the bytes field of the chunk object.

\n ", "smithy.api#http": { "code": 200, "method": "POST", @@ -1679,7 +1798,7 @@ "sessionState": { "target": "com.amazonaws.bedrockagentruntime#SessionState", "traits": { - "smithy.api#documentation": "

Contains parameters that specify various attributes of the session. For more information, see Control session context.

" + "smithy.api#documentation": "

Contains parameters that specify various attributes of the session. For more information, see Control session context.

\n \n

If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.

\n
" } }, "agentId": { @@ -1721,7 +1840,7 @@ "inputText": { "target": "com.amazonaws.bedrockagentruntime#InputText", "traits": { - "smithy.api#documentation": "

The prompt text to send the agent.

" + "smithy.api#documentation": "

The prompt text to send the agent.

\n \n

If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.

\n
" } } }, @@ -1965,6 +2084,15 @@ "com.amazonaws.bedrockagentruntime#LambdaArn": { "type": "string" }, + "com.amazonaws.bedrockagentruntime#MaxTokens": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 65536 + } + } + }, "com.amazonaws.bedrockagentruntime#MaximumLength": { "type": "integer", "traits": { @@ -2388,6 +2516,24 @@ "smithy.api#documentation": "

Contains the parameters in the request body.

" } }, + "com.amazonaws.bedrockagentruntime#RAGStopSequences": { + "type": "list", + "member": { + "target": "smithy.api#String", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + } + } + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 4 + } + } + }, "com.amazonaws.bedrockagentruntime#Rationale": { "type": "structure", "members": { @@ -2669,7 +2815,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains the cited text from the data source.

\n

This data type is used in the following API operations:

\n ", + "smithy.api#documentation": "

Contains the cited text from the data source.

\n

This data type is used in the following API operations:

\n ", "smithy.api#sensitive": {} } }, @@ -2691,7 +2837,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains information about the location of the data source.

\n

This data type is used in the following API operations:

\n ", + "smithy.api#documentation": "

Contains information about the location of the data source.

\n

This data type is used in the following API operations:

\n ", "smithy.api#sensitive": {} } }, @@ -2744,7 +2890,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains the S3 location of the data source.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains the S3 location of the data source.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#Retrieve": { @@ -2970,6 +3116,12 @@ "traits": { "smithy.api#documentation": "

A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.

" } + }, + "guardrailAction": { + "target": "com.amazonaws.bedrockagentruntime#GuadrailAction", + "traits": { + "smithy.api#documentation": "

Specifies if there is a guardrail intervention in the response.

" + } } }, "traits": { @@ -3095,7 +3247,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains metadata about a source cited for the generated response.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains metadata about a source cited for the generated response.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#RetrievedReferences": { @@ -3133,7 +3285,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains information to return from the action group that the agent has predicted to invoke.

\n

This data type is used in the following API operations:

\n ", + "smithy.api#documentation": "

Contains information to return from the action group that the agent has predicted to invoke.

\n

This data type is used in the following API operations:

\n ", "smithy.api#sensitive": {} } }, @@ -3229,13 +3381,13 @@ "returnControlInvocationResults": { "target": "com.amazonaws.bedrockagentruntime#ReturnControlInvocationResults", "traits": { - "smithy.api#documentation": "

Contains information about the results from the action group invocation.

" + "smithy.api#documentation": "

Contains information about the results from the action group invocation. For more information, see Return control to the agent developer and Control session context.

\n \n

If you include this field, the inputText field will be ignored.

\n
" } }, "invocationId": { "target": "smithy.api#String", "traits": { - "smithy.api#documentation": "

The identifier of the invocation.

" + "smithy.api#documentation": "

The identifier of the invocation of an action. This value must match the invocationId returned in the InvokeAgent response for the action whose results are provided in the returnControlInvocationResults field. For more information, see Return control to the agent developer and Control session context.

" } } }, @@ -3292,7 +3444,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains information about where the text with a citation begins and ends in the generated output.

\n

This data type is used in the following API operations:

\n " + "smithy.api#documentation": "

Contains information about where the text with a citation begins and ends in the generated output.

\n

This data type is used in the following API operations:

\n " } }, "com.amazonaws.bedrockagentruntime#StopSequences": { @@ -3316,6 +3468,38 @@ } } }, + "com.amazonaws.bedrockagentruntime#TextInferenceConfig": { + "type": "structure", + "members": { + "temperature": { + "target": "com.amazonaws.bedrockagentruntime#Temperature", + "traits": { + "smithy.api#documentation": "

Controls the random-ness of text generated by the language model, influencing how much the model sticks to the most predictable next words versus exploring more surprising options. A lower temperature value (e.g. 0.2 or 0.3) makes model outputs more deterministic or predictable, while a higher temperature (e.g. 0.8 or 0.9) makes the outputs more creative or unpredictable.

" + } + }, + "topP": { + "target": "com.amazonaws.bedrockagentruntime#TopP", + "traits": { + "smithy.api#documentation": "

A probability distribution threshold which controls what the model considers for the set of possible next tokens. The model will only consider the top p% of the probability distribution when generating the next token.

" + } + }, + "maxTokens": { + "target": "com.amazonaws.bedrockagentruntime#MaxTokens", + "traits": { + "smithy.api#documentation": "

The maximum number of tokens to generate in the output text. Do not use the minimum of 0\n or the maximum of 65536. The limit values described here are arbitary values, for actual\n values consult the limits defined by your specific model.

" + } + }, + "stopSequences": { + "target": "com.amazonaws.bedrockagentruntime#RAGStopSequences", + "traits": { + "smithy.api#documentation": "

A list of sequences of characters that, if generated, will cause the model to stop\n generating further tokens. Do not use a minimum length of 1 or a maximum length of 1000. The\n limit values described here are arbitary values, for actual values consult the limits defined\n by your specific model.

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

Configuration settings for text generation using a language model via the\n RetrieveAndGenerate operation. Includes parameters like temperature, top-p, maximum token\n count, and stop sequences.

\n \n

The valid range of maxTokens depends on the accepted values for your chosen\n model's inference parameters. To see the inference parameters for your model, see Inference\n parameters for foundation models.\n

\n
" + } + }, "com.amazonaws.bedrockagentruntime#TextPromptTemplate": { "type": "string", "traits": { @@ -3343,7 +3527,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains the part of the generated text that contains a citation, alongside where it begins and ends.

\n

This data type is used in the following API operations:

\n ", + "smithy.api#documentation": "

Contains the part of the generated text that contains a citation, alongside where it begins and ends.

\n

This data type is used in the following API operations:

\n ", "smithy.api#sensitive": {} } }, diff --git a/codegen/sdk-codegen/aws-models/pinpoint.json b/codegen/sdk-codegen/aws-models/pinpoint.json index bd176ea385a..5dfd2d90a1a 100644 --- a/codegen/sdk-codegen/aws-models/pinpoint.json +++ b/codegen/sdk-codegen/aws-models/pinpoint.json @@ -1939,6 +1939,12 @@ "smithy.api#documentation": "

The verified email address to send the email from. The default address is the FromAddress specified for the email channel for the application.

" } }, + "Headers": { + "target": "com.amazonaws.pinpoint#ListOfMessageHeader", + "traits": { + "smithy.api#documentation": "

The list of MessageHeaders for the email. You can have up to 15 MessageHeaders for each email.

" + } + }, "HtmlBody": { "target": "com.amazonaws.pinpoint#__string", "traits": { @@ -6133,6 +6139,12 @@ "smithy.api#documentation": "

The subject line, or title, to use in email messages that are based on the message template.

" } }, + "Headers": { + "target": "com.amazonaws.pinpoint#ListOfMessageHeader", + "traits": { + "smithy.api#documentation": "

The list of MessageHeaders for the email. You can have up to 15 Headers.

" + } + }, "tags": { "target": "com.amazonaws.pinpoint#MapOf__string", "traits": { @@ -6206,6 +6218,12 @@ "smithy.api#documentation": "

The subject line, or title, that's used in email messages that are based on the message template.

" } }, + "Headers": { + "target": "com.amazonaws.pinpoint#ListOfMessageHeader", + "traits": { + "smithy.api#documentation": "

The list of MessageHeaders for the email. You can have up to 15 Headers.

" + } + }, "tags": { "target": "com.amazonaws.pinpoint#MapOf__string", "traits": { @@ -13509,6 +13527,12 @@ "target": "com.amazonaws.pinpoint#JourneyRunResponse" } }, + "com.amazonaws.pinpoint#ListOfMessageHeader": { + "type": "list", + "member": { + "target": "com.amazonaws.pinpoint#MessageHeader" + } + }, "com.amazonaws.pinpoint#ListOfMultiConditionalBranch": { "type": "list", "member": { @@ -14202,6 +14226,26 @@ "smithy.api#documentation": "

Specifies the message configuration settings for a campaign.

" } }, + "com.amazonaws.pinpoint#MessageHeader": { + "type": "structure", + "members": { + "Name": { + "target": "com.amazonaws.pinpoint#__string", + "traits": { + "smithy.api#documentation": "

The name of the message header. The header name can contain up to 126 characters.

" + } + }, + "Value": { + "target": "com.amazonaws.pinpoint#__string", + "traits": { + "smithy.api#documentation": "

The value of the message header. The header value can contain up to 870 characters, including the length of any rendered attributes. For example if you add the {CreationDate} attribute, it renders as YYYY-MM-DDTHH:MM:SS.SSSZ and is 24 characters in length.

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

Contains the name and value pair of an email header to add to your email. You can have up to 15 MessageHeaders. A header can contain information such as the sender, receiver, route, or timestamp.

" + } + }, "com.amazonaws.pinpoint#MessageRequest": { "type": "structure", "members": { @@ -18128,6 +18172,12 @@ "traits": { "smithy.api#documentation": "

The body of the email message, in plain text format. We recommend using plain text format for email clients that don't render HTML content and clients that are connected to high-latency networks, such as mobile devices.

" } + }, + "Headers": { + "target": "com.amazonaws.pinpoint#ListOfMessageHeader", + "traits": { + "smithy.api#documentation": "

The list of MessageHeaders for the email. You can have up to 15 Headers.

" + } } }, "traits": { diff --git a/codegen/sdk-codegen/aws-models/route53resolver.json b/codegen/sdk-codegen/aws-models/route53resolver.json index 8d56c9b1a0a..95aa1d4cc82 100644 --- a/codegen/sdk-codegen/aws-models/route53resolver.json +++ b/codegen/sdk-codegen/aws-models/route53resolver.json @@ -760,7 +760,7 @@ "FirewallDomainRedirectionAction": { "target": "com.amazonaws.route53resolver#FirewallDomainRedirectionAction", "traits": { - "smithy.api#documentation": "

\n\t\t\tHow you want the the rule to evaluate DNS redirection in the DNS redirection chain, such as CNAME, DNAME, ot ALIAS. \n\t\t

\n

\n Inspect_Redirection_Domain (Default) inspects all domains in the redirection chain. The individual domains in the redirection chain must be \n\t\t\tadded to the allow domain list.

\n

\n Trust_Redirection_Domain inspects only the first domain in the redirection chain. You don't need to add the subsequent domains in the redirection list to \n\t\tthe domain alloww list.

" + "smithy.api#documentation": "

\n\t\t\tHow you want the the rule to evaluate DNS redirection in the DNS redirection chain, such as CNAME or DNAME. \n\t\t

\n

\n Inspect_Redirection_Domain (Default) inspects all domains in the redirection chain. The individual domains in the redirection chain must be \n\t\t\tadded to the domain list.

\n

\n Trust_Redirection_Domain inspects only the first domain in the redirection chain. You don't need to add the subsequent domains in the domain in the redirection list to \n\t\t\tthe domain list.

" } }, "Qtype": { @@ -2326,7 +2326,7 @@ "FirewallDomainRedirectionAction": { "target": "com.amazonaws.route53resolver#FirewallDomainRedirectionAction", "traits": { - "smithy.api#documentation": "

\n\t\t\tHow you want the the rule to evaluate DNS redirection in the DNS redirection chain, such as CNAME, DNAME, ot ALIAS. \n\t\t

\n

\n Inspect_Redirection_Domain (Default) inspects all domains in the redirection chain. The individual domains in the redirection chain must be \n\t\t\tadded to the allow domain list.

\n

\n Trust_Redirection_Domain inspects only the first domain in the redirection chain. You don't need to add the subsequent domains in the domain in the redirection list to \n\t\t\tthe domain alloww list.

" + "smithy.api#documentation": "

\n\t\t\tHow you want the the rule to evaluate DNS redirection in the DNS redirection chain, such as CNAME or DNAME. \n\t\t

\n

\n Inspect_Redirection_Domain (Default) inspects all domains in the redirection chain. The individual domains in the redirection chain must be \n\t\t\tadded to the domain list.

\n

\n Trust_Redirection_Domain inspects only the first domain in the redirection chain. You don't need to add the subsequent domains in the domain in the redirection list to \n\t\t\tthe domain list.

" } }, "Qtype": { @@ -8629,7 +8629,7 @@ "FirewallDomainRedirectionAction": { "target": "com.amazonaws.route53resolver#FirewallDomainRedirectionAction", "traits": { - "smithy.api#documentation": "

\n\t\t\tHow you want the the rule to evaluate DNS redirection in the DNS redirection chain, such as CNAME, DNAME, ot ALIAS. \n\t\t

\n

\n Inspect_Redirection_Domain (Default) inspects all domains in the redirection chain. The individual domains in the redirection chain must be \n\t\t\tadded to the allow domain list.

\n

\n Trust_Redirection_Domain inspects only the first domain in the redirection chain. You don't need to add the subsequent domains in the domain in the redirection list to \n\t\t\tthe domain alloww list.

" + "smithy.api#documentation": "

\n\t\t\tHow you want the the rule to evaluate DNS redirection in the DNS redirection chain, such as CNAME or DNAME. \n\t\t

\n

\n Inspect_Redirection_Domain (Default) inspects all domains in the redirection chain. The individual domains in the redirection chain must be \n\t\t\tadded to the domain list.

\n

\n Trust_Redirection_Domain inspects only the first domain in the redirection chain. You don't need to add the subsequent domains in the domain in the redirection list to \n\t\t\tthe domain list.

" } }, "Qtype": { diff --git a/codegen/sdk-codegen/aws-models/ssm-sap.json b/codegen/sdk-codegen/aws-models/ssm-sap.json index 3e020f2cb92..ad96b14b1cf 100644 --- a/codegen/sdk-codegen/aws-models/ssm-sap.json +++ b/codegen/sdk-codegen/aws-models/ssm-sap.json @@ -703,6 +703,17 @@ "smithy.api#httpError": 409 } }, + "com.amazonaws.ssmsap#ConnectedEntityType": { + "type": "enum", + "members": { + "DBMS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DBMS" + } + } + } + }, "com.amazonaws.ssmsap#CredentialType": { "type": "enum", "members": { @@ -1648,7 +1659,7 @@ "target": "com.amazonaws.ssmsap#MaxResults", "traits": { "smithy.api#default": null, - "smithy.api#documentation": "

The maximum number of results to return with a single call. To retrieve the remaining\n results, make another call with the returned nextToken value.

" + "smithy.api#documentation": "

The maximum number of results to return with a single call. To retrieve the remaining\n results, make another call with the returned nextToken value.

" } }, "Filters": { @@ -1837,6 +1848,92 @@ } } }, + "com.amazonaws.ssmsap#ListOperationEvents": { + "type": "operation", + "input": { + "target": "com.amazonaws.ssmsap#ListOperationEventsInput" + }, + "output": { + "target": "com.amazonaws.ssmsap#ListOperationEventsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.ssmsap#InternalServerException" + }, + { + "target": "com.amazonaws.ssmsap#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a list of operations events.

\n

Available parameters include OperationID, as well as optional parameters\n MaxResults, NextToken, and\n Filters.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/list-operation-events" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "OperationEvents" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.ssmsap#ListOperationEventsInput": { + "type": "structure", + "members": { + "OperationId": { + "target": "com.amazonaws.ssmsap#OperationId", + "traits": { + "smithy.api#documentation": "

The ID of the operation.

", + "smithy.api#required": {} + } + }, + "MaxResults": { + "target": "com.amazonaws.ssmsap#MaxResults", + "traits": { + "smithy.api#default": null, + "smithy.api#documentation": "

The maximum number of results to return with a single call. To retrieve the remaining\n results, make another call with the returned nextToken value.

\n

If you do not specify a value for MaxResults, the request returns 50 items\n per page by default.

" + } + }, + "NextToken": { + "target": "com.amazonaws.ssmsap#NextToken", + "traits": { + "smithy.api#documentation": "

The token to use to retrieve the next page of results. \n This value is null when there are no more results to return.

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

Optionally specify filters to narrow the returned operation \n event items.

\n

Valid filter names include status, resourceID, \n and resourceType. The valid operator for all three filters \n is Equals.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.ssmsap#ListOperationEventsOutput": { + "type": "structure", + "members": { + "OperationEvents": { + "target": "com.amazonaws.ssmsap#OperationEventList", + "traits": { + "smithy.api#documentation": "

A returned list of operation events that \n meet the filter criteria.

" + } + }, + "NextToken": { + "target": "com.amazonaws.ssmsap#NextToken", + "traits": { + "smithy.api#documentation": "

The token to use to retrieve the next page of results. This value is null when there are\n no more results to return.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.ssmsap#ListOperations": { "type": "operation", "input": { @@ -2059,6 +2156,79 @@ "smithy.api#documentation": "

The operations performed by AWS Systems Manager for SAP.

" } }, + "com.amazonaws.ssmsap#OperationEvent": { + "type": "structure", + "members": { + "Description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A description of the operation event. For example, \n \"Stop the EC2 instance i-abcdefgh987654321\".

" + } + }, + "Resource": { + "target": "com.amazonaws.ssmsap#Resource", + "traits": { + "smithy.api#documentation": "

The resource involved in the operations event.

\n

Contains ResourceArn ARN and ResourceType.

" + } + }, + "Status": { + "target": "com.amazonaws.ssmsap#OperationEventStatus", + "traits": { + "smithy.api#documentation": "

The status of the operation event. The possible statuses \n are: IN_PROGRESS, \n COMPLETED, and FAILED.

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

The status message relating to a specific \n operation event.

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

The timestamp of the specified operation event.

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

An operation event returns details for an operation, including \n key milestones which can be used to monitor and track operations \n in progress.

\n

Operation events contain:

\n \n

Operation event examples include StartApplication or \n StopApplication.

" + } + }, + "com.amazonaws.ssmsap#OperationEventList": { + "type": "list", + "member": { + "target": "com.amazonaws.ssmsap#OperationEvent" + } + }, + "com.amazonaws.ssmsap#OperationEventResourceType": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[\\w]+::[\\w]+::[\\w]+$" + } + }, + "com.amazonaws.ssmsap#OperationEventStatus": { + "type": "enum", + "members": { + "IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IN_PROGRESS" + } + }, + "COMPLETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETED" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + } + } + }, "com.amazonaws.ssmsap#OperationId": { "type": "string", "traits": { @@ -2405,6 +2575,26 @@ "smithy.api#documentation": "

Details of the SAP HANA system replication for the instance.

" } }, + "com.amazonaws.ssmsap#Resource": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.ssmsap#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the source resource.

\n

Example of ResourceArn: \n \"arn:aws:ec2:us-east-1:111111111111:instance/i-abcdefgh987654321\"

" + } + }, + "ResourceType": { + "target": "com.amazonaws.ssmsap#OperationEventResourceType", + "traits": { + "smithy.api#documentation": "

The resource type.

\n

Example of ResourceType: \"AWS::SystemsManagerSAP::Component\" \n or \"AWS::EC2::Instance\".

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

The resource contains a ResourceArn \n and the ResourceType.

" + } + }, "com.amazonaws.ssmsap#ResourceId": { "type": "string", "traits": { @@ -2492,6 +2682,9 @@ { "target": "com.amazonaws.ssmsap#ListDatabases" }, + { + "target": "com.amazonaws.ssmsap#ListOperationEvents" + }, { "target": "com.amazonaws.ssmsap#ListOperations" }, @@ -2504,9 +2697,15 @@ { "target": "com.amazonaws.ssmsap#RegisterApplication" }, + { + "target": "com.amazonaws.ssmsap#StartApplication" + }, { "target": "com.amazonaws.ssmsap#StartApplicationRefresh" }, + { + "target": "com.amazonaws.ssmsap#StopApplication" + }, { "target": "com.amazonaws.ssmsap#TagResource" }, @@ -3214,6 +3413,66 @@ "smithy.api#pattern": "^arn:(.+:){2,4}.+$|^arn:(.+:){1,3}.+\\/.+$" } }, + "com.amazonaws.ssmsap#StartApplication": { + "type": "operation", + "input": { + "target": "com.amazonaws.ssmsap#StartApplicationInput" + }, + "output": { + "target": "com.amazonaws.ssmsap#StartApplicationOutput" + }, + "errors": [ + { + "target": "com.amazonaws.ssmsap#ConflictException" + }, + { + "target": "com.amazonaws.ssmsap#InternalServerException" + }, + { + "target": "com.amazonaws.ssmsap#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.ssmsap#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Request is an operation which starts an application.

\n

Parameter ApplicationId is required.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/start-application" + } + } + }, + "com.amazonaws.ssmsap#StartApplicationInput": { + "type": "structure", + "members": { + "ApplicationId": { + "target": "com.amazonaws.ssmsap#ApplicationId", + "traits": { + "smithy.api#documentation": "

The ID of the application.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.ssmsap#StartApplicationOutput": { + "type": "structure", + "members": { + "OperationId": { + "target": "com.amazonaws.ssmsap#OperationId", + "traits": { + "smithy.api#documentation": "

The ID of the operation.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.ssmsap#StartApplicationRefresh": { "type": "operation", "input": { @@ -3277,6 +3536,78 @@ "smithy.api#output": {} } }, + "com.amazonaws.ssmsap#StopApplication": { + "type": "operation", + "input": { + "target": "com.amazonaws.ssmsap#StopApplicationInput" + }, + "output": { + "target": "com.amazonaws.ssmsap#StopApplicationOutput" + }, + "errors": [ + { + "target": "com.amazonaws.ssmsap#ConflictException" + }, + { + "target": "com.amazonaws.ssmsap#InternalServerException" + }, + { + "target": "com.amazonaws.ssmsap#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.ssmsap#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Request is an operation to stop an application.

\n

Parameter ApplicationId is required. \n Parameters StopConnectedEntity and \n IncludeEc2InstanceShutdown are optional.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/stop-application" + } + } + }, + "com.amazonaws.ssmsap#StopApplicationInput": { + "type": "structure", + "members": { + "ApplicationId": { + "target": "com.amazonaws.ssmsap#ApplicationId", + "traits": { + "smithy.api#documentation": "

The ID of the application.

", + "smithy.api#required": {} + } + }, + "StopConnectedEntity": { + "target": "com.amazonaws.ssmsap#ConnectedEntityType", + "traits": { + "smithy.api#documentation": "

Specify the ConnectedEntityType. Accepted type \n is DBMS.

\n

If this parameter is included, the connected DBMS (Database \n Management System) will be stopped.

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

Boolean. If included and if set to True, the \n StopApplication operation will shut down the associated Amazon EC2 instance in addition to \n the application.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.ssmsap#StopApplicationOutput": { + "type": "structure", + "members": { + "OperationId": { + "target": "com.amazonaws.ssmsap#OperationId", + "traits": { + "smithy.api#documentation": "

The ID of the operation.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.ssmsap#TagKey": { "type": "string", "traits": { diff --git a/codegen/sdk-codegen/aws-models/verifiedpermissions.json b/codegen/sdk-codegen/aws-models/verifiedpermissions.json index 948569b7625..b06b6596ef2 100644 --- a/codegen/sdk-codegen/aws-models/verifiedpermissions.json +++ b/codegen/sdk-codegen/aws-models/verifiedpermissions.json @@ -50,6 +50,12 @@ "smithy.api#documentation": "

Contains information about an action for a request for which an authorization decision\n is made.

\n

This data type is used as a request parameter to the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken\n operations.

\n

Example: { \"actionId\": \"<action name>\", \"actionType\": \"Action\"\n }\n

" } }, + "com.amazonaws.verifiedpermissions#ActionIdentifierList": { + "type": "list", + "member": { + "target": "com.amazonaws.verifiedpermissions#ActionIdentifier" + } + }, "com.amazonaws.verifiedpermissions#ActionType": { "type": "string", "traits": { @@ -458,7 +464,7 @@ } }, "traits": { - "smithy.api#documentation": "

A list of user groups and entities from an Amazon Cognito user pool identity\n source.

\n

This data type is part of a CognitoUserPoolConfiguration structure and is a request parameter in CreateIdentitySource.

" + "smithy.api#documentation": "

The type of entity that a policy store maps to groups from an Amazon Cognito user \n pool identity source.

\n

This data type is part of a CognitoUserPoolConfiguration structure and is a request parameter in CreateIdentitySource.

" } }, "com.amazonaws.verifiedpermissions#CognitoGroupConfigurationDetail": { @@ -472,7 +478,7 @@ } }, "traits": { - "smithy.api#documentation": "

A list of user groups and entities from an Amazon Cognito user pool identity\n source.

\n

This data type is part of an CognitoUserPoolConfigurationDetail structure and is a response parameter to\n GetIdentitySource.

" + "smithy.api#documentation": "

The type of entity that a policy store maps to groups from an Amazon Cognito user \n pool identity source.

\n

This data type is part of an CognitoUserPoolConfigurationDetail structure and is a response parameter to\n GetIdentitySource.

" } }, "com.amazonaws.verifiedpermissions#CognitoGroupConfigurationItem": { @@ -486,7 +492,7 @@ } }, "traits": { - "smithy.api#documentation": "

A list of user groups and entities from an Amazon Cognito user pool identity\n source.

\n

This data type is part of an CognitoUserPoolConfigurationItem structure and is a response parameter to\n ListIdentitySources.

" + "smithy.api#documentation": "

The type of entity that a policy store maps to groups from an Amazon Cognito user \n pool identity source.

\n

This data type is part of an CognitoUserPoolConfigurationItem structure and is a response parameter to\n ListIdentitySources.

" } }, "com.amazonaws.verifiedpermissions#CognitoUserPoolConfiguration": { @@ -508,12 +514,12 @@ "groupConfiguration": { "target": "com.amazonaws.verifiedpermissions#CognitoGroupConfiguration", "traits": { - "smithy.api#documentation": "

The configuration of the user groups from an Amazon Cognito user pool identity\n source.

" + "smithy.api#documentation": "

The type of entity that a policy store maps to groups from an Amazon Cognito user \n pool identity source.

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

The configuration for an identity source that represents a connection to an Amazon Cognito user pool used\n as an identity provider for Verified Permissions.

\n

This data type is used as a field that is part of an Configuration structure that is\n used as a parameter to CreateIdentitySource.

\n

Example:\"CognitoUserPoolConfiguration\":{\"UserPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"ClientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"]}\n

" + "smithy.api#documentation": "

The configuration for an identity source that represents a connection to an Amazon Cognito user pool used\n as an identity provider for Verified Permissions.

\n

This data type is used as a field that is part of an Configuration structure that is\n used as a parameter to CreateIdentitySource.

\n

Example:\"CognitoUserPoolConfiguration\":{\"UserPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"ClientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"],\"groupConfiguration\": {\"groupEntityType\": \"MyCorp::Group\"}}\n

" } }, "com.amazonaws.verifiedpermissions#CognitoUserPoolConfigurationDetail": { @@ -543,12 +549,12 @@ "groupConfiguration": { "target": "com.amazonaws.verifiedpermissions#CognitoGroupConfigurationDetail", "traits": { - "smithy.api#documentation": "

The configuration of the user groups from an Amazon Cognito user pool identity\n source.

" + "smithy.api#documentation": "

The type of entity that a policy store maps to groups from an Amazon Cognito user \n pool identity source.

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

The configuration for an identity source that represents a connection to an Amazon Cognito user pool used\n as an identity provider for Verified Permissions.

\n

This data type is used as a field that is part of an ConfigurationDetail structure that is\n part of the response to GetIdentitySource.

\n

Example:\"CognitoUserPoolConfiguration\":{\"UserPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"ClientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"]}\n

" + "smithy.api#documentation": "

The configuration for an identity source that represents a connection to an Amazon Cognito user pool used\n as an identity provider for Verified Permissions.

\n

This data type is used as a field that is part of an ConfigurationDetail structure that is\n part of the response to GetIdentitySource.

\n

Example:\"CognitoUserPoolConfiguration\":{\"UserPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"ClientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"],\"groupConfiguration\": {\"groupEntityType\": \"MyCorp::Group\"}}\n

" } }, "com.amazonaws.verifiedpermissions#CognitoUserPoolConfigurationItem": { @@ -578,12 +584,12 @@ "groupConfiguration": { "target": "com.amazonaws.verifiedpermissions#CognitoGroupConfigurationItem", "traits": { - "smithy.api#documentation": "

The configuration of the user groups from an Amazon Cognito user pool identity\n source.

" + "smithy.api#documentation": "

The type of entity that a policy store maps to groups from an Amazon Cognito user \n pool identity source.

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

The configuration for an identity source that represents a connection to an Amazon Cognito user pool used\n as an identity provider for Verified Permissions.

\n

This data type is used as a field that is part of the ConfigurationItem structure that is\n part of the response to ListIdentitySources.

\n

Example:\"CognitoUserPoolConfiguration\":{\"UserPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"ClientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"]}\n

" + "smithy.api#documentation": "

The configuration for an identity source that represents a connection to an Amazon Cognito user pool used\n as an identity provider for Verified Permissions.

\n

This data type is used as a field that is part of the ConfigurationItem structure that is\n part of the response to ListIdentitySources.

\n

Example:\"CognitoUserPoolConfiguration\":{\"UserPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"ClientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"],\"groupConfiguration\": {\"groupEntityType\": \"MyCorp::Group\"}}\n

" } }, "com.amazonaws.verifiedpermissions#Configuration": { @@ -597,7 +603,7 @@ } }, "traits": { - "smithy.api#documentation": "

Contains configuration information used when creating a new identity source.

\n \n

At this time, the only valid member of this structure is a Amazon Cognito user pool\n configuration.

\n

You must specify a userPoolArn, and optionally, a\n ClientId.

\n
\n

This data type is used as a request parameter for the CreateIdentitySource\n operation.

" + "smithy.api#documentation": "

Contains configuration information used when creating a new identity source.

\n \n

At this time, the only valid member of this structure is a Amazon Cognito user pool\n configuration.

\n

Specifies a userPoolArn, a groupConfiguration, and a\n ClientId.

\n
\n

This data type is used as a request parameter for the CreateIdentitySource\n operation.

" } }, "com.amazonaws.verifiedpermissions#ConfigurationDetail": { @@ -606,7 +612,7 @@ "cognitoUserPoolConfiguration": { "target": "com.amazonaws.verifiedpermissions#CognitoUserPoolConfigurationDetail", "traits": { - "smithy.api#documentation": "

Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of\n authenticated identities as entities. It specifies the Amazon Resource Name (ARN) of a Amazon Cognito user pool\n and one or more application client IDs.

\n

Example:\n \"configuration\":{\"cognitoUserPoolConfiguration\":{\"userPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"clientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"],\"groupConfiguration\": {\"groupEntityType\": \"MyCorp::Group\"}}}\n

" + "smithy.api#documentation": "

Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of\n authenticated identities as entities. It specifies the Amazon Resource Name (ARN) of a Amazon Cognito user pool,\n the policy store entity that you want to assign to user groups,\n and one or more application client IDs.

\n

Example:\n \"configuration\":{\"cognitoUserPoolConfiguration\":{\"userPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"clientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"],\"groupConfiguration\": {\"groupEntityType\": \"MyCorp::Group\"}}}\n

" } } }, @@ -620,7 +626,7 @@ "cognitoUserPoolConfiguration": { "target": "com.amazonaws.verifiedpermissions#CognitoUserPoolConfigurationItem", "traits": { - "smithy.api#documentation": "

Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of\n authenticated identities as entities. It specifies the Amazon Resource Name (ARN) of a Amazon Cognito user pool\n and one or more application client IDs.

\n

Example:\n \"configuration\":{\"cognitoUserPoolConfiguration\":{\"userPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"clientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"],\"groupConfiguration\": {\"groupEntityType\": \"MyCorp::Group\"}}}\n

" + "smithy.api#documentation": "

Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of\n authenticated identities as entities. It specifies the Amazon Resource Name (ARN) of a Amazon Cognito user pool,\n the policy store entity that you want to assign to user groups,\n and one or more application client IDs.

\n

Example:\n \"configuration\":{\"cognitoUserPoolConfiguration\":{\"userPoolArn\":\"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5\",\"clientIds\":\n [\"a1b2c3d4e5f6g7h8i9j0kalbmc\"],\"groupConfiguration\": {\"groupEntityType\": \"MyCorp::Group\"}}}\n

" } } }, @@ -864,6 +870,12 @@ "smithy.api#documentation": "

The resource specified in the new policy's scope. This response element isn't present\n when the resource isn't specified in the policy content.

" } }, + "actions": { + "target": "com.amazonaws.verifiedpermissions#ActionIdentifierList", + "traits": { + "smithy.api#documentation": "

The action that a policy permits or forbids. For example, \n{\"actions\": [{\"actionId\": \"ViewPhoto\", \"actionType\": \"PhotoFlash::Action\"}, {\"entityID\": \"SharePhoto\", \n\"entityType\": \"PhotoFlash::Action\"}]}.

" + } + }, "createdDate": { "target": "com.amazonaws.verifiedpermissions#TimestampFormat", "traits": { @@ -877,6 +889,12 @@ "smithy.api#documentation": "

The date and time the policy was last updated.

", "smithy.api#required": {} } + }, + "effect": { + "target": "com.amazonaws.verifiedpermissions#PolicyEffect", + "traits": { + "smithy.api#documentation": "

The effect of the decision that a policy returns to an authorization \nrequest. For example, \"effect\": \"Permit\".

" + } } }, "traits": { @@ -1646,6 +1664,13 @@ "smithy.api#documentation": "

The resource specified in the policy's scope. This element isn't included in the\n response when Resource isn't present in the policy content.

" } }, + "actions": { + "target": "com.amazonaws.verifiedpermissions#ActionIdentifierList", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "

The action that a policy permits or forbids. For example, \n{\"actions\": [{\"actionId\": \"ViewPhoto\", \"actionType\": \"PhotoFlash::Action\"}, {\"entityID\": \"SharePhoto\", \n\"entityType\": \"PhotoFlash::Action\"}]}.

" + } + }, "definition": { "target": "com.amazonaws.verifiedpermissions#PolicyDefinitionDetail", "traits": { @@ -1669,6 +1694,13 @@ "smithy.api#documentation": "

The date and time that the policy was last updated.

", "smithy.api#required": {} } + }, + "effect": { + "target": "com.amazonaws.verifiedpermissions#PolicyEffect", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "

The effect of the decision that a policy returns to an authorization \nrequest. For example, \"effect\": \"Permit\".

" + } } }, "traits": { @@ -2455,7 +2487,7 @@ "maxResults": { "target": "com.amazonaws.verifiedpermissions#ListIdentitySourcesMaxResults", "traits": { - "smithy.api#documentation": "

Specifies the total number of results that you want included in each\n response. If additional items exist beyond the number you specify, the \n NextToken response element is returned with a value (not null). Include the\n specified value as the NextToken request parameter in the next call to the\n operation to get the next set of results. Note that the service might return fewer\n results than the maximum even when there are more results available. You should check \n NextToken after every operation to ensure that you receive all of the\n results.

\n

If you do not specify this parameter, the operation defaults to 10 identity sources per response.\n You can specify a maximum of 200 identity sources per response.

" + "smithy.api#documentation": "

Specifies the total number of results that you want included in each\n response. If additional items exist beyond the number you specify, the \n NextToken response element is returned with a value (not null). Include the\n specified value as the NextToken request parameter in the next call to the\n operation to get the next set of results. Note that the service might return fewer\n results than the maximum even when there are more results available. You should check \n NextToken after every operation to ensure that you receive all of the\n results.

\n

If you do not specify this parameter, the operation defaults to 10 identity sources per response.\n You can specify a maximum of 50 identity sources per response.

" } }, "filters": { @@ -2871,6 +2903,23 @@ "smithy.api#documentation": "

A structure that describes a PolicyDefinintion. It will\n always have either an StaticPolicy or a TemplateLinkedPolicy\n element.

\n

This data type is used as a response parameter for the CreatePolicy and ListPolicies\n operations.

" } }, + "com.amazonaws.verifiedpermissions#PolicyEffect": { + "type": "enum", + "members": { + "PERMIT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Permit" + } + }, + "FORBID": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Forbid" + } + } + } + }, "com.amazonaws.verifiedpermissions#PolicyFilter": { "type": "structure", "members": { @@ -2949,6 +2998,12 @@ "smithy.api#documentation": "

The resource associated with the policy.

" } }, + "actions": { + "target": "com.amazonaws.verifiedpermissions#ActionIdentifierList", + "traits": { + "smithy.api#documentation": "

The action that a policy permits or forbids. For example, \n{\"actions\": [{\"actionId\": \"ViewPhoto\", \"actionType\": \"PhotoFlash::Action\"}, {\"entityID\": \"SharePhoto\", \n\"entityType\": \"PhotoFlash::Action\"}]}.

" + } + }, "definition": { "target": "com.amazonaws.verifiedpermissions#PolicyDefinitionItem", "traits": { @@ -2969,6 +3024,12 @@ "smithy.api#documentation": "

The date and time the policy was most recently updated.

", "smithy.api#required": {} } + }, + "effect": { + "target": "com.amazonaws.verifiedpermissions#PolicyEffect", + "traits": { + "smithy.api#documentation": "

The effect of the decision that a policy returns to an authorization \nrequest. For example, \"effect\": \"Permit\".

" + } } }, "traits": { @@ -3731,7 +3792,7 @@ } }, "traits": { - "smithy.api#documentation": "

A list of user groups and entities from an Amazon Cognito user pool identity\n source.

" + "smithy.api#documentation": "

The user group entities from an Amazon Cognito user pool identity\n source.

" } }, "com.amazonaws.verifiedpermissions#UpdateCognitoUserPoolConfiguration": { @@ -3978,6 +4039,12 @@ "smithy.api#documentation": "

The resource specified in the policy's scope. This element isn't included in the\n response when Resource isn't present in the policy content.

" } }, + "actions": { + "target": "com.amazonaws.verifiedpermissions#ActionIdentifierList", + "traits": { + "smithy.api#documentation": "

The action that a policy permits or forbids. For example, \n{\"actions\": [{\"actionId\": \"ViewPhoto\", \"actionType\": \"PhotoFlash::Action\"}, {\"entityID\": \"SharePhoto\", \n\"entityType\": \"PhotoFlash::Action\"}]}.

" + } + }, "createdDate": { "target": "com.amazonaws.verifiedpermissions#TimestampFormat", "traits": { @@ -3991,6 +4058,12 @@ "smithy.api#documentation": "

The date and time that the policy was most recently updated.

", "smithy.api#required": {} } + }, + "effect": { + "target": "com.amazonaws.verifiedpermissions#PolicyEffect", + "traits": { + "smithy.api#documentation": "

The effect of the decision that a policy returns to an authorization \nrequest. For example, \"effect\": \"Permit\".

" + } } }, "traits": { diff --git a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json index 0ab534e598d..3d786039e43 100644 --- a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json +++ b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json @@ -136,7 +136,12 @@ "tags" : [ "fips" ] } ] }, - "ca-west-1" : { }, + "ca-west-1" : { + "variants" : [ { + "hostname" : "access-analyzer-fips.ca-west-1.amazonaws.com", + "tags" : [ "fips" ] + } ] + }, "eu-central-1" : { }, "eu-central-2" : { }, "eu-north-1" : { }, @@ -152,6 +157,13 @@ "deprecated" : true, "hostname" : "access-analyzer-fips.ca-central-1.amazonaws.com" }, + "fips-ca-west-1" : { + "credentialScope" : { + "region" : "ca-west-1" + }, + "deprecated" : true, + "hostname" : "access-analyzer-fips.ca-west-1.amazonaws.com" + }, "fips-us-east-1" : { "credentialScope" : { "region" : "us-east-1" @@ -536,6 +548,7 @@ "ap-southeast-2" : { }, "eu-central-1" : { }, "eu-west-1" : { }, + "eu-west-3" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-2" : { } @@ -24137,14 +24150,62 @@ }, "emr-containers" : { "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } + "fips-us-gov-east-1" : { + "credentialScope" : { + "region" : "us-gov-east-1" + }, + "deprecated" : true, + "hostname" : "emr-containers.us-gov-east-1.amazonaws.com" + }, + "fips-us-gov-west-1" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "deprecated" : true, + "hostname" : "emr-containers.us-gov-west-1.amazonaws.com" + }, + "us-gov-east-1" : { + "variants" : [ { + "hostname" : "emr-containers.us-gov-east-1.amazonaws.com", + "tags" : [ "fips" ] + } ] + }, + "us-gov-west-1" : { + "variants" : [ { + "hostname" : "emr-containers.us-gov-west-1.amazonaws.com", + "tags" : [ "fips" ] + } ] + } } }, "emr-serverless" : { "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } + "fips-us-gov-east-1" : { + "credentialScope" : { + "region" : "us-gov-east-1" + }, + "deprecated" : true, + "hostname" : "emr-serverless.us-gov-east-1.amazonaws.com" + }, + "fips-us-gov-west-1" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "deprecated" : true, + "hostname" : "emr-serverless.us-gov-west-1.amazonaws.com" + }, + "us-gov-east-1" : { + "variants" : [ { + "hostname" : "emr-serverless.us-gov-east-1.amazonaws.com", + "tags" : [ "fips" ] + } ] + }, + "us-gov-west-1" : { + "variants" : [ { + "hostname" : "emr-serverless.us-gov-west-1.amazonaws.com", + "tags" : [ "fips" ] + } ] + } } }, "es" : { diff --git a/service/accessanalyzer/CHANGELOG.md b/service/accessanalyzer/CHANGELOG.md index 1ee4be3bea9..41de26d188f 100644 --- a/service/accessanalyzer/CHANGELOG.md +++ b/service/accessanalyzer/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.29.3 (2024-05-09) + +* No change notes available for this release. + # v1.29.2 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/accessanalyzer/go_module_metadata.go b/service/accessanalyzer/go_module_metadata.go index a6ca6f0408f..4cb8c789597 100644 --- a/service/accessanalyzer/go_module_metadata.go +++ b/service/accessanalyzer/go_module_metadata.go @@ -3,4 +3,4 @@ package accessanalyzer // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.29.2" +const goModuleVersion = "1.29.3" diff --git a/service/accessanalyzer/internal/endpoints/endpoints.go b/service/accessanalyzer/internal/endpoints/endpoints.go index ba696db0237..559a6135bcd 100644 --- a/service/accessanalyzer/internal/endpoints/endpoints.go +++ b/service/accessanalyzer/internal/endpoints/endpoints.go @@ -184,6 +184,12 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ca-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "access-analyzer-fips.ca-west-1.amazonaws.com", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, @@ -217,6 +223,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-ca-west-1", + }: endpoints.Endpoint{ + Hostname: "access-analyzer-fips.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ diff --git a/service/bedrockagentruntime/CHANGELOG.md b/service/bedrockagentruntime/CHANGELOG.md index 41c116aa6fd..d7391588bf9 100644 --- a/service/bedrockagentruntime/CHANGELOG.md +++ b/service/bedrockagentruntime/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.9.0 (2024-05-09) + +* **Feature**: This release adds support to provide guardrail configuration and modify inference parameters that are then used in RetrieveAndGenerate API in Agents for Amazon Bedrock. + # v1.8.1 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/bedrockagentruntime/api_op_InvokeAgent.go b/service/bedrockagentruntime/api_op_InvokeAgent.go index d4228f73e77..4e28e3faa8d 100644 --- a/service/bedrockagentruntime/api_op_InvokeAgent.go +++ b/service/bedrockagentruntime/api_op_InvokeAgent.go @@ -12,11 +12,11 @@ import ( "sync" ) -// Sends a prompt for the agent to process and respond to. Use return control -// event type for function calling. -// // The CLI doesn't support InvokeAgent . // +// Sends a prompt for the agent to process and respond to. Note the following +// fields for the request: +// // - To continue the same conversation with an agent, use the same sessionId // value in the request. // @@ -28,9 +28,8 @@ import ( // - End a conversation by setting endSession to true . // // - In the sessionState object, you can include attributes for the session or -// prompt or parameters returned from the action group. -// -// - Use return control event type for function calling. +// prompt or, if you configured an action group to return control, results from +// invocation of the action group. // // The response is returned in the bytes field of the chunk object. // @@ -39,6 +38,10 @@ import ( // - If you set enableTrace to true in the request, you can trace the agent's // steps and reasoning process that led it to the response. // +// - If the action predicted was configured to return control, the response +// returns parameters for the action, elicited from the user, in the +// returnControl field. +// // - Errors are also surfaced in the response. // // [Trace enablement]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events @@ -85,11 +88,17 @@ type InvokeAgentInput struct { EndSession *bool // The prompt text to send the agent. + // + // If you include returnControlInvocationResults in the sessionState field, the + // inputText field will be ignored. InputText *string // Contains parameters that specify various attributes of the session. For more // information, see [Control session context]. // + // If you include returnControlInvocationResults in the sessionState field, the + // inputText field will be ignored. + // // [Control session context]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html SessionState *types.SessionState diff --git a/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go b/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go index 69948b925e7..02022ab675e 100644 --- a/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go +++ b/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go @@ -68,6 +68,9 @@ type RetrieveAndGenerateOutput struct { // knowledge base, alongside information about the sources. Citations []types.Citation + // Specifies if there is a guardrail intervention in the response. + GuardrailAction types.GuadrailAction + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/bedrockagentruntime/deserializers.go b/service/bedrockagentruntime/deserializers.go index 87fba7356d2..1a154e93cd8 100644 --- a/service/bedrockagentruntime/deserializers.go +++ b/service/bedrockagentruntime/deserializers.go @@ -496,6 +496,15 @@ func awsRestjson1_deserializeOpDocumentRetrieveAndGenerateOutput(v **RetrieveAnd return err } + case "guardrailAction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuadrailAction to be of type string, got %T instead", value) + } + sv.GuardrailAction = types.GuadrailAction(jtv) + } + case "output": if err := awsRestjson1_deserializeDocumentRetrieveAndGenerateOutput(&sv.Output, value); err != nil { return err diff --git a/service/bedrockagentruntime/go_module_metadata.go b/service/bedrockagentruntime/go_module_metadata.go index 088dae29b79..12dcdbfff5d 100644 --- a/service/bedrockagentruntime/go_module_metadata.go +++ b/service/bedrockagentruntime/go_module_metadata.go @@ -3,4 +3,4 @@ package bedrockagentruntime // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.8.1" +const goModuleVersion = "1.9.0" diff --git a/service/bedrockagentruntime/serializers.go b/service/bedrockagentruntime/serializers.go index 7d5577e4e03..69737135bd3 100644 --- a/service/bedrockagentruntime/serializers.go +++ b/service/bedrockagentruntime/serializers.go @@ -14,6 +14,7 @@ import ( smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "math" ) type awsRestjson1_serializeOpInvokeAgent struct { @@ -337,6 +338,37 @@ func awsRestjson1_serializeOpDocumentRetrieveAndGenerateInput(v *RetrieveAndGene return nil } +func awsRestjson1_serializeDocumentAdditionalModelRequestFields(v map[string]document.Interface, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentAdditionalModelRequestFieldsValue(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAdditionalModelRequestFieldsValue(v document.Interface, value smithyjson.Value) error { + if v == nil { + return nil + } + if !internaldocument.IsInterface(v) { + return fmt.Errorf("%T is not a compatible document type", v) + } + db, err := v.MarshalSmithyDocument() + if err != nil { + return err + } + value.Write(db) + return nil +} + func awsRestjson1_serializeDocumentApiResult(v *types.ApiResult, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -453,6 +485,27 @@ func awsRestjson1_serializeDocumentExternalSourcesGenerationConfiguration(v *typ object := value.Object() defer object.Close() + if v.AdditionalModelRequestFields != nil { + ok := object.Key("additionalModelRequestFields") + if err := awsRestjson1_serializeDocumentAdditionalModelRequestFields(v.AdditionalModelRequestFields, ok); err != nil { + return err + } + } + + if v.GuardrailConfiguration != nil { + ok := object.Key("guardrailConfiguration") + if err := awsRestjson1_serializeDocumentGuardrailConfiguration(v.GuardrailConfiguration, ok); err != nil { + return err + } + } + + if v.InferenceConfig != nil { + ok := object.Key("inferenceConfig") + if err := awsRestjson1_serializeDocumentInferenceConfig(v.InferenceConfig, ok); err != nil { + return err + } + } + if v.PromptTemplate != nil { ok := object.Key("promptTemplate") if err := awsRestjson1_serializeDocumentPromptTemplate(v.PromptTemplate, ok); err != nil { @@ -556,6 +609,27 @@ func awsRestjson1_serializeDocumentGenerationConfiguration(v *types.GenerationCo object := value.Object() defer object.Close() + if v.AdditionalModelRequestFields != nil { + ok := object.Key("additionalModelRequestFields") + if err := awsRestjson1_serializeDocumentAdditionalModelRequestFields(v.AdditionalModelRequestFields, ok); err != nil { + return err + } + } + + if v.GuardrailConfiguration != nil { + ok := object.Key("guardrailConfiguration") + if err := awsRestjson1_serializeDocumentGuardrailConfiguration(v.GuardrailConfiguration, ok); err != nil { + return err + } + } + + if v.InferenceConfig != nil { + ok := object.Key("inferenceConfig") + if err := awsRestjson1_serializeDocumentInferenceConfig(v.InferenceConfig, ok); err != nil { + return err + } + } + if v.PromptTemplate != nil { ok := object.Key("promptTemplate") if err := awsRestjson1_serializeDocumentPromptTemplate(v.PromptTemplate, ok); err != nil { @@ -566,6 +640,37 @@ func awsRestjson1_serializeDocumentGenerationConfiguration(v *types.GenerationCo return nil } +func awsRestjson1_serializeDocumentGuardrailConfiguration(v *types.GuardrailConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GuardrailId != nil { + ok := object.Key("guardrailId") + ok.String(*v.GuardrailId) + } + + if v.GuardrailVersion != nil { + ok := object.Key("guardrailVersion") + ok.String(*v.GuardrailVersion) + } + + return nil +} + +func awsRestjson1_serializeDocumentInferenceConfig(v *types.InferenceConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TextInferenceConfig != nil { + ok := object.Key("textInferenceConfig") + if err := awsRestjson1_serializeDocumentTextInferenceConfig(v.TextInferenceConfig, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentInvocationResultMember(v types.InvocationResultMember, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -694,6 +799,17 @@ func awsRestjson1_serializeDocumentPromptTemplate(v *types.PromptTemplate, value return nil } +func awsRestjson1_serializeDocumentRAGStopSequences(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsRestjson1_serializeDocumentResponseBody(v map[string]types.ContentBody, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -923,3 +1039,58 @@ func awsRestjson1_serializeDocumentSessionState(v *types.SessionState, value smi return nil } + +func awsRestjson1_serializeDocumentTextInferenceConfig(v *types.TextInferenceConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxTokens != nil { + ok := object.Key("maxTokens") + ok.Integer(*v.MaxTokens) + } + + if v.StopSequences != nil { + ok := object.Key("stopSequences") + if err := awsRestjson1_serializeDocumentRAGStopSequences(v.StopSequences, ok); err != nil { + return err + } + } + + if v.Temperature != nil { + ok := object.Key("temperature") + switch { + case math.IsNaN(float64(*v.Temperature)): + ok.String("NaN") + + case math.IsInf(float64(*v.Temperature), 1): + ok.String("Infinity") + + case math.IsInf(float64(*v.Temperature), -1): + ok.String("-Infinity") + + default: + ok.Float(*v.Temperature) + + } + } + + if v.TopP != nil { + ok := object.Key("topP") + switch { + case math.IsNaN(float64(*v.TopP)): + ok.String("NaN") + + case math.IsInf(float64(*v.TopP), 1): + ok.String("Infinity") + + case math.IsInf(float64(*v.TopP), -1): + ok.String("-Infinity") + + default: + ok.Float(*v.TopP) + + } + } + + return nil +} diff --git a/service/bedrockagentruntime/types/enums.go b/service/bedrockagentruntime/types/enums.go index 62b3e5d1174..e55cc82430c 100644 --- a/service/bedrockagentruntime/types/enums.go +++ b/service/bedrockagentruntime/types/enums.go @@ -40,6 +40,25 @@ func (ExternalSourceType) Values() []ExternalSourceType { } } +type GuadrailAction string + +// Enum values for GuadrailAction +const ( + GuadrailActionIntervened GuadrailAction = "INTERVENED" + GuadrailActionNone GuadrailAction = "NONE" +) + +// Values returns all known values for GuadrailAction. 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 (GuadrailAction) Values() []GuadrailAction { + return []GuadrailAction{ + "INTERVENED", + "NONE", + } +} + type InvocationType string // Enum values for InvocationType diff --git a/service/bedrockagentruntime/types/types.go b/service/bedrockagentruntime/types/types.go index 0e26429e985..74a5ed69b66 100644 --- a/service/bedrockagentruntime/types/types.go +++ b/service/bedrockagentruntime/types/types.go @@ -50,9 +50,9 @@ type ActionGroupInvocationOutput struct { // // This data type is used in the following API operations: // -// - In the returnControl field of the [Retrieve response] +// - In the returnControl field of the [InvokeAgent response] // -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type ApiInvocationInput struct { // The action group that the API operation belongs to. @@ -81,9 +81,9 @@ type ApiInvocationInput struct { // // This data type is used in the following API operations: // -// [Retrieve response] +// [InvokeAgent response] // -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type ApiParameter struct { // The name of the parameter. @@ -103,9 +103,9 @@ type ApiParameter struct { // // This data type is used in the following API operations: // -// [Retrieve response] +// [InvokeAgent response] // -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type ApiRequestBody struct { // The content of the request body. The key of the object in this field is a media @@ -120,9 +120,9 @@ type ApiRequestBody struct { // // This data type is used in the following API operations: // -// - In the returnControlInvocationResults of the [Retrieve request] +// - In the returnControlInvocationResults of the [InvokeAgent request] // -// [Retrieve request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax +// [InvokeAgent request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax type ApiResult struct { // The action group that the API operation belongs to. @@ -140,7 +140,8 @@ type ApiResult struct { HttpStatusCode *int32 // The response body from the API operation. The key of the object is the content - // type. The response may be returned directly or from the Lambda function. + // type (currently, only TEXT is supported). The response may be returned directly + // or from the Lambda function. ResponseBody map[string]ContentBody // Controls the final response state returned to end user when API/Function @@ -187,14 +188,14 @@ type ByteContentDoc struct { // // This data type is used in the following API operations: // -// [Retrieve response] +// [InvokeAgent response] // - – in the citations field // // [RetrieveAndGenerate response] // - – in the citations field // // [RetrieveAndGenerate response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type Citation struct { // Contains the generated response and metadata @@ -210,9 +211,9 @@ type Citation struct { // // This data type is used in the following API operations: // -// - In the returnControlInvocationResults field of the [Retrieve request] +// - In the returnControlInvocationResults field of the [InvokeAgent request] // -// [Retrieve request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax +// [InvokeAgent request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax type ContentBody struct { // The body of the API response. @@ -241,6 +242,18 @@ type ExternalSource struct { // Contains the generation configuration of the external source wrapper object. type ExternalSourcesGenerationConfiguration struct { + // Additional model parameters and their corresponding values not included in the + // textInferenceConfig structure for an external source. Takes in custom model + // parameters specific to the language model being used. + AdditionalModelRequestFields map[string]document.Interface + + // The configuration details for the guardrail. + GuardrailConfiguration *GuardrailConfiguration + + // Configuration settings for inference when using RetrieveAndGenerate to + // generate responses while using an external source. + InferenceConfig *InferenceConfig + // Contain the textPromptTemplate string for the external source wrapper object. PromptTemplate *PromptTemplate @@ -321,9 +334,9 @@ type FinalResponse struct { // // This data type is used in the following API operations: // -// - In the returnControl field of the [Retrieve response] +// - In the returnControl field of the [InvokeAgent response] // -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type FunctionInvocationInput struct { // The action group that the function belongs to. @@ -344,9 +357,9 @@ type FunctionInvocationInput struct { // // This data type is used in the following API operations: // -// - In the returnControl field of the [Retrieve response] +// - In the returnControl field of the [InvokeAgent response] // -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type FunctionParameter struct { // The name of the parameter. @@ -366,9 +379,9 @@ type FunctionParameter struct { // // This data type is used in the following API operations: // -// - In the returnControlInvocationResults of the [Retrieve request] +// - In the returnControlInvocationResults of the [InvokeAgent request] // -// [Retrieve request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax +// [InvokeAgent request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax type FunctionResult struct { // The action group that the function belongs to. @@ -379,7 +392,8 @@ type FunctionResult struct { // The name of the function that was called. Function *string - // The response from the function call using the parameters. The response may be + // The response from the function call using the parameters. The key of the object + // is the content type (currently, only TEXT is supported). The response may be // returned directly or from the Lambda function. ResponseBody map[string]ContentBody @@ -397,14 +411,14 @@ type FunctionResult struct { // // This data type is used in the following API operations: // -// [Retrieve response] +// [InvokeAgent response] // - – in the generatedResponsePart field // // [RetrieveAndGenerate response] // - – in the generatedResponsePart field // // [RetrieveAndGenerate response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type GeneratedResponsePart struct { // Contains metadata about a textual part of the generated response that is @@ -424,6 +438,18 @@ type GeneratedResponsePart struct { // [RetrieveAndGenerate request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax type GenerationConfiguration struct { + // Additional model parameters and corresponding values not included in the + // textInferenceConfig structure for a knowledge base. This allows users to provide + // custom model parameters specific to the language model being used. + AdditionalModelRequestFields map[string]document.Interface + + // The configuration details for the guardrail. + GuardrailConfiguration *GuardrailConfiguration + + // Configuration settings for inference when using RetrieveAndGenerate to + // generate responses while using a knowledge base as a source. + InferenceConfig *InferenceConfig + // Contains the template for the prompt that's sent to the model for response // generation. PromptTemplate *PromptTemplate @@ -431,6 +457,34 @@ type GenerationConfiguration struct { noSmithyDocumentSerde } +// The configuration details for the guardrail. +type GuardrailConfiguration struct { + + // The unique identifier for the guardrail. + // + // This member is required. + GuardrailId *string + + // The version of the guardrail. + // + // This member is required. + GuardrailVersion *string + + noSmithyDocumentSerde +} + +// The configuration for inference settings when generating responses using +// +// RetrieveAndGenerate. +type InferenceConfig struct { + + // Configuration settings specific to text generation while generating responses + // using RetrieveAndGenerate. + TextInferenceConfig *TextInferenceConfig + + noSmithyDocumentSerde +} + // Specifications about the inference parameters that were provided alongside the // prompt. These are specified in the [PromptOverrideConfiguration]object that was set when the agent was // created or updated. For more information, see [Inference parameters for foundation models]. @@ -494,14 +548,14 @@ type InvocationInput struct { // // This data type is used in the following API operations: // -// - In the returnControl field of the [Retrieve response] +// - In the returnControl field of the [InvokeAgent response] // // The following types satisfy this interface: // // InvocationInputMemberMemberApiInvocationInput // InvocationInputMemberMemberFunctionInvocationInput // -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type InvocationInputMember interface { isInvocationInputMember() } @@ -526,18 +580,20 @@ type InvocationInputMemberMemberFunctionInvocationInput struct { func (*InvocationInputMemberMemberFunctionInvocationInput) isInvocationInputMember() {} -// A result from the action group invocation. +// A result from the invocation of an action. For more information, see [Return control to the agent developer] and [Control session context]. // // This data type is used in the following API operations: // -// [Retrieve request] +// [InvokeAgent request] // // The following types satisfy this interface: // // InvocationResultMemberMemberApiResult // InvocationResultMemberMemberFunctionResult // -// [Retrieve request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax +// [InvokeAgent request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax +// [Return control to the agent developer]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html +// [Control session context]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html type InvocationResultMember interface { isInvocationResultMember() } @@ -1309,11 +1365,12 @@ func (*RetrievalFilterMemberStartsWith) isRetrievalFilter() {} // [RetrieveAndGenerate response] // - – in the content field // -// [Retrieve response] +// [InvokeAgent response] // - – in the content field // // [RetrieveAndGenerate response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax // [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type RetrievalResultContent struct { // The cited text from the data source. @@ -1334,11 +1391,12 @@ type RetrievalResultContent struct { // [RetrieveAndGenerate response] // - – in the location field // -// [Retrieve response] +// [InvokeAgent response] // - – in the locatino field // // [RetrieveAndGenerate response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax // [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type RetrievalResultLocation struct { // The type of the location of the data source. @@ -1362,11 +1420,12 @@ type RetrievalResultLocation struct { // [RetrieveAndGenerate response] // - – in the s3Location field // -// [Retrieve response] +// [InvokeAgent response] // - – in the s3Location field // // [RetrieveAndGenerate response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax // [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type RetrievalResultS3Location struct { // The S3 URI of the data source. @@ -1461,11 +1520,11 @@ type RetrieveAndGenerateSessionConfiguration struct { // [RetrieveAndGenerate response] // - – in the retrievedReferences field // -// [Retrieve response] +// [InvokeAgent response] // - – in the retrievedReferences field // // [RetrieveAndGenerate response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type RetrievedReference struct { // Contains the cited text from the data source. @@ -1488,9 +1547,9 @@ type RetrievedReference struct { // // This data type is used in the following API operations: // -// [Retrieve response] +// [InvokeAgent response] // -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type ReturnControlPayload struct { // The identifier of the action group invocation. @@ -1526,7 +1585,13 @@ type S3ObjectDoc struct { // [Lambda function]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html type SessionState struct { - // The identifier of the invocation. + // The identifier of the invocation of an action. This value must match the + // invocationId returned in the InvokeAgent response for the action whose results + // are provided in the returnControlInvocationResults field. For more information, + // see [Return control to the agent developer]and [Control session context]. + // + // [Return control to the agent developer]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html + // [Control session context]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html InvocationId *string // Contains attributes that persist across a prompt and the values of those @@ -1537,7 +1602,13 @@ type SessionState struct { // [Prompt template placeholder variables]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html PromptSessionAttributes map[string]string - // Contains information about the results from the action group invocation. + // Contains information about the results from the action group invocation. For + // more information, see [Return control to the agent developer]and [Control session context]. + // + // If you include this field, the inputText field will be ignored. + // + // [Return control to the agent developer]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html + // [Control session context]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html ReturnControlInvocationResults []InvocationResultMember // Contains attributes that persist across a session and the values of those @@ -1555,11 +1626,11 @@ type SessionState struct { // [RetrieveAndGenerate response] // - – in the span field // -// [Retrieve response] +// [InvokeAgent response] // - – in the span field // // [RetrieveAndGenerate response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type Span struct { // Where the text with a citation ends in the generated output. @@ -1571,6 +1642,44 @@ type Span struct { noSmithyDocumentSerde } +// Configuration settings for text generation using a language model via the +// RetrieveAndGenerate operation. Includes parameters like temperature, top-p, +// maximum token count, and stop sequences. +// +// The valid range of maxTokens depends on the accepted values for your chosen +// model's inference parameters. To see the inference parameters for your model, +// see [Inference parameters for foundation models.] +// +// [Inference parameters for foundation models.]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html +type TextInferenceConfig struct { + + // The maximum number of tokens to generate in the output text. Do not use the + // minimum of 0 or the maximum of 65536. The limit values described here are + // arbitary values, for actual values consult the limits defined by your specific + // model. + MaxTokens *int32 + + // A list of sequences of characters that, if generated, will cause the model to + // stop generating further tokens. Do not use a minimum length of 1 or a maximum + // length of 1000. The limit values described here are arbitary values, for actual + // values consult the limits defined by your specific model. + StopSequences []string + + // Controls the random-ness of text generated by the language model, influencing + // how much the model sticks to the most predictable next words versus exploring + // more surprising options. A lower temperature value (e.g. 0.2 or 0.3) makes model + // outputs more deterministic or predictable, while a higher temperature (e.g. 0.8 + // or 0.9) makes the outputs more creative or unpredictable. + Temperature *float32 + + // A probability distribution threshold which controls what the model considers + // for the set of possible next tokens. The model will only consider the top p% of + // the probability distribution when generating the next token. + TopP *float32 + + noSmithyDocumentSerde +} + // Contains the part of the generated text that contains a citation, alongside // where it begins and ends. // @@ -1579,11 +1688,11 @@ type Span struct { // [RetrieveAndGenerate response] // - – in the textResponsePart field // -// [Retrieve response] +// [InvokeAgent response] // - – in the textResponsePart field // // [RetrieveAndGenerate response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax -// [Retrieve response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax +// [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type TextResponsePart struct { // Contains information about where the text with a citation begins and ends in diff --git a/service/bedrockagentruntime/validators.go b/service/bedrockagentruntime/validators.go index d09eafda572..b7c44f64ee4 100644 --- a/service/bedrockagentruntime/validators.go +++ b/service/bedrockagentruntime/validators.go @@ -160,6 +160,23 @@ func validateExternalSources(v []types.ExternalSource) error { } } +func validateExternalSourcesGenerationConfiguration(v *types.ExternalSourcesGenerationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExternalSourcesGenerationConfiguration"} + if v.GuardrailConfiguration != nil { + if err := validateGuardrailConfiguration(v.GuardrailConfiguration); err != nil { + invalidParams.AddNested("GuardrailConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateExternalSourcesRetrieveAndGenerateConfiguration(v *types.ExternalSourcesRetrieveAndGenerateConfiguration) error { if v == nil { return nil @@ -175,6 +192,11 @@ func validateExternalSourcesRetrieveAndGenerateConfiguration(v *types.ExternalSo invalidParams.AddNested("Sources", err.(smithy.InvalidParamsError)) } } + if v.GenerationConfiguration != nil { + if err := validateExternalSourcesGenerationConfiguration(v.GenerationConfiguration); err != nil { + invalidParams.AddNested("GenerationConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -215,6 +237,41 @@ func validateFunctionResult(v *types.FunctionResult) error { } } +func validateGenerationConfiguration(v *types.GenerationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GenerationConfiguration"} + if v.GuardrailConfiguration != nil { + if err := validateGuardrailConfiguration(v.GuardrailConfiguration); err != nil { + invalidParams.AddNested("GuardrailConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGuardrailConfiguration(v *types.GuardrailConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GuardrailConfiguration"} + if v.GuardrailId == nil { + invalidParams.Add(smithy.NewErrParamRequired("GuardrailId")) + } + if v.GuardrailVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("GuardrailVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateInvocationResultMember(v types.InvocationResultMember) error { if v == nil { return nil @@ -289,6 +346,11 @@ func validateKnowledgeBaseRetrieveAndGenerateConfiguration(v *types.KnowledgeBas invalidParams.AddNested("RetrievalConfiguration", err.(smithy.InvalidParamsError)) } } + if v.GenerationConfiguration != nil { + if err := validateGenerationConfiguration(v.GenerationConfiguration); err != nil { + invalidParams.AddNested("GenerationConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/emrcontainers/CHANGELOG.md b/service/emrcontainers/CHANGELOG.md index ef656290a74..56ca96891aa 100644 --- a/service/emrcontainers/CHANGELOG.md +++ b/service/emrcontainers/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.28.2 (2024-05-09) + +* No change notes available for this release. + # v1.28.1 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/emrcontainers/go_module_metadata.go b/service/emrcontainers/go_module_metadata.go index 205d19c2aa6..ae769e52f94 100644 --- a/service/emrcontainers/go_module_metadata.go +++ b/service/emrcontainers/go_module_metadata.go @@ -3,4 +3,4 @@ package emrcontainers // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.28.1" +const goModuleVersion = "1.28.2" diff --git a/service/emrcontainers/internal/endpoints/endpoints.go b/service/emrcontainers/internal/endpoints/endpoints.go index ec1109a4e4b..5df9042b53e 100644 --- a/service/emrcontainers/internal/endpoints/endpoints.go +++ b/service/emrcontainers/internal/endpoints/endpoints.go @@ -450,12 +450,42 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "fips-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "emr-containers.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "emr-containers.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "emr-containers.us-gov-east-1.amazonaws.com", + }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "emr-containers.us-gov-west-1.amazonaws.com", + }, }, }, } diff --git a/service/emrserverless/CHANGELOG.md b/service/emrserverless/CHANGELOG.md index 1f2b396ca02..036637bef11 100644 --- a/service/emrserverless/CHANGELOG.md +++ b/service/emrserverless/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.19.2 (2024-05-09) + +* No change notes available for this release. + # v1.19.1 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/emrserverless/go_module_metadata.go b/service/emrserverless/go_module_metadata.go index 28eef366645..bdb231e3d75 100644 --- a/service/emrserverless/go_module_metadata.go +++ b/service/emrserverless/go_module_metadata.go @@ -3,4 +3,4 @@ package emrserverless // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.19.1" +const goModuleVersion = "1.19.2" diff --git a/service/emrserverless/internal/endpoints/endpoints.go b/service/emrserverless/internal/endpoints/endpoints.go index dec98a968c4..af6fd825186 100644 --- a/service/emrserverless/internal/endpoints/endpoints.go +++ b/service/emrserverless/internal/endpoints/endpoints.go @@ -450,12 +450,42 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "fips-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "emr-serverless.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "emr-serverless.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "emr-serverless.us-gov-east-1.amazonaws.com", + }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "emr-serverless.us-gov-west-1.amazonaws.com", + }, }, }, } diff --git a/service/internal/integrationtest/go.mod b/service/internal/integrationtest/go.mod index 72bbfb0b716..d1880ec994c 100644 --- a/service/internal/integrationtest/go.mod +++ b/service/internal/integrationtest/go.mod @@ -66,7 +66,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/rekognition v1.40.1 github.com/aws/aws-sdk-go-v2/service/route53 v1.40.5 github.com/aws/aws-sdk-go-v2/service/route53domains v1.23.5 - github.com/aws/aws-sdk-go-v2/service/route53resolver v1.28.1 + github.com/aws/aws-sdk-go-v2/service/route53resolver v1.28.2 github.com/aws/aws-sdk-go-v2/service/s3 v1.53.2 github.com/aws/aws-sdk-go-v2/service/s3control v1.44.7 github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.7 diff --git a/service/opensearchserverless/CHANGELOG.md b/service/opensearchserverless/CHANGELOG.md index cadd56c67f8..976e58784a8 100644 --- a/service/opensearchserverless/CHANGELOG.md +++ b/service/opensearchserverless/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.11.6 (2024-05-09) + +* No change notes available for this release. + # v1.11.5 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/opensearchserverless/go_module_metadata.go b/service/opensearchserverless/go_module_metadata.go index a3b69bf75eb..1e4569fe2dd 100644 --- a/service/opensearchserverless/go_module_metadata.go +++ b/service/opensearchserverless/go_module_metadata.go @@ -3,4 +3,4 @@ package opensearchserverless // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.11.5" +const goModuleVersion = "1.11.6" diff --git a/service/opensearchserverless/internal/endpoints/endpoints.go b/service/opensearchserverless/internal/endpoints/endpoints.go index 69c6559ee83..1857dcd5140 100644 --- a/service/opensearchserverless/internal/endpoints/endpoints.go +++ b/service/opensearchserverless/internal/endpoints/endpoints.go @@ -154,6 +154,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, diff --git a/service/pinpoint/CHANGELOG.md b/service/pinpoint/CHANGELOG.md index 311e1992202..e0c6f3e4ad0 100644 --- a/service/pinpoint/CHANGELOG.md +++ b/service/pinpoint/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.30.0 (2024-05-09) + +* **Feature**: This release adds support for specifying email message headers for Email Templates, Campaigns, Journeys and Send Messages. + # v1.29.1 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/pinpoint/deserializers.go b/service/pinpoint/deserializers.go index cdd094095e6..d31a3e66747 100644 --- a/service/pinpoint/deserializers.go +++ b/service/pinpoint/deserializers.go @@ -22267,6 +22267,11 @@ func awsRestjson1_deserializeDocumentCampaignEmailMessage(v **types.CampaignEmai sv.FromAddress = ptr.String(jtv) } + case "Headers": + if err := awsRestjson1_deserializeDocumentListOfMessageHeader(&sv.Headers, value); err != nil { + return err + } + case "HtmlBody": if value != nil { jtv, ok := value.(string) @@ -24053,6 +24058,11 @@ func awsRestjson1_deserializeDocumentEmailTemplateResponse(v **types.EmailTempla sv.DefaultSubstitutions = ptr.String(jtv) } + case "Headers": + if err := awsRestjson1_deserializeDocumentListOfMessageHeader(&sv.Headers, value); err != nil { + return err + } + case "HtmlPart": if value != nil { jtv, ok := value.(string) @@ -28505,6 +28515,40 @@ func awsRestjson1_deserializeDocumentListOfJourneyRunResponse(v *[]types.Journey return nil } +func awsRestjson1_deserializeDocumentListOfMessageHeader(v *[]types.MessageHeader, 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.MessageHeader + if *v == nil { + cv = []types.MessageHeader{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MessageHeader + destAddr := &col + if err := awsRestjson1_deserializeDocumentMessageHeader(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentListOfMultiConditionalBranch(v *[]types.MultiConditionalBranch, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -29813,6 +29857,55 @@ func awsRestjson1_deserializeDocumentMessageConfiguration(v **types.MessageConfi return nil } +func awsRestjson1_deserializeDocumentMessageHeader(v **types.MessageHeader, 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.MessageHeader + if *v == nil { + sv = &types.MessageHeader{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentMessageResponse(v **types.MessageResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/pinpoint/go_module_metadata.go b/service/pinpoint/go_module_metadata.go index adadf8fc292..2a63e81a3c9 100644 --- a/service/pinpoint/go_module_metadata.go +++ b/service/pinpoint/go_module_metadata.go @@ -3,4 +3,4 @@ package pinpoint // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.29.1" +const goModuleVersion = "1.30.0" diff --git a/service/pinpoint/serializers.go b/service/pinpoint/serializers.go index e14742cf1d1..fbdacc16900 100644 --- a/service/pinpoint/serializers.go +++ b/service/pinpoint/serializers.go @@ -10441,6 +10441,13 @@ func awsRestjson1_serializeDocumentCampaignEmailMessage(v *types.CampaignEmailMe ok.String(*v.FromAddress) } + if v.Headers != nil { + ok := object.Key("Headers") + if err := awsRestjson1_serializeDocumentListOfMessageHeader(v.Headers, ok); err != nil { + return err + } + } + if v.HtmlBody != nil { ok := object.Key("HtmlBody") ok.String(*v.HtmlBody) @@ -11183,6 +11190,13 @@ func awsRestjson1_serializeDocumentEmailTemplateRequest(v *types.EmailTemplateRe ok.String(*v.DefaultSubstitutions) } + if v.Headers != nil { + ok := object.Key("Headers") + if err := awsRestjson1_serializeDocumentListOfMessageHeader(v.Headers, ok); err != nil { + return err + } + } + if v.HtmlPart != nil { ok := object.Key("HtmlPart") ok.String(*v.HtmlPart) @@ -12432,6 +12446,19 @@ func awsRestjson1_serializeDocumentListOfInAppMessageContent(v []types.InAppMess return nil } +func awsRestjson1_serializeDocumentListOfMessageHeader(v []types.MessageHeader, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentMessageHeader(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentListOfMultiConditionalBranch(v []types.MultiConditionalBranch, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -12838,6 +12865,23 @@ func awsRestjson1_serializeDocumentMessageConfiguration(v *types.MessageConfigur return nil } +func awsRestjson1_serializeDocumentMessageHeader(v *types.MessageHeader, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + func awsRestjson1_serializeDocumentMessageRequest(v *types.MessageRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -13733,6 +13777,13 @@ func awsRestjson1_serializeDocumentSimpleEmail(v *types.SimpleEmail, value smith object := value.Object() defer object.Close() + if v.Headers != nil { + ok := object.Key("Headers") + if err := awsRestjson1_serializeDocumentListOfMessageHeader(v.Headers, ok); err != nil { + return err + } + } + if v.HtmlPart != nil { ok := object.Key("HtmlPart") if err := awsRestjson1_serializeDocumentSimpleEmailPart(v.HtmlPart, ok); err != nil { diff --git a/service/pinpoint/types/types.go b/service/pinpoint/types/types.go index 9989a7a6e92..3e6681d633c 100644 --- a/service/pinpoint/types/types.go +++ b/service/pinpoint/types/types.go @@ -1403,6 +1403,11 @@ type CampaignEmailMessage struct { // FromAddress specified for the email channel for the application. FromAddress *string + // The list of [MessageHeaders] for the email. You can have up to 15 MessageHeaders for each email. + // + // [MessageHeaders]: https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-campaigns-campaign-id.html#apps-application-id-campaigns-campaign-id-model-messageheader + Headers []MessageHeader + // The body of the email, in HTML format, for recipients whose email clients // render HTML content. HtmlBody *string @@ -2380,6 +2385,11 @@ type EmailTemplateRequest struct { // variables and values. DefaultSubstitutions *string + // The list of [MessageHeaders] for the email. You can have up to 15 Headers. + // + // [MessageHeaders]: https://docs.aws.amazon.com/pinpoint/latest/apireference/templates-template-name-email.html#templates-template-name-email-model-messageheader + Headers []MessageHeader + // The message body, in HTML format, to use in email messages that are based on // the message template. We recommend using HTML format for email clients that // render HTML content. You can include links, formatted text, and more in an HTML @@ -2455,6 +2465,11 @@ type EmailTemplateResponse struct { // the default value for that variable. DefaultSubstitutions *string + // The list of [MessageHeaders] for the email. You can have up to 15 Headers. + // + // [MessageHeaders]: https://docs.aws.amazon.com/pinpoint/latest/apireference/templates-template-name-email.html#templates-template-name-email-model-messageheader + Headers []MessageHeader + // The message body, in HTML format, that's used in email messages that are based // on the message template. HtmlPart *string @@ -4748,6 +4763,24 @@ type MessageConfiguration struct { noSmithyDocumentSerde } +// Contains the name and value pair of an email header to add to your email. You +// can have up to 15 MessageHeaders. A header can contain information such as the +// sender, receiver, route, or timestamp. +type MessageHeader struct { + + // The name of the message header. The header name can contain up to 126 + // characters. + Name *string + + // The value of the message header. The header value can contain up to 870 + // characters, including the length of any rendered attributes. For example if you + // add the {CreationDate} attribute, it renders as YYYY-MM-DDTHH:MM:SS.SSSZ and is + // 24 characters in length. + Value *string + + noSmithyDocumentSerde +} + // Specifies the configuration and other settings for a message. type MessageRequest struct { @@ -5978,6 +6011,9 @@ type SimpleCondition struct { // and an HTML part. type SimpleEmail struct { + // The list of MessageHeaders for the email. You can have up to 15 Headers. + Headers []MessageHeader + // The body of the email message, in HTML format. We recommend using HTML format // for email clients that render HTML content. You can include links, formatted // text, and more in an HTML message. diff --git a/service/route53resolver/CHANGELOG.md b/service/route53resolver/CHANGELOG.md index 93582681e3c..8a653f211c3 100644 --- a/service/route53resolver/CHANGELOG.md +++ b/service/route53resolver/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.28.2 (2024-05-09) + +* **Documentation**: Update the DNS Firewall settings to correct a spelling issue. + # v1.28.1 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/route53resolver/api_op_CreateFirewallRule.go b/service/route53resolver/api_op_CreateFirewallRule.go index 4e9183cf850..2d131310d6d 100644 --- a/service/route53resolver/api_op_CreateFirewallRule.go +++ b/service/route53resolver/api_op_CreateFirewallRule.go @@ -114,15 +114,15 @@ type CreateFirewallRuleInput struct { BlockResponse types.BlockResponse // How you want the the rule to evaluate DNS redirection in the DNS redirection - // chain, such as CNAME, DNAME, ot ALIAS. + // chain, such as CNAME or DNAME. // // Inspect_Redirection_Domain (Default) inspects all domains in the redirection // chain. The individual domains in the redirection chain must be added to the - // allow domain list. + // domain list. // // Trust_Redirection_Domain inspects only the first domain in the redirection - // chain. You don't need to add the subsequent domains in the redirection list to - // the domain alloww list. + // chain. You don't need to add the subsequent domains in the domain in the + // redirection list to the domain list. FirewallDomainRedirectionAction types.FirewallDomainRedirectionAction // The DNS query type you want the rule to evaluate. Allowed values are; diff --git a/service/route53resolver/api_op_UpdateFirewallRule.go b/service/route53resolver/api_op_UpdateFirewallRule.go index 202c8b04ef6..a5a7f99f18d 100644 --- a/service/route53resolver/api_op_UpdateFirewallRule.go +++ b/service/route53resolver/api_op_UpdateFirewallRule.go @@ -78,15 +78,15 @@ type UpdateFirewallRuleInput struct { BlockResponse types.BlockResponse // How you want the the rule to evaluate DNS redirection in the DNS redirection - // chain, such as CNAME, DNAME, ot ALIAS. + // chain, such as CNAME or DNAME. // // Inspect_Redirection_Domain (Default) inspects all domains in the redirection // chain. The individual domains in the redirection chain must be added to the - // allow domain list. + // domain list. // // Trust_Redirection_Domain inspects only the first domain in the redirection // chain. You don't need to add the subsequent domains in the domain in the - // redirection list to the domain alloww list. + // redirection list to the domain list. FirewallDomainRedirectionAction types.FirewallDomainRedirectionAction // The name of the rule. diff --git a/service/route53resolver/go_module_metadata.go b/service/route53resolver/go_module_metadata.go index 3964370ad73..4f613f94098 100644 --- a/service/route53resolver/go_module_metadata.go +++ b/service/route53resolver/go_module_metadata.go @@ -3,4 +3,4 @@ package route53resolver // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.28.1" +const goModuleVersion = "1.28.2" diff --git a/service/route53resolver/types/types.go b/service/route53resolver/types/types.go index 2b935330a83..70640001601 100644 --- a/service/route53resolver/types/types.go +++ b/service/route53resolver/types/types.go @@ -350,15 +350,15 @@ type FirewallRule struct { FirewallDomainListId *string // How you want the the rule to evaluate DNS redirection in the DNS redirection - // chain, such as CNAME, DNAME, ot ALIAS. + // chain, such as CNAME or DNAME. // // Inspect_Redirection_Domain (Default) inspects all domains in the redirection // chain. The individual domains in the redirection chain must be added to the - // allow domain list. + // domain list. // // Trust_Redirection_Domain inspects only the first domain in the redirection // chain. You don't need to add the subsequent domains in the domain in the - // redirection list to the domain alloww list. + // redirection list to the domain list. FirewallDomainRedirectionAction FirewallDomainRedirectionAction // The unique identifier of the firewall rule group of the rule. diff --git a/service/ssmsap/CHANGELOG.md b/service/ssmsap/CHANGELOG.md index b524cacbd86..5cf90b32438 100644 --- a/service/ssmsap/CHANGELOG.md +++ b/service/ssmsap/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.13.0 (2024-05-09) + +* **Feature**: Added support for application-aware start/stop of SAP applications running on EC2 instances, with SSM for SAP + # v1.12.5 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/ssmsap/api_op_ListOperationEvents.go b/service/ssmsap/api_op_ListOperationEvents.go new file mode 100644 index 00000000000..8a60213bbc0 --- /dev/null +++ b/service/ssmsap/api_op_ListOperationEvents.go @@ -0,0 +1,255 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmsap + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmsap/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of operations events. +// +// Available parameters include OperationID , as well as optional parameters +// MaxResults , NextToken , and Filters . +func (c *Client) ListOperationEvents(ctx context.Context, params *ListOperationEventsInput, optFns ...func(*Options)) (*ListOperationEventsOutput, error) { + if params == nil { + params = &ListOperationEventsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListOperationEvents", params, optFns, c.addOperationListOperationEventsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListOperationEventsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListOperationEventsInput struct { + + // The ID of the operation. + // + // This member is required. + OperationId *string + + // Optionally specify filters to narrow the returned operation event items. + // + // Valid filter names include status , resourceID , and resourceType . The valid + // operator for all three filters is Equals . + Filters []types.Filter + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + // + // If you do not specify a value for MaxResults , the request returns 50 items per + // page by default. + MaxResults *int32 + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + noSmithyDocumentSerde +} + +type ListOperationEventsOutput struct { + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // A returned list of operation events that meet the filter criteria. + OperationEvents []types.OperationEvent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListOperationEventsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListOperationEvents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListOperationEvents{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListOperationEvents"); 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 = addOpListOperationEventsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOperationEvents(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 +} + +// ListOperationEventsAPIClient is a client that implements the +// ListOperationEvents operation. +type ListOperationEventsAPIClient interface { + ListOperationEvents(context.Context, *ListOperationEventsInput, ...func(*Options)) (*ListOperationEventsOutput, error) +} + +var _ ListOperationEventsAPIClient = (*Client)(nil) + +// ListOperationEventsPaginatorOptions is the paginator options for +// ListOperationEvents +type ListOperationEventsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + // + // If you do not specify a value for MaxResults , the request returns 50 items per + // page by default. + 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 +} + +// ListOperationEventsPaginator is a paginator for ListOperationEvents +type ListOperationEventsPaginator struct { + options ListOperationEventsPaginatorOptions + client ListOperationEventsAPIClient + params *ListOperationEventsInput + nextToken *string + firstPage bool +} + +// NewListOperationEventsPaginator returns a new ListOperationEventsPaginator +func NewListOperationEventsPaginator(client ListOperationEventsAPIClient, params *ListOperationEventsInput, optFns ...func(*ListOperationEventsPaginatorOptions)) *ListOperationEventsPaginator { + if params == nil { + params = &ListOperationEventsInput{} + } + + options := ListOperationEventsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListOperationEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOperationEventsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListOperationEvents page. +func (p *ListOperationEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOperationEventsOutput, 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.ListOperationEvents(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_opListOperationEvents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListOperationEvents", + } +} diff --git a/service/ssmsap/api_op_StartApplication.go b/service/ssmsap/api_op_StartApplication.go new file mode 100644 index 00000000000..9f8a15f448f --- /dev/null +++ b/service/ssmsap/api_op_StartApplication.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmsap + +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" +) + +// Request is an operation which starts an application. +// +// Parameter ApplicationId is required. +func (c *Client) StartApplication(ctx context.Context, params *StartApplicationInput, optFns ...func(*Options)) (*StartApplicationOutput, error) { + if params == nil { + params = &StartApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartApplication", params, optFns, c.addOperationStartApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartApplicationInput struct { + + // The ID of the application. + // + // This member is required. + ApplicationId *string + + noSmithyDocumentSerde +} + +type StartApplicationOutput struct { + + // The ID of the operation. + OperationId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartApplication"); 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 = addOpStartApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartApplication(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_opStartApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartApplication", + } +} diff --git a/service/ssmsap/api_op_StopApplication.go b/service/ssmsap/api_op_StopApplication.go new file mode 100644 index 00000000000..9a262a7c6c3 --- /dev/null +++ b/service/ssmsap/api_op_StopApplication.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmsap + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmsap/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Request is an operation to stop an application. +// +// Parameter ApplicationId is required. Parameters StopConnectedEntity and +// IncludeEc2InstanceShutdown are optional. +func (c *Client) StopApplication(ctx context.Context, params *StopApplicationInput, optFns ...func(*Options)) (*StopApplicationOutput, error) { + if params == nil { + params = &StopApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopApplication", params, optFns, c.addOperationStopApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopApplicationInput struct { + + // The ID of the application. + // + // This member is required. + ApplicationId *string + + // Boolean. If included and if set to True , the StopApplication operation will + // shut down the associated Amazon EC2 instance in addition to the application. + IncludeEc2InstanceShutdown *bool + + // Specify the ConnectedEntityType . Accepted type is DBMS . + // + // If this parameter is included, the connected DBMS (Database Management System) + // will be stopped. + StopConnectedEntity types.ConnectedEntityType + + noSmithyDocumentSerde +} + +type StopApplicationOutput struct { + + // The ID of the operation. + OperationId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStopApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopApplication"); 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 = addOpStopApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopApplication(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_opStopApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopApplication", + } +} diff --git a/service/ssmsap/deserializers.go b/service/ssmsap/deserializers.go index 2274936600f..5cc1da19655 100644 --- a/service/ssmsap/deserializers.go +++ b/service/ssmsap/deserializers.go @@ -1529,6 +1529,165 @@ func awsRestjson1_deserializeOpDocumentListDatabasesOutput(v **ListDatabasesOutp return nil } +type awsRestjson1_deserializeOpListOperationEvents struct { +} + +func (*awsRestjson1_deserializeOpListOperationEvents) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListOperationEvents) 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_deserializeOpErrorListOperationEvents(response, &metadata) + } + output := &ListOperationEventsOutput{} + 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 = awsRestjson1_deserializeOpDocumentListOperationEventsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListOperationEvents(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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListOperationEventsOutput(v **ListOperationEventsOutput, 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 *ListOperationEventsOutput + if *v == nil { + sv = &ListOperationEventsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "OperationEvents": + if err := awsRestjson1_deserializeDocumentOperationEventList(&sv.OperationEvents, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListOperations struct { } @@ -1643,7 +1802,322 @@ func awsRestjson1_deserializeOpErrorListOperations(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListOperationsOutput(v **ListOperationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListOperationsOutput(v **ListOperationsOutput, 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 *ListOperationsOutput + if *v == nil { + sv = &ListOperationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Operations": + if err := awsRestjson1_deserializeDocumentOperationList(&sv.Operations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) 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_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + 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 = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, 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 *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutResourcePermission struct { +} + +func (*awsRestjson1_deserializeOpPutResourcePermission) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutResourcePermission) 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_deserializeOpErrorPutResourcePermission(response, &metadata) + } + output := &PutResourcePermissionOutput{} + 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 = awsRestjson1_deserializeOpDocumentPutResourcePermissionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutResourcePermission(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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutResourcePermissionOutput(v **PutResourcePermissionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1656,27 +2130,22 @@ func awsRestjson1_deserializeOpDocumentListOperationsOutput(v **ListOperationsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListOperationsOutput + var sv *PutResourcePermissionOutput if *v == nil { - sv = &ListOperationsOutput{} + sv = &PutResourcePermissionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": + case "Policy": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) - } - - case "Operations": - if err := awsRestjson1_deserializeDocumentOperationList(&sv.Operations, value); err != nil { - return err + sv.Policy = ptr.String(jtv) } default: @@ -1688,14 +2157,14 @@ func awsRestjson1_deserializeOpDocumentListOperationsOutput(v **ListOperationsOu return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpRegisterApplication struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpRegisterApplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRegisterApplication) 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) @@ -1709,9 +2178,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRegisterApplication(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &RegisterApplicationOutput{} out.Result = output var buff [1024]byte @@ -1732,7 +2201,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentRegisterApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1745,7 +2214,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRegisterApplication(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)} @@ -1789,6 +2258,9 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1805,7 +2277,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentRegisterApplicationOutput(v **RegisterApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1818,20 +2290,29 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *RegisterApplicationOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &RegisterApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "Application": + if err := awsRestjson1_deserializeDocumentApplication(&sv.Application, value); err != nil { return err } + case "OperationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) + } + sv.OperationId = ptr.String(jtv) + } + default: _, _ = key, value @@ -1841,14 +2322,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpPutResourcePermission struct { +type awsRestjson1_deserializeOpStartApplication struct { } -func (*awsRestjson1_deserializeOpPutResourcePermission) ID() string { +func (*awsRestjson1_deserializeOpStartApplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutResourcePermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartApplication) 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) @@ -1862,9 +2343,9 @@ func (m *awsRestjson1_deserializeOpPutResourcePermission) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutResourcePermission(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartApplication(response, &metadata) } - output := &PutResourcePermissionOutput{} + output := &StartApplicationOutput{} out.Result = output var buff [1024]byte @@ -1885,7 +2366,7 @@ func (m *awsRestjson1_deserializeOpPutResourcePermission) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutResourcePermissionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1898,7 +2379,7 @@ func (m *awsRestjson1_deserializeOpPutResourcePermission) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutResourcePermission(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartApplication(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)} @@ -1939,6 +2420,9 @@ func awsRestjson1_deserializeOpErrorPutResourcePermission(response *smithyhttp.R } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -1958,7 +2442,7 @@ func awsRestjson1_deserializeOpErrorPutResourcePermission(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentPutResourcePermissionOutput(v **PutResourcePermissionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartApplicationOutput(v **StartApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1971,22 +2455,22 @@ func awsRestjson1_deserializeOpDocumentPutResourcePermissionOutput(v **PutResour return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutResourcePermissionOutput + var sv *StartApplicationOutput if *v == nil { - sv = &PutResourcePermissionOutput{} + sv = &StartApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Policy": + case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } - sv.Policy = ptr.String(jtv) + sv.OperationId = ptr.String(jtv) } default: @@ -1998,14 +2482,14 @@ func awsRestjson1_deserializeOpDocumentPutResourcePermissionOutput(v **PutResour return nil } -type awsRestjson1_deserializeOpRegisterApplication struct { +type awsRestjson1_deserializeOpStartApplicationRefresh struct { } -func (*awsRestjson1_deserializeOpRegisterApplication) ID() string { +func (*awsRestjson1_deserializeOpStartApplicationRefresh) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRegisterApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartApplicationRefresh) 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) @@ -2019,9 +2503,9 @@ func (m *awsRestjson1_deserializeOpRegisterApplication) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRegisterApplication(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartApplicationRefresh(response, &metadata) } - output := &RegisterApplicationOutput{} + output := &StartApplicationRefreshOutput{} out.Result = output var buff [1024]byte @@ -2042,7 +2526,7 @@ func (m *awsRestjson1_deserializeOpRegisterApplication) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentRegisterApplicationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartApplicationRefreshOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2055,7 +2539,7 @@ func (m *awsRestjson1_deserializeOpRegisterApplication) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorRegisterApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartApplicationRefresh(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)} @@ -2105,6 +2589,9 @@ func awsRestjson1_deserializeOpErrorRegisterApplication(response *smithyhttp.Res case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -2118,7 +2605,7 @@ func awsRestjson1_deserializeOpErrorRegisterApplication(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentRegisterApplicationOutput(v **RegisterApplicationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartApplicationRefreshOutput(v **StartApplicationRefreshOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2131,20 +2618,15 @@ func awsRestjson1_deserializeOpDocumentRegisterApplicationOutput(v **RegisterApp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *RegisterApplicationOutput + var sv *StartApplicationRefreshOutput if *v == nil { - sv = &RegisterApplicationOutput{} + sv = &StartApplicationRefreshOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Application": - if err := awsRestjson1_deserializeDocumentApplication(&sv.Application, value); err != nil { - return err - } - case "OperationId": if value != nil { jtv, ok := value.(string) @@ -2163,14 +2645,14 @@ func awsRestjson1_deserializeOpDocumentRegisterApplicationOutput(v **RegisterApp return nil } -type awsRestjson1_deserializeOpStartApplicationRefresh struct { +type awsRestjson1_deserializeOpStopApplication struct { } -func (*awsRestjson1_deserializeOpStartApplicationRefresh) ID() string { +func (*awsRestjson1_deserializeOpStopApplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartApplicationRefresh) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStopApplication) 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) @@ -2184,9 +2666,9 @@ func (m *awsRestjson1_deserializeOpStartApplicationRefresh) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartApplicationRefresh(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStopApplication(response, &metadata) } - output := &StartApplicationRefreshOutput{} + output := &StopApplicationOutput{} out.Result = output var buff [1024]byte @@ -2207,7 +2689,7 @@ func (m *awsRestjson1_deserializeOpStartApplicationRefresh) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartApplicationRefreshOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStopApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2220,7 +2702,7 @@ func (m *awsRestjson1_deserializeOpStartApplicationRefresh) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartApplicationRefresh(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStopApplication(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)} @@ -2270,9 +2752,6 @@ func awsRestjson1_deserializeOpErrorStartApplicationRefresh(response *smithyhttp case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -2286,7 +2765,7 @@ func awsRestjson1_deserializeOpErrorStartApplicationRefresh(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentStartApplicationRefreshOutput(v **StartApplicationRefreshOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStopApplicationOutput(v **StopApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2299,9 +2778,9 @@ func awsRestjson1_deserializeOpDocumentStartApplicationRefreshOutput(v **StartAp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartApplicationRefreshOutput + var sv *StopApplicationOutput if *v == nil { - sv = &StartApplicationRefreshOutput{} + sv = &StopApplicationOutput{} } else { sv = *v } @@ -4348,6 +4827,119 @@ func awsRestjson1_deserializeDocumentOperation(v **types.Operation, value interf return nil } +func awsRestjson1_deserializeDocumentOperationEvent(v **types.OperationEvent, 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.OperationEvent + if *v == nil { + sv = &types.OperationEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Resource": + if err := awsRestjson1_deserializeDocumentResource(&sv.Resource, value); err != nil { + return err + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationEventStatus to be of type string, got %T instead", value) + } + sv.Status = types.OperationEventStatus(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + case "Timestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOperationEventList(v *[]types.OperationEvent, 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.OperationEvent + if *v == nil { + cv = []types.OperationEvent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OperationEvent + destAddr := &col + if err := awsRestjson1_deserializeDocumentOperationEvent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentOperationIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4530,6 +5122,55 @@ func awsRestjson1_deserializeDocumentResilience(v **types.Resilience, value inte return nil } +func awsRestjson1_deserializeDocumentResource(v **types.Resource, 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.Resource + if *v == nil { + sv = &types.Resource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationEventResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ssmsap/generated.json b/service/ssmsap/generated.json index fca15fc1ac7..e9d352fe523 100644 --- a/service/ssmsap/generated.json +++ b/service/ssmsap/generated.json @@ -18,11 +18,14 @@ "api_op_ListApplications.go", "api_op_ListComponents.go", "api_op_ListDatabases.go", + "api_op_ListOperationEvents.go", "api_op_ListOperations.go", "api_op_ListTagsForResource.go", "api_op_PutResourcePermission.go", "api_op_RegisterApplication.go", + "api_op_StartApplication.go", "api_op_StartApplicationRefresh.go", + "api_op_StopApplication.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateApplicationSettings.go", diff --git a/service/ssmsap/go_module_metadata.go b/service/ssmsap/go_module_metadata.go index 84c5399e521..b451e46e53c 100644 --- a/service/ssmsap/go_module_metadata.go +++ b/service/ssmsap/go_module_metadata.go @@ -3,4 +3,4 @@ package ssmsap // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.12.5" +const goModuleVersion = "1.13.0" diff --git a/service/ssmsap/serializers.go b/service/ssmsap/serializers.go index 3045a763892..e338c60485c 100644 --- a/service/ssmsap/serializers.go +++ b/service/ssmsap/serializers.go @@ -846,6 +846,98 @@ func awsRestjson1_serializeOpDocumentListDatabasesInput(v *ListDatabasesInput, v return nil } +type awsRestjson1_serializeOpListOperationEvents struct { +} + +func (*awsRestjson1_serializeOpListOperationEvents) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListOperationEvents) 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.(*ListOperationEventsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-operation-events") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + 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} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListOperationEventsInput(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 = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListOperationEventsInput(v *ListOperationEventsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListOperationEventsInput(v *ListOperationEventsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.OperationId != nil { + ok := object.Key("OperationId") + ok.String(*v.OperationId) + } + + return nil +} + type awsRestjson1_serializeOpListOperations struct { } @@ -1204,6 +1296,81 @@ func awsRestjson1_serializeOpDocumentRegisterApplicationInput(v *RegisterApplica return nil } +type awsRestjson1_serializeOpStartApplication struct { +} + +func (*awsRestjson1_serializeOpStartApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartApplication) 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.(*StartApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/start-application") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + 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} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartApplicationInput(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 = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartApplicationInput(v *StartApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartApplicationInput(v *StartApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationId != nil { + ok := object.Key("ApplicationId") + ok.String(*v.ApplicationId) + } + + return nil +} + type awsRestjson1_serializeOpStartApplicationRefresh struct { } @@ -1279,6 +1446,91 @@ func awsRestjson1_serializeOpDocumentStartApplicationRefreshInput(v *StartApplic return nil } +type awsRestjson1_serializeOpStopApplication struct { +} + +func (*awsRestjson1_serializeOpStopApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStopApplication) 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.(*StopApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/stop-application") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + 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} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStopApplicationInput(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 = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStopApplicationInput(v *StopApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStopApplicationInput(v *StopApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationId != nil { + ok := object.Key("ApplicationId") + ok.String(*v.ApplicationId) + } + + if v.IncludeEc2InstanceShutdown != nil { + ok := object.Key("IncludeEc2InstanceShutdown") + ok.Boolean(*v.IncludeEc2InstanceShutdown) + } + + if len(v.StopConnectedEntity) > 0 { + ok := object.Key("StopConnectedEntity") + ok.String(string(v.StopConnectedEntity)) + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } diff --git a/service/ssmsap/snapshot_test.go b/service/ssmsap/snapshot_test.go index af68f02fb8c..8b939699a26 100644 --- a/service/ssmsap/snapshot_test.go +++ b/service/ssmsap/snapshot_test.go @@ -182,6 +182,18 @@ func TestCheckSnapshot_ListDatabases(t *testing.T) { } } +func TestCheckSnapshot_ListOperationEvents(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListOperationEvents(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListOperationEvents") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListOperations(t *testing.T) { svc := New(Options{}) _, err := svc.ListOperations(context.Background(), nil, func(o *Options) { @@ -230,6 +242,18 @@ func TestCheckSnapshot_RegisterApplication(t *testing.T) { } } +func TestCheckSnapshot_StartApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartApplicationRefresh(t *testing.T) { svc := New(Options{}) _, err := svc.StartApplicationRefresh(context.Background(), nil, func(o *Options) { @@ -242,6 +266,18 @@ func TestCheckSnapshot_StartApplicationRefresh(t *testing.T) { } } +func TestCheckSnapshot_StopApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.StopApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StopApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_TagResource(t *testing.T) { svc := New(Options{}) _, err := svc.TagResource(context.Background(), nil, func(o *Options) { @@ -397,6 +433,18 @@ func TestUpdateSnapshot_ListDatabases(t *testing.T) { } } +func TestUpdateSnapshot_ListOperationEvents(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListOperationEvents(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListOperationEvents") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListOperations(t *testing.T) { svc := New(Options{}) _, err := svc.ListOperations(context.Background(), nil, func(o *Options) { @@ -445,6 +493,18 @@ func TestUpdateSnapshot_RegisterApplication(t *testing.T) { } } +func TestUpdateSnapshot_StartApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartApplicationRefresh(t *testing.T) { svc := New(Options{}) _, err := svc.StartApplicationRefresh(context.Background(), nil, func(o *Options) { @@ -457,6 +517,18 @@ func TestUpdateSnapshot_StartApplicationRefresh(t *testing.T) { } } +func TestUpdateSnapshot_StopApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.StopApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StopApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_TagResource(t *testing.T) { svc := New(Options{}) _, err := svc.TagResource(context.Background(), nil, func(o *Options) { diff --git a/service/ssmsap/types/enums.go b/service/ssmsap/types/enums.go index 79606d8f156..e7c0a67cfe0 100644 --- a/service/ssmsap/types/enums.go +++ b/service/ssmsap/types/enums.go @@ -202,6 +202,23 @@ func (ComponentType) Values() []ComponentType { } } +type ConnectedEntityType string + +// Enum values for ConnectedEntityType +const ( + ConnectedEntityTypeDbms ConnectedEntityType = "DBMS" +) + +// Values returns all known values for ConnectedEntityType. 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 (ConnectedEntityType) Values() []ConnectedEntityType { + return []ConnectedEntityType{ + "DBMS", + } +} + type CredentialType string // Enum values for CredentialType @@ -328,6 +345,27 @@ func (HostRole) Values() []HostRole { } } +type OperationEventStatus string + +// Enum values for OperationEventStatus +const ( + OperationEventStatusInProgress OperationEventStatus = "IN_PROGRESS" + OperationEventStatusCompleted OperationEventStatus = "COMPLETED" + OperationEventStatusFailed OperationEventStatus = "FAILED" +) + +// Values returns all known values for OperationEventStatus. 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 (OperationEventStatus) Values() []OperationEventStatus { + return []OperationEventStatus{ + "IN_PROGRESS", + "COMPLETED", + "FAILED", + } +} + type OperationMode string // Enum values for OperationMode diff --git a/service/ssmsap/types/types.go b/service/ssmsap/types/types.go index 5954a997018..cc5ca55e4f4 100644 --- a/service/ssmsap/types/types.go +++ b/service/ssmsap/types/types.go @@ -411,6 +411,46 @@ type Operation struct { noSmithyDocumentSerde } +// An operation event returns details for an operation, including key milestones +// which can be used to monitor and track operations in progress. +// +// Operation events contain: +// +// - Description string +// +// - Resource, including its ARN and type +// +// - Status +// +// - StatusMessage string +// +// - TimeStamp +// +// Operation event examples include StartApplication or StopApplication. +type OperationEvent struct { + + // A description of the operation event. For example, "Stop the EC2 instance + // i-abcdefgh987654321". + Description *string + + // The resource involved in the operations event. + // + // Contains ResourceArn ARN and ResourceType . + Resource *Resource + + // The status of the operation event. The possible statuses are: IN_PROGRESS , + // COMPLETED , and FAILED . + Status OperationEventStatus + + // The status message relating to a specific operation event. + StatusMessage *string + + // The timestamp of the specified operation event. + Timestamp *time.Time + + noSmithyDocumentSerde +} + // Details of the SAP HANA system replication for the instance. type Resilience struct { @@ -432,4 +472,22 @@ type Resilience struct { noSmithyDocumentSerde } +// The resource contains a ResourceArn and the ResourceType . +type Resource struct { + + // The Amazon Resource Name (ARN) of the source resource. + // + // Example of ResourceArn : " + // arn:aws:ec2:us-east-1:111111111111:instance/i-abcdefgh987654321 " + ResourceArn *string + + // The resource type. + // + // Example of ResourceType : " AWS::SystemsManagerSAP::Component " or " + // AWS::EC2::Instance ". + ResourceType *string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/ssmsap/validators.go b/service/ssmsap/validators.go index e2f342b6fee..652efc94b5f 100644 --- a/service/ssmsap/validators.go +++ b/service/ssmsap/validators.go @@ -130,6 +130,26 @@ func (m *validateOpListApplications) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpListOperationEvents struct { +} + +func (*validateOpListOperationEvents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListOperationEvents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListOperationEventsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListOperationEventsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListOperations struct { } @@ -210,6 +230,26 @@ func (m *validateOpRegisterApplication) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpStartApplication struct { +} + +func (*validateOpStartApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartApplicationRefresh struct { } @@ -230,6 +270,26 @@ func (m *validateOpStartApplicationRefresh) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpStopApplication struct { +} + +func (*validateOpStopApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -314,6 +374,10 @@ func addOpListApplicationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListApplications{}, middleware.After) } +func addOpListOperationEventsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListOperationEvents{}, middleware.After) +} + func addOpListOperationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListOperations{}, middleware.After) } @@ -330,10 +394,18 @@ func addOpRegisterApplicationValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpRegisterApplication{}, middleware.After) } +func addOpStartApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartApplication{}, middleware.After) +} + func addOpStartApplicationRefreshValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartApplicationRefresh{}, middleware.After) } +func addOpStopApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopApplication{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -535,6 +607,26 @@ func validateOpListApplicationsInput(v *ListApplicationsInput) error { } } +func validateOpListOperationEventsInput(v *ListOperationEventsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListOperationEventsInput"} + if v.OperationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OperationId")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListOperationsInput(v *ListOperationsInput) error { if v == nil { return nil @@ -617,6 +709,21 @@ func validateOpRegisterApplicationInput(v *RegisterApplicationInput) error { } } +func validateOpStartApplicationInput(v *StartApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartApplicationInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartApplicationRefreshInput(v *StartApplicationRefreshInput) error { if v == nil { return nil @@ -632,6 +739,21 @@ func validateOpStartApplicationRefreshInput(v *StartApplicationRefreshInput) err } } +func validateOpStopApplicationInput(v *StopApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopApplicationInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/verifiedpermissions/CHANGELOG.md b/service/verifiedpermissions/CHANGELOG.md index 19e361be445..7ebcaa06dec 100644 --- a/service/verifiedpermissions/CHANGELOG.md +++ b/service/verifiedpermissions/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.14.0 (2024-05-09) + +* **Feature**: Adds policy effect and actions fields to Policy API's. + # v1.13.2 (2024-05-08) * **Bug Fix**: GoDoc improvement diff --git a/service/verifiedpermissions/api_op_CreatePolicy.go b/service/verifiedpermissions/api_op_CreatePolicy.go index 938618ccb7d..1fb764fc95e 100644 --- a/service/verifiedpermissions/api_op_CreatePolicy.go +++ b/service/verifiedpermissions/api_op_CreatePolicy.go @@ -111,6 +111,15 @@ type CreatePolicyOutput struct { // This member is required. PolicyType types.PolicyType + // The action that a policy permits or forbids. For example, {"actions": + // [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": + // "SharePhoto", "entityType": "PhotoFlash::Action"}]} . + Actions []types.ActionIdentifier + + // The effect of the decision that a policy returns to an authorization request. + // For example, "effect": "Permit" . + Effect types.PolicyEffect + // The principal specified in the new policy's scope. This response element isn't // present when principal isn't specified in the policy content. Principal *types.EntityIdentifier diff --git a/service/verifiedpermissions/api_op_GetPolicy.go b/service/verifiedpermissions/api_op_GetPolicy.go index d0c798e1336..2f10a6e8ecc 100644 --- a/service/verifiedpermissions/api_op_GetPolicy.go +++ b/service/verifiedpermissions/api_op_GetPolicy.go @@ -77,6 +77,15 @@ type GetPolicyOutput struct { // This member is required. PolicyType types.PolicyType + // The action that a policy permits or forbids. For example, {"actions": + // [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": + // "SharePhoto", "entityType": "PhotoFlash::Action"}]} . + Actions []types.ActionIdentifier + + // The effect of the decision that a policy returns to an authorization request. + // For example, "effect": "Permit" . + Effect types.PolicyEffect + // The principal specified in the policy's scope. This element isn't included in // the response when Principal isn't present in the policy content. Principal *types.EntityIdentifier diff --git a/service/verifiedpermissions/api_op_ListIdentitySources.go b/service/verifiedpermissions/api_op_ListIdentitySources.go index 796d7b28838..d25af48c496 100644 --- a/service/verifiedpermissions/api_op_ListIdentitySources.go +++ b/service/verifiedpermissions/api_op_ListIdentitySources.go @@ -49,7 +49,7 @@ type ListIdentitySourcesInput struct { // after every operation to ensure that you receive all of the results. // // If you do not specify this parameter, the operation defaults to 10 identity - // sources per response. You can specify a maximum of 200 identity sources per + // sources per response. You can specify a maximum of 50 identity sources per // response. MaxResults *int32 @@ -181,7 +181,7 @@ type ListIdentitySourcesPaginatorOptions struct { // after every operation to ensure that you receive all of the results. // // If you do not specify this parameter, the operation defaults to 10 identity - // sources per response. You can specify a maximum of 200 identity sources per + // sources per response. You can specify a maximum of 50 identity sources per // response. Limit int32 diff --git a/service/verifiedpermissions/api_op_UpdatePolicy.go b/service/verifiedpermissions/api_op_UpdatePolicy.go index 6f417888875..1e43fb022d6 100644 --- a/service/verifiedpermissions/api_op_UpdatePolicy.go +++ b/service/verifiedpermissions/api_op_UpdatePolicy.go @@ -131,6 +131,15 @@ type UpdatePolicyOutput struct { // This member is required. PolicyType types.PolicyType + // The action that a policy permits or forbids. For example, {"actions": + // [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": + // "SharePhoto", "entityType": "PhotoFlash::Action"}]} . + Actions []types.ActionIdentifier + + // The effect of the decision that a policy returns to an authorization request. + // For example, "effect": "Permit" . + Effect types.PolicyEffect + // The principal specified in the policy's scope. This element isn't included in // the response when Principal isn't present in the policy content. Principal *types.EntityIdentifier diff --git a/service/verifiedpermissions/deserializers.go b/service/verifiedpermissions/deserializers.go index a7431640503..d6534691b71 100644 --- a/service/verifiedpermissions/deserializers.go +++ b/service/verifiedpermissions/deserializers.go @@ -3492,6 +3492,40 @@ func awsAwsjson10_deserializeDocumentActionIdentifier(v **types.ActionIdentifier return nil } +func awsAwsjson10_deserializeDocumentActionIdentifierList(v *[]types.ActionIdentifier, 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.ActionIdentifier + if *v == nil { + cv = []types.ActionIdentifier{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ActionIdentifier + destAddr := &col + if err := awsAwsjson10_deserializeDocumentActionIdentifier(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentAttributeValue(v *types.AttributeValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4943,6 +4977,11 @@ func awsAwsjson10_deserializeDocumentPolicyItem(v **types.PolicyItem, value inte for key, value := range shape { switch key { + case "actions": + if err := awsAwsjson10_deserializeDocumentActionIdentifierList(&sv.Actions, value); err != nil { + return err + } + case "createdDate": if value != nil { jtv, ok := value.(string) @@ -4961,6 +5000,15 @@ func awsAwsjson10_deserializeDocumentPolicyItem(v **types.PolicyItem, value inte return err } + case "effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyEffect to be of type string, got %T instead", value) + } + sv.Effect = types.PolicyEffect(jtv) + } + case "lastUpdatedDate": if value != nil { jtv, ok := value.(string) @@ -6162,6 +6210,11 @@ func awsAwsjson10_deserializeOpDocumentCreatePolicyOutput(v **CreatePolicyOutput for key, value := range shape { switch key { + case "actions": + if err := awsAwsjson10_deserializeDocumentActionIdentifierList(&sv.Actions, value); err != nil { + return err + } + case "createdDate": if value != nil { jtv, ok := value.(string) @@ -6175,6 +6228,15 @@ func awsAwsjson10_deserializeOpDocumentCreatePolicyOutput(v **CreatePolicyOutput sv.CreatedDate = ptr.Time(t) } + case "effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyEffect to be of type string, got %T instead", value) + } + sv.Effect = types.PolicyEffect(jtv) + } + case "lastUpdatedDate": if value != nil { jtv, ok := value.(string) @@ -6624,6 +6686,11 @@ func awsAwsjson10_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, valu for key, value := range shape { switch key { + case "actions": + if err := awsAwsjson10_deserializeDocumentActionIdentifierList(&sv.Actions, value); err != nil { + return err + } + case "createdDate": if value != nil { jtv, ok := value.(string) @@ -6642,6 +6709,15 @@ func awsAwsjson10_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, valu return err } + case "effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyEffect to be of type string, got %T instead", value) + } + sv.Effect = types.PolicyEffect(jtv) + } + case "lastUpdatedDate": if value != nil { jtv, ok := value.(string) @@ -7416,6 +7492,11 @@ func awsAwsjson10_deserializeOpDocumentUpdatePolicyOutput(v **UpdatePolicyOutput for key, value := range shape { switch key { + case "actions": + if err := awsAwsjson10_deserializeDocumentActionIdentifierList(&sv.Actions, value); err != nil { + return err + } + case "createdDate": if value != nil { jtv, ok := value.(string) @@ -7429,6 +7510,15 @@ func awsAwsjson10_deserializeOpDocumentUpdatePolicyOutput(v **UpdatePolicyOutput sv.CreatedDate = ptr.Time(t) } + case "effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyEffect to be of type string, got %T instead", value) + } + sv.Effect = types.PolicyEffect(jtv) + } + case "lastUpdatedDate": if value != nil { jtv, ok := value.(string) diff --git a/service/verifiedpermissions/go_module_metadata.go b/service/verifiedpermissions/go_module_metadata.go index e2458ad5dc4..b4bef5d6ecf 100644 --- a/service/verifiedpermissions/go_module_metadata.go +++ b/service/verifiedpermissions/go_module_metadata.go @@ -3,4 +3,4 @@ package verifiedpermissions // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.2" +const goModuleVersion = "1.14.0" diff --git a/service/verifiedpermissions/types/enums.go b/service/verifiedpermissions/types/enums.go index 4b8b2057d51..a32206a3cff 100644 --- a/service/verifiedpermissions/types/enums.go +++ b/service/verifiedpermissions/types/enums.go @@ -38,6 +38,25 @@ func (OpenIdIssuer) Values() []OpenIdIssuer { } } +type PolicyEffect string + +// Enum values for PolicyEffect +const ( + PolicyEffectPermit PolicyEffect = "Permit" + PolicyEffectForbid PolicyEffect = "Forbid" +) + +// Values returns all known values for PolicyEffect. 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 (PolicyEffect) Values() []PolicyEffect { + return []PolicyEffect{ + "Permit", + "Forbid", + } +} + type PolicyType string // Enum values for PolicyType diff --git a/service/verifiedpermissions/types/types.go b/service/verifiedpermissions/types/types.go index 5be9c18b2f4..b7d08791895 100644 --- a/service/verifiedpermissions/types/types.go +++ b/service/verifiedpermissions/types/types.go @@ -244,8 +244,8 @@ type BatchIsAuthorizedWithTokenOutputItem struct { noSmithyDocumentSerde } -// A list of user groups and entities from an Amazon Cognito user pool identity -// source. +// The type of entity that a policy store maps to groups from an Amazon Cognito +// user pool identity source. // // This data type is part of a [CognitoUserPoolConfiguration] structure and is a request parameter in [CreateIdentitySource]. // @@ -262,8 +262,8 @@ type CognitoGroupConfiguration struct { noSmithyDocumentSerde } -// A list of user groups and entities from an Amazon Cognito user pool identity -// source. +// The type of entity that a policy store maps to groups from an Amazon Cognito +// user pool identity source. // // This data type is part of an [CognitoUserPoolConfigurationDetail] structure and is a response parameter to [GetIdentitySource]. // @@ -278,8 +278,8 @@ type CognitoGroupConfigurationDetail struct { noSmithyDocumentSerde } -// A list of user groups and entities from an Amazon Cognito user pool identity -// source. +// The type of entity that a policy store maps to groups from an Amazon Cognito +// user pool identity source. // // This data type is part of an [CognitoUserPoolConfigurationItem] structure and is a response parameter to [ListIdentitySources]. // @@ -302,7 +302,8 @@ type CognitoGroupConfigurationItem struct { // // Example: // "CognitoUserPoolConfiguration":{"UserPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": -// ["a1b2c3d4e5f6g7h8i9j0kalbmc"]} +// ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": +// "MyCorp::Group"}} // // [Configuration]: https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_Configuration.html // [CreateIdentitySource]: https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html @@ -325,8 +326,8 @@ type CognitoUserPoolConfiguration struct { // Example: "ClientIds": ["&ExampleCogClientId;"] ClientIds []string - // The configuration of the user groups from an Amazon Cognito user pool identity - // source. + // The type of entity that a policy store maps to groups from an Amazon Cognito + // user pool identity source. GroupConfiguration *CognitoGroupConfiguration noSmithyDocumentSerde @@ -340,7 +341,8 @@ type CognitoUserPoolConfiguration struct { // // Example: // "CognitoUserPoolConfiguration":{"UserPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": -// ["a1b2c3d4e5f6g7h8i9j0kalbmc"]} +// ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": +// "MyCorp::Group"}} // // [GetIdentitySource]: https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_GetIdentitySource.html // [ConfigurationDetail]: https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ConfigurationDetail.html @@ -374,8 +376,8 @@ type CognitoUserPoolConfigurationDetail struct { // This member is required. UserPoolArn *string - // The configuration of the user groups from an Amazon Cognito user pool identity - // source. + // The type of entity that a policy store maps to groups from an Amazon Cognito + // user pool identity source. GroupConfiguration *CognitoGroupConfigurationDetail noSmithyDocumentSerde @@ -389,7 +391,8 @@ type CognitoUserPoolConfigurationDetail struct { // // Example: // "CognitoUserPoolConfiguration":{"UserPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": -// ["a1b2c3d4e5f6g7h8i9j0kalbmc"]} +// ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": +// "MyCorp::Group"}} // // [ConfigurationItem]: https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ConfigurationItem.html // [ListIdentitySources]: https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListIdentitySources.html @@ -423,8 +426,8 @@ type CognitoUserPoolConfigurationItem struct { // This member is required. UserPoolArn *string - // The configuration of the user groups from an Amazon Cognito user pool identity - // source. + // The type of entity that a policy store maps to groups from an Amazon Cognito + // user pool identity source. GroupConfiguration *CognitoGroupConfigurationItem noSmithyDocumentSerde @@ -435,7 +438,7 @@ type CognitoUserPoolConfigurationItem struct { // At this time, the only valid member of this structure is a Amazon Cognito user // pool configuration. // -// You must specify a userPoolArn , and optionally, a ClientId . +// Specifies a userPoolArn , a groupConfiguration , and a ClientId . // // This data type is used as a request parameter for the [CreateIdentitySource] operation. // @@ -482,8 +485,8 @@ type ConfigurationDetail interface { // Contains configuration details of a Amazon Cognito user pool that Verified // Permissions can use as a source of authenticated identities as entities. It -// specifies the [Amazon Resource Name (ARN)]of a Amazon Cognito user pool and one or more application client -// IDs. +// specifies the [Amazon Resource Name (ARN)]of a Amazon Cognito user pool, the policy store entity that you +// want to assign to user groups, and one or more application client IDs. // // Example: // "configuration":{"cognitoUserPoolConfiguration":{"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds": @@ -514,8 +517,8 @@ type ConfigurationItem interface { // Contains configuration details of a Amazon Cognito user pool that Verified // Permissions can use as a source of authenticated identities as entities. It -// specifies the [Amazon Resource Name (ARN)]of a Amazon Cognito user pool and one or more application client -// IDs. +// specifies the [Amazon Resource Name (ARN)]of a Amazon Cognito user pool, the policy store entity that you +// want to assign to user groups, and one or more application client IDs. // // Example: // "configuration":{"cognitoUserPoolConfiguration":{"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds": @@ -1051,6 +1054,15 @@ type PolicyItem struct { // This member is required. PolicyType PolicyType + // The action that a policy permits or forbids. For example, {"actions": + // [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": + // "SharePhoto", "entityType": "PhotoFlash::Action"}]} . + Actions []ActionIdentifier + + // The effect of the decision that a policy returns to an authorization request. + // For example, "effect": "Permit" . + Effect PolicyEffect + // The principal associated with the policy. Principal *EntityIdentifier @@ -1288,8 +1300,7 @@ type TemplateLinkedPolicyDefinitionItem struct { noSmithyDocumentSerde } -// A list of user groups and entities from an Amazon Cognito user pool identity -// source. +// The user group entities from an Amazon Cognito user pool identity source. type UpdateCognitoGroupConfiguration struct { // The name of the schema entity type that's mapped to the user pool group.