From ffaf8904a36d03bda6387d2064356cedeb9acaaf Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Wed, 23 Oct 2024 18:25:59 +0000 Subject: [PATCH] Regenerated Clients --- .../11301a48a21247ca9b663d84a542b90e.json | 8 + .../230ccf42eb6b4c5db6111b2f995bf846.json | 8 + .../3469265be5d14ce4a589ba6b85ef2ff2.json | 8 + .../773f17803f19415db2c520ab17e2f086.json | 8 + .../8604fbaef479489882dc451a2a4eee71.json | 8 + .../e68deb83277f4cc28eee050fac42a9a3.json | 8 + .../attributevalue/go_module_metadata.go | 2 +- service/bedrock/api_op_GetImportedModel.go | 2 +- service/bedrock/types/types.go | 2 +- ...p_AssociateTrafficDistributionGroupUser.go | 6 +- .../api_op_CreateTrafficDistributionGroup.go | 3 +- .../api_op_DeleteTrafficDistributionGroup.go | 3 +- ...isassociateTrafficDistributionGroupUser.go | 6 +- service/connect/api_op_GetMetricDataV2.go | 8 +- service/connect/api_op_StartScreenSharing.go | 206 ++++++++++ service/connect/deserializers.go | 112 ++++++ service/connect/generated.json | 1 + service/connect/serializers.go | 96 +++++ .../api_op_StartScreenSharing.go.snap | 42 ++ service/connect/snapshot_test.go | 24 ++ service/connect/types/enums.go | 17 + service/connect/types/types.go | 72 ++-- service/connect/validators.go | 42 ++ service/ec2/types/enums.go | 72 ++++ service/mwaa/api_op_CreateEnvironment.go | 17 +- service/mwaa/api_op_DeleteEnvironment.go | 3 +- service/mwaa/api_op_InvokeRestApi.go | 216 +++++++++++ service/mwaa/api_op_UpdateEnvironment.go | 3 +- service/mwaa/deserializers.go | 360 ++++++++++++++++++ service/mwaa/doc.go | 11 +- service/mwaa/document/doc.go | 66 ++++ service/mwaa/document/document.go | 34 ++ service/mwaa/generated.json | 5 + service/mwaa/internal/document/document.go | 98 +++++ .../mwaa/internal/document/document_test.go | 11 + service/mwaa/serializers.go | 145 +++++++ .../snapshot/api_op_InvokeRestApi.go.snap | 42 ++ service/mwaa/snapshot_test.go | 24 ++ service/mwaa/types/enums.go | 25 ++ service/mwaa/types/errors.go | 61 +++ service/mwaa/types/types.go | 3 +- service/mwaa/validators.go | 45 +++ service/paymentcryptography/types/enums.go | 20 +- .../api_op_GeneratePinData.go | 16 +- .../api_op_TranslatePinData.go | 48 ++- .../api_op_VerifyPinData.go | 3 + .../paymentcryptographydata/serializers.go | 57 +++ .../paymentcryptographydata/types/enums.go | 67 ++++ .../paymentcryptographydata/types/types.go | 53 +++ .../types/types_exported_test.go | 4 + service/paymentcryptographydata/validators.go | 63 +++ .../internal/endpoints/endpoints.go | 192 ++++++++++ 52 files changed, 2374 insertions(+), 82 deletions(-) create mode 100644 .changelog/11301a48a21247ca9b663d84a542b90e.json create mode 100644 .changelog/230ccf42eb6b4c5db6111b2f995bf846.json create mode 100644 .changelog/3469265be5d14ce4a589ba6b85ef2ff2.json create mode 100644 .changelog/773f17803f19415db2c520ab17e2f086.json create mode 100644 .changelog/8604fbaef479489882dc451a2a4eee71.json create mode 100644 .changelog/e68deb83277f4cc28eee050fac42a9a3.json create mode 100644 service/connect/api_op_StartScreenSharing.go create mode 100644 service/connect/snapshot/api_op_StartScreenSharing.go.snap create mode 100644 service/mwaa/api_op_InvokeRestApi.go create mode 100644 service/mwaa/document/doc.go create mode 100644 service/mwaa/document/document.go create mode 100644 service/mwaa/internal/document/document.go create mode 100644 service/mwaa/internal/document/document_test.go create mode 100644 service/mwaa/snapshot/api_op_InvokeRestApi.go.snap diff --git a/.changelog/11301a48a21247ca9b663d84a542b90e.json b/.changelog/11301a48a21247ca9b663d84a542b90e.json new file mode 100644 index 00000000000..e42ae8718b9 --- /dev/null +++ b/.changelog/11301a48a21247ca9b663d84a542b90e.json @@ -0,0 +1,8 @@ +{ + "id": "11301a48-a212-47ca-9b66-3d84a542b90e", + "type": "feature", + "description": "Amazon EC2 X8g, C8g and M8g instances are powered by AWS Graviton4 processors. X8g provide the lowest cost per GiB of memory among Graviton4 instances. C8g provide the best price performance for compute-intensive workloads. M8g provide the best price performance in for general purpose workloads.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/230ccf42eb6b4c5db6111b2f995bf846.json b/.changelog/230ccf42eb6b4c5db6111b2f995bf846.json new file mode 100644 index 00000000000..78c6c2f3495 --- /dev/null +++ b/.changelog/230ccf42eb6b4c5db6111b2f995bf846.json @@ -0,0 +1,8 @@ +{ + "id": "230ccf42-eb6b-4c5d-b611-1b2f995bf846", + "type": "feature", + "description": "Add ECDH support on PIN operations.", + "modules": [ + "service/paymentcryptographydata" + ] +} \ No newline at end of file diff --git a/.changelog/3469265be5d14ce4a589ba6b85ef2ff2.json b/.changelog/3469265be5d14ce4a589ba6b85ef2ff2.json new file mode 100644 index 00000000000..e1b84e0ffd5 --- /dev/null +++ b/.changelog/3469265be5d14ce4a589ba6b85ef2ff2.json @@ -0,0 +1,8 @@ +{ + "id": "3469265b-e5d1-4ce4-a589-ba6b85ef2ff2", + "type": "documentation", + "description": "Doc updates for supporting converse", + "modules": [ + "service/bedrock" + ] +} \ No newline at end of file diff --git a/.changelog/773f17803f19415db2c520ab17e2f086.json b/.changelog/773f17803f19415db2c520ab17e2f086.json new file mode 100644 index 00000000000..7a106f6fddd --- /dev/null +++ b/.changelog/773f17803f19415db2c520ab17e2f086.json @@ -0,0 +1,8 @@ +{ + "id": "773f1780-3f19-415d-b2c5-20ab17e2f086", + "type": "feature", + "description": "Introducing InvokeRestApi which allows users to invoke the Apache Airflow REST API on the webserver with the specified inputs.", + "modules": [ + "service/mwaa" + ] +} \ No newline at end of file diff --git a/.changelog/8604fbaef479489882dc451a2a4eee71.json b/.changelog/8604fbaef479489882dc451a2a4eee71.json new file mode 100644 index 00000000000..dbaff65dcc0 --- /dev/null +++ b/.changelog/8604fbaef479489882dc451a2a4eee71.json @@ -0,0 +1,8 @@ +{ + "id": "8604fbae-f479-4898-82dc-451a2a4eee71", + "type": "feature", + "description": "Amazon Connect Service Feature: Add support to start screen sharing for a web calling contact.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/e68deb83277f4cc28eee050fac42a9a3.json b/.changelog/e68deb83277f4cc28eee050fac42a9a3.json new file mode 100644 index 00000000000..fddf175188c --- /dev/null +++ b/.changelog/e68deb83277f4cc28eee050fac42a9a3.json @@ -0,0 +1,8 @@ +{ + "id": "e68deb83-277f-4cc2-8eee-050fac42a9a3", + "type": "feature", + "description": "Add support for ECC P-256 and P-384 Keys.", + "modules": [ + "service/paymentcryptography" + ] +} \ No newline at end of file diff --git a/feature/dynamodbstreams/attributevalue/go_module_metadata.go b/feature/dynamodbstreams/attributevalue/go_module_metadata.go index 519573c6648..7a98a199477 100644 --- a/feature/dynamodbstreams/attributevalue/go_module_metadata.go +++ b/feature/dynamodbstreams/attributevalue/go_module_metadata.go @@ -3,4 +3,4 @@ package attributevalue // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.40" +const goModuleVersion = "1.15.12" diff --git a/service/bedrock/api_op_GetImportedModel.go b/service/bedrock/api_op_GetImportedModel.go index fb75c1be8b1..48330afad91 100644 --- a/service/bedrock/api_op_GetImportedModel.go +++ b/service/bedrock/api_op_GetImportedModel.go @@ -43,7 +43,7 @@ type GetImportedModelOutput struct { // Creation time of the imported model. CreationTime *time.Time - // Specifies if the imported model supports fine tuning. + // Specifies if the imported model supports converse. InstructSupported *bool // Job Amazon Resource Name (ARN) associated with the imported model. diff --git a/service/bedrock/types/types.go b/service/bedrock/types/types.go index 7d38a559db5..d07ef631d64 100644 --- a/service/bedrock/types/types.go +++ b/service/bedrock/types/types.go @@ -1222,7 +1222,7 @@ type ImportedModelSummary struct { // This member is required. ModelName *string - // Specifies if the imported model supports fine tuning. + // Specifies if the imported model supports converse. InstructSupported *bool // The architecture of the imported model. diff --git a/service/connect/api_op_AssociateTrafficDistributionGroupUser.go b/service/connect/api_op_AssociateTrafficDistributionGroupUser.go index 328002dbc2e..eb8eba0d53f 100644 --- a/service/connect/api_op_AssociateTrafficDistributionGroupUser.go +++ b/service/connect/api_op_AssociateTrafficDistributionGroupUser.go @@ -10,7 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Associates an agent with a traffic distribution group. +// Associates an agent with a traffic distribution group. This API can be called +// only in the Region where the traffic distribution group is created. func (c *Client) AssociateTrafficDistributionGroupUser(ctx context.Context, params *AssociateTrafficDistributionGroupUserInput, optFns ...func(*Options)) (*AssociateTrafficDistributionGroupUserOutput, error) { if params == nil { params = &AssociateTrafficDistributionGroupUserInput{} @@ -37,8 +38,7 @@ type AssociateTrafficDistributionGroupUserInput struct { InstanceId *string // The identifier of the traffic distribution group. This can be the ID or the ARN - // if the API is being called in the Region where the traffic distribution group - // was created. The ARN must be provided if the call is from the replicated Region. + // of the traffic distribution group. // // This member is required. TrafficDistributionGroupId *string diff --git a/service/connect/api_op_CreateTrafficDistributionGroup.go b/service/connect/api_op_CreateTrafficDistributionGroup.go index f4f6994c274..dd0447a072c 100644 --- a/service/connect/api_op_CreateTrafficDistributionGroup.go +++ b/service/connect/api_op_CreateTrafficDistributionGroup.go @@ -74,8 +74,7 @@ type CreateTrafficDistributionGroupOutput struct { Arn *string // The identifier of the traffic distribution group. This can be the ID or the ARN - // if the API is being called in the Region where the traffic distribution group - // was created. The ARN must be provided if the call is from the replicated Region. + // of the traffic distribution group. Id *string // Metadata pertaining to the operation's result. diff --git a/service/connect/api_op_DeleteTrafficDistributionGroup.go b/service/connect/api_op_DeleteTrafficDistributionGroup.go index 635564c375b..e82ff536577 100644 --- a/service/connect/api_op_DeleteTrafficDistributionGroup.go +++ b/service/connect/api_op_DeleteTrafficDistributionGroup.go @@ -35,8 +35,7 @@ func (c *Client) DeleteTrafficDistributionGroup(ctx context.Context, params *Del type DeleteTrafficDistributionGroupInput struct { // The identifier of the traffic distribution group. This can be the ID or the ARN - // if the API is being called in the Region where the traffic distribution group - // was created. The ARN must be provided if the call is from the replicated Region. + // of the traffic distribution group. // // This member is required. TrafficDistributionGroupId *string diff --git a/service/connect/api_op_DisassociateTrafficDistributionGroupUser.go b/service/connect/api_op_DisassociateTrafficDistributionGroupUser.go index 0386791f9f5..a9b96e5e068 100644 --- a/service/connect/api_op_DisassociateTrafficDistributionGroupUser.go +++ b/service/connect/api_op_DisassociateTrafficDistributionGroupUser.go @@ -10,7 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Disassociates an agent from a traffic distribution group. +// Disassociates an agent from a traffic distribution group. This API can be +// called only in the Region where the traffic distribution group is created. func (c *Client) DisassociateTrafficDistributionGroupUser(ctx context.Context, params *DisassociateTrafficDistributionGroupUserInput, optFns ...func(*Options)) (*DisassociateTrafficDistributionGroupUserOutput, error) { if params == nil { params = &DisassociateTrafficDistributionGroupUserInput{} @@ -37,8 +38,7 @@ type DisassociateTrafficDistributionGroupUserInput struct { InstanceId *string // The identifier of the traffic distribution group. This can be the ID or the ARN - // if the API is being called in the Region where the traffic distribution group - // was created. The ARN must be provided if the call is from the replicated Region. + // of the traffic distribution group. // // This member is required. TrafficDistributionGroupId *string diff --git a/service/connect/api_op_GetMetricDataV2.go b/service/connect/api_op_GetMetricDataV2.go index 8b2a8ddbee2..669b653e700 100644 --- a/service/connect/api_op_GetMetricDataV2.go +++ b/service/connect/api_op_GetMetricDataV2.go @@ -18,7 +18,7 @@ import ( // It has new metrics, offers filtering at a metric level, and offers the ability // to filter and group data by channels, queues, routing profiles, agents, and // agent hierarchy levels. It can retrieve historical data for the last 3 months, -// at varying intervals. +// at varying intervals. It does not support agent queues. // // For a description of the historical metrics that are supported by // GetMetricDataV2 and GetMetricData , see [Historical metrics definitions] in the Amazon Connect Administrator @@ -239,7 +239,7 @@ type GetMetricDataV2Input struct { // // UI name: [Average agent API connecting time] // - // The Negate key in Metric Level Filters is not applicable for this metric. + // The Negate key in metric-level filters is not applicable for this metric. // // AVG_AGENT_PAUSE_TIME Unit: Seconds // @@ -581,7 +581,7 @@ type GetMetricDataV2Input struct { // Valid groupings and filters: Queue, Channel, Routing Profile, // contact/segmentAttributes/connect:Subtype, Q in Connect // - // Threshold: For ThresholdValue enter any whole number from 1 to 604800 + // Threshold: For ThresholdValue , enter any whole number from 1 to 604800 // (inclusive), in seconds. For Comparison , you can use LT (for "Less than") or // LTE (for "Less than equal"). // @@ -824,7 +824,7 @@ type GetMetricDataV2Input struct { // // UI name: [Agent API connecting time] // - // The Negate key in Metric Level Filters is not applicable for this metric. + // The Negate key in metric-level filters is not applicable for this metric. // // CONTACTS_ABANDONED Unit: Count // diff --git a/service/connect/api_op_StartScreenSharing.go b/service/connect/api_op_StartScreenSharing.go new file mode 100644 index 00000000000..51834263f0c --- /dev/null +++ b/service/connect/api_op_StartScreenSharing.go @@ -0,0 +1,206 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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" +) + +// Starts screen sharing for a contact. For more information about screen sharing, +// see [Set up in-app, web, video calling, and screen sharing capabilities]in the Amazon Connect Administrator Guide. +// +// [Set up in-app, web, video calling, and screen sharing capabilities]: https://docs.aws.amazon.com/connect/latest/adminguide/inapp-calling.html +func (c *Client) StartScreenSharing(ctx context.Context, params *StartScreenSharingInput, optFns ...func(*Options)) (*StartScreenSharingOutput, error) { + if params == nil { + params = &StartScreenSharingInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartScreenSharing", params, optFns, c.addOperationStartScreenSharingMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartScreenSharingOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartScreenSharingInput struct { + + // The identifier of the contact in this instance of Amazon Connect. + // + // This member is required. + ContactId *string + + // The identifier of the Amazon Connect instance. You can [find the instance ID] in the Amazon Resource + // Name (ARN) of the instance. + // + // [find the instance ID]: https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html + // + // This member is required. + InstanceId *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the Amazon Web Services SDK populates this + // field. For more information about idempotency, see [Making retries safe with idempotent APIs]. + // + // [Making retries safe with idempotent APIs]: https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ + ClientToken *string + + noSmithyDocumentSerde +} + +type StartScreenSharingOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartScreenSharingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartScreenSharing{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartScreenSharing{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartScreenSharing"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opStartScreenSharingMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartScreenSharingValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartScreenSharing(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpStartScreenSharing struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpStartScreenSharing) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpStartScreenSharing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*StartScreenSharingInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *StartScreenSharingInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opStartScreenSharingMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpStartScreenSharing{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opStartScreenSharing(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartScreenSharing", + } +} diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index b9fa5b3a9ff..48d828da409 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -31084,6 +31084,109 @@ func awsRestjson1_deserializeOpDocumentStartOutboundVoiceContactOutput(v **Start return nil } +type awsRestjson1_deserializeOpStartScreenSharing struct { +} + +func (*awsRestjson1_deserializeOpStartScreenSharing) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartScreenSharing) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorStartScreenSharing(response, &metadata) + } + output := &StartScreenSharingOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartScreenSharing(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpStartTaskContact struct { } @@ -50835,6 +50938,15 @@ func awsRestjson1_deserializeDocumentParticipantCapabilities(v **types.Participa for key, value := range shape { switch key { + case "ScreenShare": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScreenShareCapability to be of type string, got %T instead", value) + } + sv.ScreenShare = types.ScreenShareCapability(jtv) + } + case "Video": if value != nil { jtv, ok := value.(string) diff --git a/service/connect/generated.json b/service/connect/generated.json index 91ca0cc07f6..f040fc22060 100644 --- a/service/connect/generated.json +++ b/service/connect/generated.json @@ -205,6 +205,7 @@ "api_op_StartContactStreaming.go", "api_op_StartOutboundChatContact.go", "api_op_StartOutboundVoiceContact.go", + "api_op_StartScreenSharing.go", "api_op_StartTaskContact.go", "api_op_StartWebRTCContact.go", "api_op_StopContact.go", diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 69ec5294a84..8cb3b8e7014 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -18522,6 +18522,97 @@ func awsRestjson1_serializeOpDocumentStartOutboundVoiceContactInput(v *StartOutb return nil } +type awsRestjson1_serializeOpStartScreenSharing struct { +} + +func (*awsRestjson1_serializeOpStartScreenSharing) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartScreenSharing) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*StartScreenSharingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/contact/screen-sharing") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + 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_serializeOpDocumentStartScreenSharingInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartScreenSharingInput(v *StartScreenSharingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartScreenSharingInput(v *StartScreenSharingInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.ContactId != nil { + ok := object.Key("ContactId") + ok.String(*v.ContactId) + } + + if v.InstanceId != nil { + ok := object.Key("InstanceId") + ok.String(*v.InstanceId) + } + + return nil +} + type awsRestjson1_serializeOpStartTaskContact struct { } @@ -27356,6 +27447,11 @@ func awsRestjson1_serializeDocumentParticipantCapabilities(v *types.ParticipantC object := value.Object() defer object.Close() + if len(v.ScreenShare) > 0 { + ok := object.Key("ScreenShare") + ok.String(string(v.ScreenShare)) + } + if len(v.Video) > 0 { ok := object.Key("Video") ok.String(string(v.Video)) diff --git a/service/connect/snapshot/api_op_StartScreenSharing.go.snap b/service/connect/snapshot/api_op_StartScreenSharing.go.snap new file mode 100644 index 00000000000..14f291380a8 --- /dev/null +++ b/service/connect/snapshot/api_op_StartScreenSharing.go.snap @@ -0,0 +1,42 @@ +StartScreenSharing + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connect/snapshot_test.go b/service/connect/snapshot_test.go index 2d46a1e2fbd..47aacc93cf8 100644 --- a/service/connect/snapshot_test.go +++ b/service/connect/snapshot_test.go @@ -2426,6 +2426,18 @@ func TestCheckSnapshot_StartOutboundVoiceContact(t *testing.T) { } } +func TestCheckSnapshot_StartScreenSharing(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartScreenSharing(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartScreenSharing") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartTaskContact(t *testing.T) { svc := New(Options{}) _, err := svc.StartTaskContact(context.Background(), nil, func(o *Options) { @@ -5497,6 +5509,18 @@ func TestUpdateSnapshot_StartOutboundVoiceContact(t *testing.T) { } } +func TestUpdateSnapshot_StartScreenSharing(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartScreenSharing(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartScreenSharing") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartTaskContact(t *testing.T) { svc := New(Options{}) _, err := svc.StartTaskContact(context.Background(), nil, func(o *Options) { diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index 1d828a931cc..b20dec0492a 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -2272,6 +2272,23 @@ func (RulePublishStatus) Values() []RulePublishStatus { } } +type ScreenShareCapability string + +// Enum values for ScreenShareCapability +const ( + ScreenShareCapabilitySend ScreenShareCapability = "SEND" +) + +// Values returns all known values for ScreenShareCapability. 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 (ScreenShareCapability) Values() []ScreenShareCapability { + return []ScreenShareCapability{ + "SEND", + } +} + type SearchableQueueType string // Enum values for SearchableQueueType diff --git a/service/connect/types/types.go b/service/connect/types/types.go index a03d78cf7cc..bdc89a27dc8 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -104,8 +104,11 @@ type AgentInfo struct { // Agent pause duration for a contact in seconds. AgentPauseDurationInSeconds *int32 - // The configuration for the allowed capabilities for participants present over - // the call. + // The configuration for the allowed video and screen sharing capabilities for + // participants present over the call. For more information, see [Set up in-app, web, video calling, and screen sharing capabilities]in the Amazon + // Connect Administrator Guide. + // + // [Set up in-app, web, video calling, and screen sharing capabilities]: https://docs.aws.amazon.com/connect/latest/adminguide/inapp-calling.html Capabilities *ParticipantCapabilities // The timestamp when the contact was connected to the agent. @@ -1470,8 +1473,11 @@ type CurrentMetricSortCriteria struct { // Information about the Customer on the contact. type Customer struct { - // The configuration for the allowed capabilities for participants present over - // the call. + // The configuration for the allowed video and screen sharing capabilities for + // participants present over the call. For more information, see [Set up in-app, web, video calling, and screen sharing capabilities]in the Amazon + // Connect Administrator Guide. + // + // [Set up in-app, web, video calling, and screen sharing capabilities]: https://docs.aws.amazon.com/connect/latest/adminguide/inapp-calling.html Capabilities *ParticipantCapabilities // Information regarding Customer’s device. @@ -3399,27 +3405,42 @@ type MetricFilterV2 struct { // The key to use for filtering data. // - // Valid metric filter keys: INITIATION_METHOD , DISCONNECT_REASON . These are the - // same values as the InitiationMethod and DisconnectReason in the contact record. - // For more information, see [ContactTraceRecord]in the Amazon Connect Administrator Guide. + // Valid metric filter keys: // - // [ContactTraceRecord]: https://docs.aws.amazon.com/connect/latest/adminguide/ctr-data-model.html#ctr-ContactTraceRecord + // - ANSWERING_MACHINE_DETECTION_STATUS + // + // - CASE_STATUS + // + // - DISCONNECT_REASON + // + // - FLOWS_ACTION_IDENTIFIER + // + // - FLOWS_NEXT_ACTION_IDENTIFIER + // + // - FLOWS_OUTCOME_TYPE + // + // - FLOWS_RESOURCE_TYPE + // + // - INITIATION_METHOD MetricFilterKey *string - // The values to use for filtering data. + // The values to use for filtering data. Values for metric-level filters can be + // either a fixed set of values or a customized list, depending on the use case. + // + // For valid values of metric-level filters INITIATION_METHOD , DISCONNECT_REASON , + // and ANSWERING_MACHINE_DETECTION_STATUS , see [ContactTraceRecord] in the Amazon Connect + // Administrator Guide. // - // Valid metric filter values for INITIATION_METHOD : INBOUND | OUTBOUND | TRANSFER - // | QUEUE_TRANSFER | CALLBACK | API | WEBRTC_API | MONITOR | DISCONNECT | - // EXTERNAL_OUTBOUND + // For valid values of the metric-level filter FLOWS_OUTCOME_TYPE , see the + // description for the [Flow outcome]metric in the Amazon Connect Administrator Guide. // - // Valid metric filter values for DISCONNECT_REASON : CUSTOMER_DISCONNECT | - // AGENT_DISCONNECT | THIRD_PARTY_DISCONNECT | TELECOM_PROBLEM | BARGED | - // CONTACT_FLOW_DISCONNECT | OTHER | EXPIRED | API + // [ContactTraceRecord]: https://docs.aws.amazon.com/connect/latest/adminguide/ctr-data-model.html#ctr-ContactTraceRecord + // [Flow outcome]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#flows-outcome-historical MetricFilterValues []string - // The flag to use to filter on requested metric filter values or to not filter on - // requested metric filter values. By default the negate is false , which indicates - // to filter on the requested metric filter. + // If set to true , the API response contains results that filter out the results + // matched by the metric-level filters condition. By default, Negate is set to + // false . Negate bool noSmithyDocumentSerde @@ -3593,12 +3614,19 @@ type OutboundCallerConfig struct { noSmithyDocumentSerde } -// The configuration for the allowed capabilities for participants present over -// the call. +// The configuration for the allowed video and screen sharing capabilities for +// participants present over the call. For more information, see [Set up in-app, web, video calling, and screen sharing capabilities]in the Amazon +// Connect Administrator Guide. +// +// [Set up in-app, web, video calling, and screen sharing capabilities]: https://docs.aws.amazon.com/connect/latest/adminguide/inapp-calling.html type ParticipantCapabilities struct { - // The configuration having the video sharing capabilities for participants over - // the call. + // The screen sharing capability that is enabled for the participant. SEND + // indicates the participant can share their screen. + ScreenShare ScreenShareCapability + + // The configuration having the video and screen sharing capabilities for + // participants over the call. Video VideoCapability noSmithyDocumentSerde diff --git a/service/connect/validators.go b/service/connect/validators.go index a28fe9c7117..dbf104f2b11 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -3890,6 +3890,26 @@ func (m *validateOpStartOutboundVoiceContact) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpStartScreenSharing struct { +} + +func (*validateOpStartScreenSharing) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartScreenSharing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartScreenSharingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartScreenSharingInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartTaskContact struct { } @@ -5846,6 +5866,10 @@ func addOpStartOutboundVoiceContactValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpStartOutboundVoiceContact{}, middleware.After) } +func addOpStartScreenSharingValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartScreenSharing{}, middleware.After) +} + func addOpStartTaskContactValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartTaskContact{}, middleware.After) } @@ -11474,6 +11498,24 @@ func validateOpStartOutboundVoiceContactInput(v *StartOutboundVoiceContactInput) } } +func validateOpStartScreenSharingInput(v *StartScreenSharingInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartScreenSharingInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.ContactId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContactId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartTaskContactInput(v *StartTaskContactInput) error { if v == nil { return nil diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 17519b46863..558bf7229af 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -4022,6 +4022,42 @@ const ( InstanceTypeG6e16xlarge InstanceType = "g6e.16xlarge" InstanceTypeG6e24xlarge InstanceType = "g6e.24xlarge" InstanceTypeG6e48xlarge InstanceType = "g6e.48xlarge" + InstanceTypeC8gMedium InstanceType = "c8g.medium" + InstanceTypeC8gLarge InstanceType = "c8g.large" + InstanceTypeC8gXlarge InstanceType = "c8g.xlarge" + InstanceTypeC8g2xlarge InstanceType = "c8g.2xlarge" + InstanceTypeC8g4xlarge InstanceType = "c8g.4xlarge" + InstanceTypeC8g8xlarge InstanceType = "c8g.8xlarge" + InstanceTypeC8g12xlarge InstanceType = "c8g.12xlarge" + InstanceTypeC8g16xlarge InstanceType = "c8g.16xlarge" + InstanceTypeC8g24xlarge InstanceType = "c8g.24xlarge" + InstanceTypeC8g48xlarge InstanceType = "c8g.48xlarge" + InstanceTypeC8gMetal24xl InstanceType = "c8g.metal-24xl" + InstanceTypeC8gMetal48xl InstanceType = "c8g.metal-48xl" + InstanceTypeM8gMedium InstanceType = "m8g.medium" + InstanceTypeM8gLarge InstanceType = "m8g.large" + InstanceTypeM8gXlarge InstanceType = "m8g.xlarge" + InstanceTypeM8g2xlarge InstanceType = "m8g.2xlarge" + InstanceTypeM8g4xlarge InstanceType = "m8g.4xlarge" + InstanceTypeM8g8xlarge InstanceType = "m8g.8xlarge" + InstanceTypeM8g12xlarge InstanceType = "m8g.12xlarge" + InstanceTypeM8g16xlarge InstanceType = "m8g.16xlarge" + InstanceTypeM8g24xlarge InstanceType = "m8g.24xlarge" + InstanceTypeM8g48xlarge InstanceType = "m8g.48xlarge" + InstanceTypeM8gMetal24xl InstanceType = "m8g.metal-24xl" + InstanceTypeM8gMetal48xl InstanceType = "m8g.metal-48xl" + InstanceTypeX8gMedium InstanceType = "x8g.medium" + InstanceTypeX8gLarge InstanceType = "x8g.large" + InstanceTypeX8gXlarge InstanceType = "x8g.xlarge" + InstanceTypeX8g2xlarge InstanceType = "x8g.2xlarge" + InstanceTypeX8g4xlarge InstanceType = "x8g.4xlarge" + InstanceTypeX8g8xlarge InstanceType = "x8g.8xlarge" + InstanceTypeX8g12xlarge InstanceType = "x8g.12xlarge" + InstanceTypeX8g16xlarge InstanceType = "x8g.16xlarge" + InstanceTypeX8g24xlarge InstanceType = "x8g.24xlarge" + InstanceTypeX8g48xlarge InstanceType = "x8g.48xlarge" + InstanceTypeX8gMetal24xl InstanceType = "x8g.metal-24xl" + InstanceTypeX8gMetal48xl InstanceType = "x8g.metal-48xl" ) // Values returns all known values for InstanceType. Note that this can be @@ -4858,6 +4894,42 @@ func (InstanceType) Values() []InstanceType { "g6e.16xlarge", "g6e.24xlarge", "g6e.48xlarge", + "c8g.medium", + "c8g.large", + "c8g.xlarge", + "c8g.2xlarge", + "c8g.4xlarge", + "c8g.8xlarge", + "c8g.12xlarge", + "c8g.16xlarge", + "c8g.24xlarge", + "c8g.48xlarge", + "c8g.metal-24xl", + "c8g.metal-48xl", + "m8g.medium", + "m8g.large", + "m8g.xlarge", + "m8g.2xlarge", + "m8g.4xlarge", + "m8g.8xlarge", + "m8g.12xlarge", + "m8g.16xlarge", + "m8g.24xlarge", + "m8g.48xlarge", + "m8g.metal-24xl", + "m8g.metal-48xl", + "x8g.medium", + "x8g.large", + "x8g.xlarge", + "x8g.2xlarge", + "x8g.4xlarge", + "x8g.8xlarge", + "x8g.12xlarge", + "x8g.16xlarge", + "x8g.24xlarge", + "x8g.48xlarge", + "x8g.metal-24xl", + "x8g.metal-48xl", } } diff --git a/service/mwaa/api_op_CreateEnvironment.go b/service/mwaa/api_op_CreateEnvironment.go index 34e77eaabdb..02a86fae593 100644 --- a/service/mwaa/api_op_CreateEnvironment.go +++ b/service/mwaa/api_op_CreateEnvironment.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates an Amazon Managed Workflows for Apache Airflow (MWAA) environment. +// Creates an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) +// environment. func (c *Client) CreateEnvironment(ctx context.Context, params *CreateEnvironmentInput, optFns ...func(*Options)) (*CreateEnvironmentOutput, error) { if params == nil { params = &CreateEnvironmentInput{} @@ -27,9 +28,9 @@ func (c *Client) CreateEnvironment(ctx context.Context, params *CreateEnvironmen return out, nil } -// This section contains the Amazon Managed Workflows for Apache Airflow (MWAA) -// API reference documentation to create an environment. For more information, see [Get started with Amazon Managed Workflows for Apache Airflow] -// . +// This section contains the Amazon Managed Workflows for Apache Airflow (Amazon +// MWAA) API reference documentation to create an environment. For more +// information, see [Get started with Amazon Managed Workflows for Apache Airflow]. // // [Get started with Amazon Managed Workflows for Apache Airflow]: https://docs.aws.amazon.com/mwaa/latest/userguide/get-started.html type CreateEnvironmentInput struct { @@ -83,12 +84,12 @@ type CreateEnvironmentInput struct { AirflowConfigurationOptions map[string]string // The Apache Airflow version for your environment. If no value is specified, it - // defaults to the latest version. For more information, see [Apache Airflow versions on Amazon Managed Workflows for Apache Airflow (MWAA)]. + // defaults to the latest version. For more information, see [Apache Airflow versions on Amazon Managed Workflows for Apache Airflow (Amazon MWAA)]. // - // Valid values: 1.10.12 , 2.0.2 , 2.2.2 , 2.4.3 , 2.5.1 , 2.6.3 , 2.7.2 - // 2.8.1 + // Valid values: 1.10.12 , 2.0.2 , 2.2.2 , 2.4.3 , 2.5.1 , 2.6.3 , 2.7.2 , 2.8.1 , + // 2.9.2 , and 2.10.1 . // - // [Apache Airflow versions on Amazon Managed Workflows for Apache Airflow (MWAA)]: https://docs.aws.amazon.com/mwaa/latest/userguide/airflow-versions.html + // [Apache Airflow versions on Amazon Managed Workflows for Apache Airflow (Amazon MWAA)]: https://docs.aws.amazon.com/mwaa/latest/userguide/airflow-versions.html AirflowVersion *string // Defines whether the VPC endpoints configured for the environment are created, diff --git a/service/mwaa/api_op_DeleteEnvironment.go b/service/mwaa/api_op_DeleteEnvironment.go index a31a96b666d..f250b176e68 100644 --- a/service/mwaa/api_op_DeleteEnvironment.go +++ b/service/mwaa/api_op_DeleteEnvironment.go @@ -10,7 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an Amazon Managed Workflows for Apache Airflow (MWAA) environment. +// Deletes an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) +// environment. func (c *Client) DeleteEnvironment(ctx context.Context, params *DeleteEnvironmentInput, optFns ...func(*Options)) (*DeleteEnvironmentOutput, error) { if params == nil { params = &DeleteEnvironmentInput{} diff --git a/service/mwaa/api_op_InvokeRestApi.go b/service/mwaa/api_op_InvokeRestApi.go new file mode 100644 index 00000000000..0a6b2a8b739 --- /dev/null +++ b/service/mwaa/api_op_InvokeRestApi.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mwaa + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/mwaa/document" + "github.com/aws/aws-sdk-go-v2/service/mwaa/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Invokes the Apache Airflow REST API on the webserver with the specified inputs. +// To learn more, see [Using the Apache Airflow REST API] +// +// [Using the Apache Airflow REST API]: https://docs.aws.amazon.com/mwaa/latest/userguide/access-mwaa-apache-airflow-rest-api.html +func (c *Client) InvokeRestApi(ctx context.Context, params *InvokeRestApiInput, optFns ...func(*Options)) (*InvokeRestApiOutput, error) { + if params == nil { + params = &InvokeRestApiInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "InvokeRestApi", params, optFns, c.addOperationInvokeRestApiMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*InvokeRestApiOutput) + out.ResultMetadata = metadata + return out, nil +} + +type InvokeRestApiInput struct { + + // The HTTP method used for making Airflow REST API calls. For example, POST . + // + // This member is required. + Method types.RestApiMethod + + // The name of the Amazon MWAA environment. For example, MyMWAAEnvironment . + // + // This member is required. + Name *string + + // The Apache Airflow REST API endpoint path to be called. For example, + // /dags/123456/clearTaskInstances . For more information, see [Apache Airflow API] + // + // [Apache Airflow API]: https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html + // + // This member is required. + Path *string + + // The request body for the Apache Airflow REST API call, provided as a JSON + // object. + Body document.Interface + + // Query parameters to be included in the Apache Airflow REST API call, provided + // as a JSON object. + QueryParameters document.Interface + + noSmithyDocumentSerde +} + +type InvokeRestApiOutput struct { + + // The response data from the Apache Airflow REST API call, provided as a JSON + // object. + RestApiResponse document.Interface + + // The HTTP status code returned by the Apache Airflow REST API call. + RestApiStatusCode *int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationInvokeRestApiMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpInvokeRestApi{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpInvokeRestApi{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "InvokeRestApi"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addEndpointPrefix_opInvokeRestApiMiddleware(stack); err != nil { + return err + } + if err = addOpInvokeRestApiValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInvokeRestApi(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opInvokeRestApiMiddleware struct { +} + +func (*endpointPrefix_opInvokeRestApiMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opInvokeRestApiMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "env." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opInvokeRestApiMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opInvokeRestApiMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opInvokeRestApi(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "InvokeRestApi", + } +} diff --git a/service/mwaa/api_op_UpdateEnvironment.go b/service/mwaa/api_op_UpdateEnvironment.go index 05ee4f1e3f9..8c73763af4c 100644 --- a/service/mwaa/api_op_UpdateEnvironment.go +++ b/service/mwaa/api_op_UpdateEnvironment.go @@ -47,7 +47,8 @@ type UpdateEnvironmentInput struct { // and other resources used in your workflows are compatible with the new Apache // Airflow version. For more information about updating your resources, see [Upgrading an Amazon MWAA environment]. // - // Valid values: 1.10.12 , 2.0.2 , 2.2.2 , 2.4.3 , 2.5.1 , 2.6.3 , 2.7.2 , 2.8.1 . + // Valid values: 1.10.12 , 2.0.2 , 2.2.2 , 2.4.3 , 2.5.1 , 2.6.3 , 2.7.2 , 2.8.1 , + // 2.9.2 , and 2.10.1 . // // [Upgrading an Amazon MWAA environment]: https://docs.aws.amazon.com/mwaa/latest/userguide/upgrading-environment.html AirflowVersion *string diff --git a/service/mwaa/deserializers.go b/service/mwaa/deserializers.go index 56bdb7a5dde..9caff0659e7 100644 --- a/service/mwaa/deserializers.go +++ b/service/mwaa/deserializers.go @@ -8,6 +8,8 @@ import ( "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/mwaa/document" + internaldocument "github.com/aws/aws-sdk-go-v2/service/mwaa/internal/document" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" @@ -797,6 +799,186 @@ func awsRestjson1_deserializeOpDocumentGetEnvironmentOutput(v **GetEnvironmentOu return nil } +type awsRestjson1_deserializeOpInvokeRestApi struct { +} + +func (*awsRestjson1_deserializeOpInvokeRestApi) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpInvokeRestApi) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorInvokeRestApi(response, &metadata) + } + output := &InvokeRestApiOutput{} + 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_deserializeOpDocumentInvokeRestApiOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorInvokeRestApi(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("RestApiClientException", errorCode): + return awsRestjson1_deserializeErrorRestApiClientException(response, errorBody) + + case strings.EqualFold("RestApiServerException", errorCode): + return awsRestjson1_deserializeErrorRestApiServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentInvokeRestApiOutput(v **InvokeRestApiOutput, 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 *InvokeRestApiOutput + if *v == nil { + sv = &InvokeRestApiOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RestApiResponse": + if err := awsRestjson1_deserializeDocumentRestApiResponse(&sv.RestApiResponse, value); err != nil { + return err + } + + case "RestApiStatusCode": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RestApiStatusCode = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListEnvironments struct { } @@ -1668,6 +1850,78 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp return output } +func awsRestjson1_deserializeErrorRestApiClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RestApiClientException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentRestApiClientException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorRestApiServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RestApiServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentRestApiServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} var buff [1024]byte @@ -2465,6 +2719,112 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsRestjson1_deserializeDocumentRestApiClientException(v **types.RestApiClientException, 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.RestApiClientException + if *v == nil { + sv = &types.RestApiClientException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RestApiResponse": + if err := awsRestjson1_deserializeDocumentRestApiResponse(&sv.RestApiResponse, value); err != nil { + return err + } + + case "RestApiStatusCode": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RestApiStatusCode = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRestApiResponse(v *document.Interface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + *v = internaldocument.NewDocumentUnmarshaler(value) + return nil +} + +func awsRestjson1_deserializeDocumentRestApiServerException(v **types.RestApiServerException, 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.RestApiServerException + if *v == nil { + sv = &types.RestApiServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RestApiResponse": + if err := awsRestjson1_deserializeDocumentRestApiResponse(&sv.RestApiResponse, value); err != nil { + return err + } + + case "RestApiStatusCode": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RestApiStatusCode = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentSecurityGroupList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/mwaa/doc.go b/service/mwaa/doc.go index 86f3eeb3500..80ccd894a28 100644 --- a/service/mwaa/doc.go +++ b/service/mwaa/doc.go @@ -36,21 +36,24 @@ // // [CreateWebLoginToken] // +// [InvokeRestApi] +// // # Regions // // For a list of supported regions, see [Amazon MWAA endpoints and quotas] in the Amazon Web Services General // Reference. // -// [CreateWebLoginToken]: https://docs.aws.amazon.com/mwaa/latest/API/API_CreateWebLoginToken.html -// [CreateEnvironment]: https://docs.aws.amazon.com/mwaa/latest/API/API_CreateEnvironment.html // [GetEnvironment]: https://docs.aws.amazon.com/mwaa/latest/API/API_GetEnvironment.html // [ListEnvironments]: https://docs.aws.amazon.com/mwaa/latest/API/API_ListEnvironments.html +// [TagResource]: https://docs.aws.amazon.com/mwaa/latest/API/API_TagResource.html +// [InvokeRestApi]: https://docs.aws.amazon.com/mwaa/latest/API/API_InvokeRestApi.html +// [CreateCliToken]: https://docs.aws.amazon.com/mwaa/latest/API/API_CreateCliToken.html +// [CreateWebLoginToken]: https://docs.aws.amazon.com/mwaa/latest/API/API_CreateWebLoginToken.html +// [CreateEnvironment]: https://docs.aws.amazon.com/mwaa/latest/API/API_CreateEnvironment.html // [Amazon MWAA endpoints and quotas]: https://docs.aws.amazon.com/general/latest/gr/mwaa.html // [DeleteEnvironment]: https://docs.aws.amazon.com/mwaa/latest/API/API_DeleteEnvironment.html -// [TagResource]: https://docs.aws.amazon.com/mwaa/latest/API/API_TagResource.html // [UntagResource]: https://docs.aws.amazon.com/mwaa/latest/API/API_UntagResource.html // [What is Amazon MWAA?]: https://docs.aws.amazon.com/mwaa/latest/userguide/what-is-mwaa.html // [UpdateEnvironment]: https://docs.aws.amazon.com/mwaa/latest/API/API_UpdateEnvironment.html // [ListTagsForResource]: https://docs.aws.amazon.com/mwaa/latest/API/API_ListTagsForResource.html -// [CreateCliToken]: https://docs.aws.amazon.com/mwaa/latest/API/API_CreateCliToken.html package mwaa diff --git a/service/mwaa/document/doc.go b/service/mwaa/document/doc.go new file mode 100644 index 00000000000..2b06b14f3cd --- /dev/null +++ b/service/mwaa/document/doc.go @@ -0,0 +1,66 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package document implements encoding and decoding of open-content that has a JSON-like data model. +// This data-model allows for UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a +// map of UTF-8 strings to these values. +// +// Interface defines the semantics for how a document type is marshalled and unmarshalled for requests and responses +// for the service. To send a document as input to the service you use NewLazyDocument and pass it the Go type to be +// sent to the service. NewLazyDocument returns a document Interface type that encodes the provided Go type during +// the request serialization step after you have invoked an API client operation that uses the document type. +// +// The following examples show how you can create document types using basic Go types. +// +// NewLazyDocument(map[string]interface{}{ +// "favoriteNumber": 42, +// "fruits": []string{"apple", "orange"}, +// "capitals": map[string]interface{}{ +// "Washington": "Olympia", +// "Oregon": "Salem", +// }, +// "skyIsBlue": true, +// }) +// +// NewLazyDocument(3.14159) +// +// NewLazyDocument([]interface{"One", 2, 3, 3.5, "four"}) +// +// NewLazyDocument(true) +// +// Services can send document types as part of their API responses. To retrieve the content of a response document +// you use the UnmarshalSmithyDocument method on the response document. When calling UnmarshalSmithyDocument you pass +// a reference to the Go type that you want to unmarshal and map the response to. +// +// For example, if you expect to receive key/value map from the service response: +// +// var kv map[string]interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&kv); err != nil { +// // handle error +// } +// +// If a service can return one or more data-types in the response, you can use an empty interface and type switch to +// dynamically handle the response type. +// +// var v interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&v); err != nil { +// // handle error +// } +// +// switch vv := v.(type) { +// case map[string]interface{}: +// // handle key/value map +// case []interface{}: +// // handle array of values +// case bool: +// // handle boolean +// case document.Number: +// // handle an arbitrary precision number +// case string: +// // handle string +// default: +// // handle unknown case +// } +// +// The mapping of Go types to document types is covered in more depth in https://pkg.go.dev/github.com/aws/smithy-go/document +// including more in depth examples that cover user-defined structure types. +package document diff --git a/service/mwaa/document/document.go b/service/mwaa/document/document.go new file mode 100644 index 00000000000..d1b2d8075ab --- /dev/null +++ b/service/mwaa/document/document.go @@ -0,0 +1,34 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + internaldocument "github.com/aws/aws-sdk-go-v2/service/mwaa/internal/document" +) + +// Interface defines a document which is a protocol-agnostic type which supports a +// JSON-like data-model. You can use this type to send UTF-8 strings, arbitrary +// precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 +// strings to these values. +// +// You create a document type using the NewLazyDocument function and passing it +// the Go type to marshal. When receiving a document in an API response, you use +// the document's UnmarshalSmithyDocument function to decode the response to your +// desired Go type. Unless documented specifically generated structure types in +// client packages or client types packages are not supported at this time. Such +// types embed a noSmithyDocumentSerde and will cause an error to be returned when +// attempting to send an API request. +// +// For more information see the accompanying package documentation and linked +// references. +type Interface = internaldocument.Interface + +// You create document type using the NewLazyDocument function and passing it the +// Go type to be marshaled and sent to the service. The document marshaler supports +// semantics similar to the encoding/json Go standard library. +// +// For more information see the accompanying package documentation and linked +// references. +func NewLazyDocument(v interface{}) Interface { + return internaldocument.NewDocumentMarshaler(v) +} diff --git a/service/mwaa/generated.json b/service/mwaa/generated.json index c676b5453d4..a62ead233c1 100644 --- a/service/mwaa/generated.json +++ b/service/mwaa/generated.json @@ -13,6 +13,7 @@ "api_op_CreateWebLoginToken.go", "api_op_DeleteEnvironment.go", "api_op_GetEnvironment.go", + "api_op_InvokeRestApi.go", "api_op_ListEnvironments.go", "api_op_ListTagsForResource.go", "api_op_PublishMetrics.go", @@ -22,10 +23,14 @@ "auth.go", "deserializers.go", "doc.go", + "document/doc.go", + "document/document.go", "endpoints.go", "endpoints_config_test.go", "endpoints_test.go", "generated.json", + "internal/document/document.go", + "internal/document/document_test.go", "internal/endpoints/endpoints.go", "internal/endpoints/endpoints_test.go", "options.go", diff --git a/service/mwaa/internal/document/document.go b/service/mwaa/internal/document/document.go new file mode 100644 index 00000000000..1852263ded7 --- /dev/null +++ b/service/mwaa/internal/document/document.go @@ -0,0 +1,98 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + "bytes" + "encoding/json" + smithydocument "github.com/aws/smithy-go/document" + smithydocumentjson "github.com/aws/smithy-go/document/json" +) + +// github.com/aws/aws-sdk-go-v2/service/mwaa/internal/document.smithyDocument is +// an interface which is used to bind a document type to its service client. +type smithyDocument interface { + isSmithyDocument() +} + +// github.com/aws/aws-sdk-go-v2/service/mwaa/internal/document.Interface is a +// JSON-like data model type that is protocol agnostic and is usedto send +// open-content to a service. +type Interface interface { + smithyDocument + smithydocument.Marshaler + smithydocument.Unmarshaler +} + +type documentMarshaler struct { + value interface{} +} + +func (m *documentMarshaler) UnmarshalSmithyDocument(v interface{}) error { + mBytes, err := m.MarshalSmithyDocument() + if err != nil { + return err + } + + jDecoder := json.NewDecoder(bytes.NewReader(mBytes)) + jDecoder.UseNumber() + + var jv interface{} + if err := jDecoder.Decode(&v); err != nil { + return err + } + + return NewDocumentUnmarshaler(v).UnmarshalSmithyDocument(&jv) +} + +func (m *documentMarshaler) MarshalSmithyDocument() ([]byte, error) { + return smithydocumentjson.NewEncoder().Encode(m.value) +} + +func (m *documentMarshaler) isSmithyDocument() {} + +var _ Interface = (*documentMarshaler)(nil) + +type documentUnmarshaler struct { + value interface{} +} + +func (m *documentUnmarshaler) UnmarshalSmithyDocument(v interface{}) error { + decoder := smithydocumentjson.NewDecoder() + return decoder.DecodeJSONInterface(m.value, v) +} + +func (m *documentUnmarshaler) MarshalSmithyDocument() ([]byte, error) { + return json.Marshal(m.value) +} + +func (m *documentUnmarshaler) isSmithyDocument() {} + +var _ Interface = (*documentUnmarshaler)(nil) + +// NewDocumentMarshaler creates a new document marshaler for the given input type +func NewDocumentMarshaler(v interface{}) Interface { + return &documentMarshaler{ + value: v, + } +} + +// NewDocumentUnmarshaler creates a new document unmarshaler for the given service +// response +func NewDocumentUnmarshaler(v interface{}) Interface { + return &documentUnmarshaler{ + value: v, + } +} + +// github.com/aws/aws-sdk-go-v2/service/mwaa/internal/document.IsInterface returns +// whether the given Interface implementation is a valid client implementation +func IsInterface(v Interface) (ok bool) { + defer func() { + if err := recover(); err != nil { + ok = false + } + }() + v.isSmithyDocument() + return true +} diff --git a/service/mwaa/internal/document/document_test.go b/service/mwaa/internal/document/document_test.go new file mode 100644 index 00000000000..775645dcd6e --- /dev/null +++ b/service/mwaa/internal/document/document_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +var _ smithyDocument = (Interface)(nil) +var _ smithydocument.Marshaler = (Interface)(nil) +var _ smithydocument.Unmarshaler = (Interface)(nil) diff --git a/service/mwaa/serializers.go b/service/mwaa/serializers.go index 3d387e27f0f..71700c63353 100644 --- a/service/mwaa/serializers.go +++ b/service/mwaa/serializers.go @@ -6,6 +6,8 @@ import ( "bytes" "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/mwaa/document" + internaldocument "github.com/aws/aws-sdk-go-v2/service/mwaa/internal/document" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" @@ -518,6 +520,119 @@ func awsRestjson1_serializeOpHttpBindingsGetEnvironmentInput(v *GetEnvironmentIn return nil } +type awsRestjson1_serializeOpInvokeRestApi struct { +} + +func (*awsRestjson1_serializeOpInvokeRestApi) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpInvokeRestApi) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*InvokeRestApiInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/restapi/{Name}") + 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} + } + + if err := awsRestjson1_serializeOpHttpBindingsInvokeRestApiInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentInvokeRestApiInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsInvokeRestApiInput(v *InvokeRestApiInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentInvokeRestApiInput(v *InvokeRestApiInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Body != nil { + ok := object.Key("Body") + if err := awsRestjson1_serializeDocumentRestApiRequestBody(v.Body, ok); err != nil { + return err + } + } + + if len(v.Method) > 0 { + ok := object.Key("Method") + ok.String(string(v.Method)) + } + + if v.Path != nil { + ok := object.Key("Path") + ok.String(*v.Path) + } + + if v.QueryParameters != nil { + ok := object.Key("QueryParameters") + if err := awsRestjson1_serializeDocumentDocument(v.QueryParameters, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListEnvironments struct { } @@ -1316,6 +1431,21 @@ func awsRestjson1_serializeDocumentNetworkConfiguration(v *types.NetworkConfigur return nil } +func awsRestjson1_serializeDocumentRestApiRequestBody(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_serializeDocumentSecurityGroupList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1428,3 +1558,18 @@ func awsRestjson1_serializeDocumentUpdateNetworkConfigurationInput(v *types.Upda return nil } + +func awsRestjson1_serializeDocumentDocument(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 +} diff --git a/service/mwaa/snapshot/api_op_InvokeRestApi.go.snap b/service/mwaa/snapshot/api_op_InvokeRestApi.go.snap new file mode 100644 index 00000000000..8b3eb7d7f62 --- /dev/null +++ b/service/mwaa/snapshot/api_op_InvokeRestApi.go.snap @@ -0,0 +1,42 @@ +InvokeRestApi + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + EndpointHostPrefix + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/mwaa/snapshot_test.go b/service/mwaa/snapshot_test.go index e880092e075..e1b7a7296e4 100644 --- a/service/mwaa/snapshot_test.go +++ b/service/mwaa/snapshot_test.go @@ -122,6 +122,18 @@ func TestCheckSnapshot_GetEnvironment(t *testing.T) { } } +func TestCheckSnapshot_InvokeRestApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.InvokeRestApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "InvokeRestApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListEnvironments(t *testing.T) { svc := New(Options{}) _, err := svc.ListEnvironments(context.Background(), nil, func(o *Options) { @@ -253,6 +265,18 @@ func TestUpdateSnapshot_GetEnvironment(t *testing.T) { } } +func TestUpdateSnapshot_InvokeRestApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.InvokeRestApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "InvokeRestApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListEnvironments(t *testing.T) { svc := New(Options{}) _, err := svc.ListEnvironments(context.Background(), nil, func(o *Options) { diff --git a/service/mwaa/types/enums.go b/service/mwaa/types/enums.go index a244e43ab65..ded8c198321 100644 --- a/service/mwaa/types/enums.go +++ b/service/mwaa/types/enums.go @@ -85,6 +85,31 @@ func (LoggingLevel) Values() []LoggingLevel { } } +type RestApiMethod string + +// Enum values for RestApiMethod +const ( + RestApiMethodGet RestApiMethod = "GET" + RestApiMethodPut RestApiMethod = "PUT" + RestApiMethodPost RestApiMethod = "POST" + RestApiMethodPatch RestApiMethod = "PATCH" + RestApiMethodDelete RestApiMethod = "DELETE" +) + +// Values returns all known values for RestApiMethod. 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 (RestApiMethod) Values() []RestApiMethod { + return []RestApiMethod{ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + } +} + type Unit string // Enum values for Unit diff --git a/service/mwaa/types/errors.go b/service/mwaa/types/errors.go index 7640b307bed..778e9acb653 100644 --- a/service/mwaa/types/errors.go +++ b/service/mwaa/types/errors.go @@ -4,6 +4,7 @@ package types import ( "fmt" + "github.com/aws/aws-sdk-go-v2/service/mwaa/document" smithy "github.com/aws/smithy-go" ) @@ -88,6 +89,66 @@ func (e *ResourceNotFoundException) ErrorCode() string { } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// An exception indicating that a client-side error occurred during the Apache +// Airflow REST API call. +type RestApiClientException struct { + Message *string + + ErrorCodeOverride *string + + RestApiStatusCode *int32 + RestApiResponse document.Interface + + noSmithyDocumentSerde +} + +func (e *RestApiClientException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RestApiClientException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RestApiClientException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RestApiClientException" + } + return *e.ErrorCodeOverride +} +func (e *RestApiClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An exception indicating that a server-side error occurred during the Apache +// Airflow REST API call. +type RestApiServerException struct { + Message *string + + ErrorCodeOverride *string + + RestApiStatusCode *int32 + RestApiResponse document.Interface + + noSmithyDocumentSerde +} + +func (e *RestApiServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RestApiServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RestApiServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RestApiServerException" + } + return *e.ErrorCodeOverride +} +func (e *RestApiServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // ValidationException: The provided input is not valid. type ValidationException struct { Message *string diff --git a/service/mwaa/types/types.go b/service/mwaa/types/types.go index 1ffecac1f2c..fb777fa4e24 100644 --- a/service/mwaa/types/types.go +++ b/service/mwaa/types/types.go @@ -38,7 +38,8 @@ type Environment struct { // The Apache Airflow version on your environment. // - // Valid values: 1.10.12 , 2.0.2 , 2.2.2 , 2.4.3 , 2.5.1 , 2.6.3 , 2.7.2 , 2.8.1 . + // Valid values: 1.10.12 , 2.0.2 , 2.2.2 , 2.4.3 , 2.5.1 , 2.6.3 , 2.7.2 , 2.8.1 , + // 2.9.2 , and 2.10.1 . AirflowVersion *string // The Amazon Resource Name (ARN) of the Amazon MWAA environment. diff --git a/service/mwaa/validators.go b/service/mwaa/validators.go index 62c924956b0..944b94d7091 100644 --- a/service/mwaa/validators.go +++ b/service/mwaa/validators.go @@ -110,6 +110,26 @@ func (m *validateOpGetEnvironment) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpInvokeRestApi struct { +} + +func (*validateOpInvokeRestApi) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpInvokeRestApi) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*InvokeRestApiInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpInvokeRestApiInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -230,6 +250,10 @@ func addOpGetEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEnvironment{}, middleware.After) } +func addOpInvokeRestApiValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpInvokeRestApi{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -487,6 +511,27 @@ func validateOpGetEnvironmentInput(v *GetEnvironmentInput) error { } } +func validateOpInvokeRestApiInput(v *InvokeRestApiInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InvokeRestApiInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Path == nil { + invalidParams.Add(smithy.NewErrParamRequired("Path")) + } + if len(v.Method) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Method")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil diff --git a/service/paymentcryptography/types/enums.go b/service/paymentcryptography/types/enums.go index 622ef083fe3..ad1bbc67fc8 100644 --- a/service/paymentcryptography/types/enums.go +++ b/service/paymentcryptography/types/enums.go @@ -6,14 +6,16 @@ type KeyAlgorithm string // Enum values for KeyAlgorithm const ( - KeyAlgorithmTdes2key KeyAlgorithm = "TDES_2KEY" - KeyAlgorithmTdes3key KeyAlgorithm = "TDES_3KEY" - KeyAlgorithmAes128 KeyAlgorithm = "AES_128" - KeyAlgorithmAes192 KeyAlgorithm = "AES_192" - KeyAlgorithmAes256 KeyAlgorithm = "AES_256" - KeyAlgorithmRsa2048 KeyAlgorithm = "RSA_2048" - KeyAlgorithmRsa3072 KeyAlgorithm = "RSA_3072" - KeyAlgorithmRsa4096 KeyAlgorithm = "RSA_4096" + KeyAlgorithmTdes2key KeyAlgorithm = "TDES_2KEY" + KeyAlgorithmTdes3key KeyAlgorithm = "TDES_3KEY" + KeyAlgorithmAes128 KeyAlgorithm = "AES_128" + KeyAlgorithmAes192 KeyAlgorithm = "AES_192" + KeyAlgorithmAes256 KeyAlgorithm = "AES_256" + KeyAlgorithmRsa2048 KeyAlgorithm = "RSA_2048" + KeyAlgorithmRsa3072 KeyAlgorithm = "RSA_3072" + KeyAlgorithmRsa4096 KeyAlgorithm = "RSA_4096" + KeyAlgorithmEccNistP256 KeyAlgorithm = "ECC_NIST_P256" + KeyAlgorithmEccNistP384 KeyAlgorithm = "ECC_NIST_P384" ) // Values returns all known values for KeyAlgorithm. Note that this can be @@ -30,6 +32,8 @@ func (KeyAlgorithm) Values() []KeyAlgorithm { "RSA_2048", "RSA_3072", "RSA_4096", + "ECC_NIST_P256", + "ECC_NIST_P384", } } diff --git a/service/paymentcryptographydata/api_op_GeneratePinData.go b/service/paymentcryptographydata/api_op_GeneratePinData.go index fdf48cec12b..1b58ae3dc06 100644 --- a/service/paymentcryptographydata/api_op_GeneratePinData.go +++ b/service/paymentcryptographydata/api_op_GeneratePinData.go @@ -21,6 +21,13 @@ import ( // transmission from Amazon Web Services Payment Cryptography. This operation uses // a separate Pin Verification Key (PVK) for VISA PVV generation. // +// Using ECDH key exchange, you can receive cardholder selectable PINs into Amazon +// Web Services Payment Cryptography. The ECDH derived key protects the incoming +// PIN block. You can also use it for reveal PIN, wherein the generated PIN block +// is protected by the ECDH derived key before transmission from Amazon Web +// Services Payment Cryptography. For more information on establishing ECDH derived +// keys, see the [Generating keys]in the Amazon Web Services Payment Cryptography User Guide. +// // For information about valid keys for this operation, see [Understanding key attributes] and [Key types for specific data operations] in the Amazon // Web Services Payment Cryptography User Guide. // @@ -38,6 +45,7 @@ import ( // [Generate PIN data]: https://docs.aws.amazon.com/payment-cryptography/latest/userguide/generate-pin-data.html // [Key types for specific data operations]: https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html // [Understanding key attributes]: https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html +// [Generating keys]: https://docs.aws.amazon.com/payment-cryptography/latest/userguide/create-keys.html func (c *Client) GeneratePinData(ctx context.Context, params *GeneratePinDataInput, optFns ...func(*Options)) (*GeneratePinDataOutput, error) { if params == nil { params = &GeneratePinDataInput{} @@ -56,7 +64,7 @@ func (c *Client) GeneratePinData(ctx context.Context, params *GeneratePinDataInp type GeneratePinDataInput struct { // The keyARN of the PEK that Amazon Web Services Payment Cryptography uses to - // encrypt the PIN Block. + // encrypt the PIN Block. For ECDH, it is the keyARN of the asymmetric ECC key. // // This member is required. EncryptionKeyIdentifier *string @@ -91,6 +99,9 @@ type GeneratePinDataInput struct { // This member is required. PrimaryAccountNumber *string + // Parameter information of a WrappedKeyBlock for encryption key exchange. + EncryptionWrappedKey *types.WrappedKey + // The length of PIN under generation. PinDataLength *int32 @@ -108,7 +119,8 @@ type GeneratePinDataOutput struct { EncryptedPinBlock *string // The keyARN of the PEK that Amazon Web Services Payment Cryptography uses for - // encrypted pin block generation. + // encrypted pin block generation. For ECDH, it is the keyARN of the asymmetric + // ECC key. // // This member is required. EncryptionKeyArn *string diff --git a/service/paymentcryptographydata/api_op_TranslatePinData.go b/service/paymentcryptographydata/api_op_TranslatePinData.go index 4dacceff354..1995b11fce5 100644 --- a/service/paymentcryptographydata/api_op_TranslatePinData.go +++ b/service/paymentcryptographydata/api_op_TranslatePinData.go @@ -14,22 +14,32 @@ import ( // Translates encrypted PIN block from and to ISO 9564 formats 0,1,3,4. For more // information, see [Translate PIN data]in the Amazon Web Services Payment Cryptography User Guide. // -// PIN block translation involves changing the encrytion of PIN block from one -// encryption key to another encryption key and changing PIN block format from one -// to another without PIN block data leaving Amazon Web Services Payment -// Cryptography. The encryption key transformation can be from PEK (Pin Encryption -// Key) to BDK (Base Derivation Key) for DUKPT or from BDK for DUKPT to PEK. Amazon -// Web Services Payment Cryptography supports TDES and AES key derivation type for -// DUKPT translations. +// PIN block translation involves changing a PIN block from one encryption key to +// another and optionally change its format. PIN block translation occurs entirely +// within the HSM boundary and PIN data never enters or leaves Amazon Web Services +// Payment Cryptography in clear text. The encryption key transformation can be +// from PEK (Pin Encryption Key) to BDK (Base Derivation Key) for DUKPT or from BDK +// for DUKPT to PEK. // -// This operation also supports dynamic keys, allowing you to pass a dynamic PEK -// as a TR-31 WrappedKeyBlock. This can be used when key material is frequently -// rotated, such as during every card transaction, and there is need to avoid -// importing short-lived keys into Amazon Web Services Payment Cryptography. To -// translate PIN block using dynamic keys, the keyARN is the Key Encryption Key -// (KEK) of the TR-31 wrapped PEK. The incoming wrapped key shall have a key -// purpose of P0 with a mode of use of B or D. For more information, see [Using Dynamic Keys]in the -// Amazon Web Services Payment Cryptography User Guide. +// Amazon Web Services Payment Cryptography also supports use of dynamic keys and +// ECDH (Elliptic Curve Diffie-Hellman) based key exchange for this operation. +// +// Dynamic keys allow you to pass a PEK as a TR-31 WrappedKeyBlock. They can be +// used when key material is frequently rotated, such as during every card +// transaction, and there is need to avoid importing short-lived keys into Amazon +// Web Services Payment Cryptography. To translate PIN block using dynamic keys, +// the keyARN is the Key Encryption Key (KEK) of the TR-31 wrapped PEK. The +// incoming wrapped key shall have a key purpose of P0 with a mode of use of B or +// D. For more information, see [Using Dynamic Keys]in the Amazon Web Services Payment Cryptography +// User Guide. +// +// Using ECDH key exchange, you can receive cardholder selectable PINs into Amazon +// Web Services Payment Cryptography. The ECDH derived key protects the incoming +// PIN block, which is translated to a PEK encrypted PIN block for use within the +// service. You can also use ECDH for reveal PIN, wherein the service translates +// the PIN block from PEK to a ECDH derived encryption key. For more information on +// establishing ECDH derived keys, see the [Generating keys]in the Amazon Web Services Payment +// Cryptography User Guide. // // The allowed combinations of PIN block format translations are guided by PCI. It // is important to note that not all encrypted PIN block formats (example, format @@ -57,6 +67,7 @@ import ( // [Translate PIN data]: https://docs.aws.amazon.com/payment-cryptography/latest/userguide/translate-pin-data.html // [Key types for specific data operations]: https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html // [Understanding key attributes]: https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html +// [Generating keys]: https://docs.aws.amazon.com/payment-cryptography/latest/userguide/create-keys.html func (c *Client) TranslatePinData(ctx context.Context, params *TranslatePinDataInput, optFns ...func(*Options)) (*TranslatePinDataOutput, error) { if params == nil { params = &TranslatePinDataInput{} @@ -83,9 +94,8 @@ type TranslatePinDataInput struct { // The keyARN of the encryption key under which incoming PIN block data is // encrypted. This key type can be PEK or BDK. // - // When a WrappedKeyBlock is provided, this value will be the identifier to the - // key wrapping key for PIN block. Otherwise, it is the key identifier used to - // perform the operation. + // For dynamic keys, it is the keyARN of KEK of the TR-31 wrapped PEK. For ECDH, + // it is the keyARN of the asymmetric ECC key. // // This member is required. IncomingKeyIdentifier *string @@ -99,6 +109,8 @@ type TranslatePinDataInput struct { // The keyARN of the encryption key for encrypting outgoing PIN block data. This // key type can be PEK or BDK. // + // For ECDH, it is the keyARN of the asymmetric ECC key. + // // This member is required. OutgoingKeyIdentifier *string diff --git a/service/paymentcryptographydata/api_op_VerifyPinData.go b/service/paymentcryptographydata/api_op_VerifyPinData.go index 298700e6345..4a587bdd0a7 100644 --- a/service/paymentcryptographydata/api_op_VerifyPinData.go +++ b/service/paymentcryptographydata/api_op_VerifyPinData.go @@ -98,6 +98,9 @@ type VerifyPinDataInput struct { // The attributes and values for the DUKPT encrypted PIN block data. DukptAttributes *types.DukptAttributes + // Parameter information of a WrappedKeyBlock for encryption key exchange. + EncryptionWrappedKey *types.WrappedKey + // The length of PIN being verified. PinDataLength *int32 diff --git a/service/paymentcryptographydata/serializers.go b/service/paymentcryptographydata/serializers.go index b222c81840f..daee9177ac8 100644 --- a/service/paymentcryptographydata/serializers.go +++ b/service/paymentcryptographydata/serializers.go @@ -618,6 +618,13 @@ func awsRestjson1_serializeOpDocumentGeneratePinDataInput(v *GeneratePinDataInpu ok.String(*v.EncryptionKeyIdentifier) } + if v.EncryptionWrappedKey != nil { + ok := object.Key("EncryptionWrappedKey") + if err := awsRestjson1_serializeDocumentWrappedKey(v.EncryptionWrappedKey, ok); err != nil { + return err + } + } + if v.GenerationAttributes != nil { ok := object.Key("GenerationAttributes") if err := awsRestjson1_serializeDocumentPinGenerationAttributes(v.GenerationAttributes, ok); err != nil { @@ -1309,6 +1316,13 @@ func awsRestjson1_serializeOpDocumentVerifyPinDataInput(v *VerifyPinDataInput, v ok.String(*v.EncryptionKeyIdentifier) } + if v.EncryptionWrappedKey != nil { + ok := object.Key("EncryptionWrappedKey") + if err := awsRestjson1_serializeDocumentWrappedKey(v.EncryptionWrappedKey, ok); err != nil { + return err + } + } + if len(v.PinBlockFormat) > 0 { ok := object.Key("PinBlockFormat") ok.String(string(v.PinBlockFormat)) @@ -1843,6 +1857,43 @@ func awsRestjson1_serializeDocumentDynamicCardVerificationValue(v *types.Dynamic return nil } +func awsRestjson1_serializeDocumentEcdhDerivationAttributes(v *types.EcdhDerivationAttributes, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CertificateAuthorityPublicKeyIdentifier != nil { + ok := object.Key("CertificateAuthorityPublicKeyIdentifier") + ok.String(*v.CertificateAuthorityPublicKeyIdentifier) + } + + if len(v.KeyAlgorithm) > 0 { + ok := object.Key("KeyAlgorithm") + ok.String(string(v.KeyAlgorithm)) + } + + if len(v.KeyDerivationFunction) > 0 { + ok := object.Key("KeyDerivationFunction") + ok.String(string(v.KeyDerivationFunction)) + } + + if len(v.KeyDerivationHashAlgorithm) > 0 { + ok := object.Key("KeyDerivationHashAlgorithm") + ok.String(string(v.KeyDerivationHashAlgorithm)) + } + + if v.PublicKeyCertificate != nil { + ok := object.Key("PublicKeyCertificate") + ok.String(*v.PublicKeyCertificate) + } + + if v.SharedInformation != nil { + ok := object.Key("SharedInformation") + ok.String(*v.SharedInformation) + } + + return nil +} + func awsRestjson1_serializeDocumentEmv2000Attributes(v *types.Emv2000Attributes, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2682,6 +2733,12 @@ func awsRestjson1_serializeDocumentWrappedKeyMaterial(v types.WrappedKeyMaterial defer object.Close() switch uv := v.(type) { + case *types.WrappedKeyMaterialMemberDiffieHellmanSymmetricKey: + av := object.Key("DiffieHellmanSymmetricKey") + if err := awsRestjson1_serializeDocumentEcdhDerivationAttributes(&uv.Value, av); err != nil { + return err + } + case *types.WrappedKeyMaterialMemberTr31KeyBlock: av := object.Key("Tr31KeyBlock") av.String(uv.Value) diff --git a/service/paymentcryptographydata/types/enums.go b/service/paymentcryptographydata/types/enums.go index 8c7f1ce68c6..079fabb8925 100644 --- a/service/paymentcryptographydata/types/enums.go +++ b/service/paymentcryptographydata/types/enums.go @@ -155,6 +155,46 @@ func (KeyCheckValueAlgorithm) Values() []KeyCheckValueAlgorithm { } } +type KeyDerivationFunction string + +// Enum values for KeyDerivationFunction +const ( + KeyDerivationFunctionNistSp800 KeyDerivationFunction = "NIST_SP800" + KeyDerivationFunctionAnsiX963 KeyDerivationFunction = "ANSI_X963" +) + +// Values returns all known values for KeyDerivationFunction. 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 (KeyDerivationFunction) Values() []KeyDerivationFunction { + return []KeyDerivationFunction{ + "NIST_SP800", + "ANSI_X963", + } +} + +type KeyDerivationHashAlgorithm string + +// Enum values for KeyDerivationHashAlgorithm +const ( + KeyDerivationHashAlgorithmSha256 KeyDerivationHashAlgorithm = "SHA_256" + KeyDerivationHashAlgorithmSha384 KeyDerivationHashAlgorithm = "SHA_384" + KeyDerivationHashAlgorithmSha512 KeyDerivationHashAlgorithm = "SHA_512" +) + +// Values returns all known values for KeyDerivationHashAlgorithm. 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 (KeyDerivationHashAlgorithm) Values() []KeyDerivationHashAlgorithm { + return []KeyDerivationHashAlgorithm{ + "SHA_256", + "SHA_384", + "SHA_512", + } +} + type MacAlgorithm string // Enum values for MacAlgorithm @@ -254,6 +294,7 @@ type PinBlockFormatForPinData string const ( PinBlockFormatForPinDataIsoFormat0 PinBlockFormatForPinData = "ISO_FORMAT_0" PinBlockFormatForPinDataIsoFormat3 PinBlockFormatForPinData = "ISO_FORMAT_3" + PinBlockFormatForPinDataIsoFormat4 PinBlockFormatForPinData = "ISO_FORMAT_4" ) // Values returns all known values for PinBlockFormatForPinData. Note that this @@ -264,6 +305,7 @@ func (PinBlockFormatForPinData) Values() []PinBlockFormatForPinData { return []PinBlockFormatForPinData{ "ISO_FORMAT_0", "ISO_FORMAT_3", + "ISO_FORMAT_4", } } @@ -330,6 +372,31 @@ func (SessionKeyDerivationMode) Values() []SessionKeyDerivationMode { } } +type SymmetricKeyAlgorithm string + +// Enum values for SymmetricKeyAlgorithm +const ( + SymmetricKeyAlgorithmTdes2key SymmetricKeyAlgorithm = "TDES_2KEY" + SymmetricKeyAlgorithmTdes3key SymmetricKeyAlgorithm = "TDES_3KEY" + SymmetricKeyAlgorithmAes128 SymmetricKeyAlgorithm = "AES_128" + SymmetricKeyAlgorithmAes192 SymmetricKeyAlgorithm = "AES_192" + SymmetricKeyAlgorithmAes256 SymmetricKeyAlgorithm = "AES_256" +) + +// Values returns all known values for SymmetricKeyAlgorithm. 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 (SymmetricKeyAlgorithm) Values() []SymmetricKeyAlgorithm { + return []SymmetricKeyAlgorithm{ + "TDES_2KEY", + "TDES_3KEY", + "AES_128", + "AES_192", + "AES_256", + } +} + type VerificationFailedReason string // Enum values for VerificationFailedReason diff --git a/service/paymentcryptographydata/types/types.go b/service/paymentcryptographydata/types/types.go index 7ac4990f88e..dfcf1d86c0e 100644 --- a/service/paymentcryptographydata/types/types.go +++ b/service/paymentcryptographydata/types/types.go @@ -625,6 +625,49 @@ type DynamicCardVerificationValue struct { noSmithyDocumentSerde } +// Parameters required to establish ECDH based key exchange. +type EcdhDerivationAttributes struct { + + // The keyArn of the certificate that signed the client's PublicKeyCertificate . + // + // This member is required. + CertificateAuthorityPublicKeyIdentifier *string + + // The key algorithm of the derived ECDH key. + // + // This member is required. + KeyAlgorithm SymmetricKeyAlgorithm + + // The key derivation function to use for deriving a key using ECDH. + // + // This member is required. + KeyDerivationFunction KeyDerivationFunction + + // The hash type to use for deriving a key using ECDH. + // + // This member is required. + KeyDerivationHashAlgorithm KeyDerivationHashAlgorithm + + // The client's public key certificate in PEM format (base64 encoded) to use for + // ECDH key derivation. + // + // This member is required. + PublicKeyCertificate *string + + // A byte string containing information that binds the ECDH derived key to the two + // parties involved or to the context of the key. + // + // It may include details like identities of the two parties deriving the key, + // context of the operation, session IDs, and optionally a nonce. It must not + // contain zero bytes, and re-using shared information for multiple ECDH key + // derivations is not recommended. + // + // This member is required. + SharedInformation *string + + noSmithyDocumentSerde +} + // Parameters to derive the confidentiality and integrity keys for a payment card // using EMV2000 deruv. type Emv2000Attributes struct { @@ -1685,11 +1728,21 @@ type WrappedKey struct { // // The following types satisfy this interface: // +// WrappedKeyMaterialMemberDiffieHellmanSymmetricKey // WrappedKeyMaterialMemberTr31KeyBlock type WrappedKeyMaterial interface { isWrappedKeyMaterial() } +// The parameter information for deriving a ECDH shared key. +type WrappedKeyMaterialMemberDiffieHellmanSymmetricKey struct { + Value EcdhDerivationAttributes + + noSmithyDocumentSerde +} + +func (*WrappedKeyMaterialMemberDiffieHellmanSymmetricKey) isWrappedKeyMaterial() {} + // The TR-31 wrapped key block. type WrappedKeyMaterialMemberTr31KeyBlock struct { Value string diff --git a/service/paymentcryptographydata/types/types_exported_test.go b/service/paymentcryptographydata/types/types_exported_test.go index 5330e3ed70c..e2df4192b3f 100644 --- a/service/paymentcryptographydata/types/types_exported_test.go +++ b/service/paymentcryptographydata/types/types_exported_test.go @@ -405,6 +405,9 @@ func ExampleWrappedKeyMaterial_outputUsage() { var union types.WrappedKeyMaterial // type switches can be used to check the union value switch v := union.(type) { + case *types.WrappedKeyMaterialMemberDiffieHellmanSymmetricKey: + _ = v.Value // Value is types.EcdhDerivationAttributes + case *types.WrappedKeyMaterialMemberTr31KeyBlock: _ = v.Value // Value is string @@ -418,3 +421,4 @@ func ExampleWrappedKeyMaterial_outputUsage() { } var _ *string +var _ *types.EcdhDerivationAttributes diff --git a/service/paymentcryptographydata/validators.go b/service/paymentcryptographydata/validators.go index 8c32a0a72b3..e8bccdee16f 100644 --- a/service/paymentcryptographydata/validators.go +++ b/service/paymentcryptographydata/validators.go @@ -748,6 +748,36 @@ func validateDynamicCardVerificationValue(v *types.DynamicCardVerificationValue) } } +func validateEcdhDerivationAttributes(v *types.EcdhDerivationAttributes) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcdhDerivationAttributes"} + if v.CertificateAuthorityPublicKeyIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("CertificateAuthorityPublicKeyIdentifier")) + } + if v.PublicKeyCertificate == nil { + invalidParams.Add(smithy.NewErrParamRequired("PublicKeyCertificate")) + } + if len(v.KeyAlgorithm) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("KeyAlgorithm")) + } + if len(v.KeyDerivationFunction) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("KeyDerivationFunction")) + } + if len(v.KeyDerivationHashAlgorithm) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("KeyDerivationHashAlgorithm")) + } + if v.SharedInformation == nil { + invalidParams.Add(smithy.NewErrParamRequired("SharedInformation")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateEmv2000Attributes(v *types.Emv2000Attributes) error { if v == nil { return nil @@ -1457,6 +1487,29 @@ func validateWrappedKey(v *types.WrappedKey) error { invalidParams := smithy.InvalidParamsError{Context: "WrappedKey"} if v.WrappedKeyMaterial == nil { invalidParams.Add(smithy.NewErrParamRequired("WrappedKeyMaterial")) + } else if v.WrappedKeyMaterial != nil { + if err := validateWrappedKeyMaterial(v.WrappedKeyMaterial); err != nil { + invalidParams.AddNested("WrappedKeyMaterial", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWrappedKeyMaterial(v types.WrappedKeyMaterial) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WrappedKeyMaterial"} + switch uv := v.(type) { + case *types.WrappedKeyMaterialMemberDiffieHellmanSymmetricKey: + if err := validateEcdhDerivationAttributes(&uv.Value); err != nil { + invalidParams.AddNested("[DiffieHellmanSymmetricKey]", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -1636,6 +1689,11 @@ func validateOpGeneratePinDataInput(v *GeneratePinDataInput) error { if len(v.PinBlockFormat) == 0 { invalidParams.Add(smithy.NewErrParamRequired("PinBlockFormat")) } + if v.EncryptionWrappedKey != nil { + if err := validateWrappedKey(v.EncryptionWrappedKey); err != nil { + invalidParams.AddNested("EncryptionWrappedKey", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1867,6 +1925,11 @@ func validateOpVerifyPinDataInput(v *VerifyPinDataInput) error { invalidParams.AddNested("DukptAttributes", err.(smithy.InvalidParamsError)) } } + if v.EncryptionWrappedKey != nil { + if err := validateWrappedKey(v.EncryptionWrappedKey); err != nil { + invalidParams.AddNested("EncryptionWrappedKey", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/securityhub/internal/endpoints/endpoints.go b/service/securityhub/internal/endpoints/endpoints.go index a3462eccae5..5d57fe4198d 100644 --- a/service/securityhub/internal/endpoints/endpoints.go +++ b/service/securityhub/internal/endpoints/endpoints.go @@ -142,69 +142,201 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.af-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-northeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-northeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-northeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-south-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-southeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-southeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-southeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-southeast-4.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-5", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ap-southeast-5.api.aws", + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ca-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "ca-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.ca-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.eu-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.eu-central-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.eu-north-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.eu-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.eu-south-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.eu-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.eu-west-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.eu-west-3.api.aws", + }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ @@ -244,15 +376,39 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "il-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.il-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.me-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.me-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.sa-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, @@ -262,6 +418,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "securityhub-fips.us-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, @@ -271,6 +433,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "securityhub-fips.us-east-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, @@ -280,6 +448,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "securityhub-fips.us-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, @@ -289,6 +463,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "securityhub-fips.us-west-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.us-west-2.api.aws", + }, }, }, { @@ -480,6 +660,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "securityhub-fips.us-gov-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.us-gov-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, @@ -489,6 +675,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "securityhub-fips.us-gov-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "securityhub.us-gov-west-1.api.aws", + }, }, }, }