diff --git a/.changelog/2c30a371457d45e29137a0dbfa6efca9.json b/.changelog/2c30a371457d45e29137a0dbfa6efca9.json new file mode 100644 index 00000000000..512dd1527e6 --- /dev/null +++ b/.changelog/2c30a371457d45e29137a0dbfa6efca9.json @@ -0,0 +1,8 @@ +{ + "id": "2c30a371-457d-45e2-9137-a0dbfa6efca9", + "type": "feature", + "description": "This release adds GroupId to the response for DeleteSecurityGroup.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/3550fde8f74240d8b0de0755ef513a48.json b/.changelog/3550fde8f74240d8b0de0755ef513a48.json new file mode 100644 index 00000000000..2be3d794dc7 --- /dev/null +++ b/.changelog/3550fde8f74240d8b0de0755ef513a48.json @@ -0,0 +1,8 @@ +{ + "id": "3550fde8-f742-40d8-b0de-0755ef513a48", + "type": "feature", + "description": "Limit PutIntegration IntegrationName and ListIntegrations IntegrationNamePrefix parameters to 50 characters", + "modules": [ + "service/cloudwatchlogs" + ] +} \ No newline at end of file diff --git a/.changelog/3708358d0f7f440abc9ed8242d480111.json b/.changelog/3708358d0f7f440abc9ed8242d480111.json new file mode 100644 index 00000000000..49053b45ba0 --- /dev/null +++ b/.changelog/3708358d0f7f440abc9ed8242d480111.json @@ -0,0 +1,8 @@ +{ + "id": "3708358d-0f7f-440a-bc9e-d8242d480111", + "type": "feature", + "description": "AWS Cloud Map now supports service-level attributes, allowing you to associate custom metadata directly with services. These attributes can be retrieved, updated, and deleted using the new GetServiceAttributes, UpdateServiceAttributes, and DeleteServiceAttributes API calls.", + "modules": [ + "service/servicediscovery" + ] +} \ No newline at end of file diff --git a/.changelog/3d1e692c20ca4d70be1444940d66761a.json b/.changelog/3d1e692c20ca4d70be1444940d66761a.json new file mode 100644 index 00000000000..ac4dc294abf --- /dev/null +++ b/.changelog/3d1e692c20ca4d70be1444940d66761a.json @@ -0,0 +1,8 @@ +{ + "id": "3d1e692c-20ca-4d70-be14-44940d66761a", + "type": "feature", + "description": "Add NodeRepairConfig in CreateNodegroupRequest and UpdateNodegroupConfigRequest", + "modules": [ + "service/eks" + ] +} \ No newline at end of file diff --git a/.changelog/68053e24d75a49fc8a15b173cf3e95bf.json b/.changelog/68053e24d75a49fc8a15b173cf3e95bf.json new file mode 100644 index 00000000000..a6ff6bb142c --- /dev/null +++ b/.changelog/68053e24d75a49fc8a15b173cf3e95bf.json @@ -0,0 +1,8 @@ +{ + "id": "68053e24-d75a-49fc-8a15-b173cf3e95bf", + "type": "feature", + "description": "AWS Elemental MediaConnect Gateway now supports Source Specific Multicast (SSM) for ingress bridges. This enables you to specify a source IP address in addition to a multicast IP when creating or updating an ingress bridge source.", + "modules": [ + "service/mediaconnect" + ] +} \ No newline at end of file diff --git a/.changelog/95130284cce24dd29c1e24172d993fd2.json b/.changelog/95130284cce24dd29c1e24172d993fd2.json new file mode 100644 index 00000000000..6d0098b0420 --- /dev/null +++ b/.changelog/95130284cce24dd29c1e24172d993fd2.json @@ -0,0 +1,8 @@ +{ + "id": "95130284-cce2-4dd2-9c1e-24172d993fd2", + "type": "documentation", + "description": "There was a sentence fragment in UpdateDirectConnectGatewayAttachment that was causing customer confusion as to whether it's an incomplete sentence or if it was a typo. Removed the fragment.", + "modules": [ + "service/networkmanager" + ] +} \ No newline at end of file diff --git a/.changelog/c4bc0b8974b74d7c9de9e2ec9cfe2754.json b/.changelog/c4bc0b8974b74d7c9de9e2ec9cfe2754.json new file mode 100644 index 00000000000..aec3a16ff6d --- /dev/null +++ b/.changelog/c4bc0b8974b74d7c9de9e2ec9cfe2754.json @@ -0,0 +1,8 @@ +{ + "id": "c4bc0b89-74b7-4d7c-9de9-e2ec9cfe2754", + "type": "feature", + "description": "Add support for Dual-Stack hsm2m.medium clusters. The customers will now be able to create hsm2m.medium clusters having both IPv4 and IPv6 connection capabilities by specifying a new param called NetworkType=DUALSTACK during cluster creation.", + "modules": [ + "service/cloudhsmv2" + ] +} \ No newline at end of file diff --git a/service/cloudhsmv2/api_op_CreateCluster.go b/service/cloudhsmv2/api_op_CreateCluster.go index d016fb19bf9..badafbc8708 100644 --- a/service/cloudhsmv2/api_op_CreateCluster.go +++ b/service/cloudhsmv2/api_op_CreateCluster.go @@ -56,6 +56,10 @@ type CreateClusterInput struct { // The mode to use in the cluster. The allowed values are FIPS and NON_FIPS . Mode types.ClusterMode + // The NetworkType to create a cluster with. The allowed values are IPV4 and + // DUALSTACK . + NetworkType types.NetworkType + // The identifier (ID) or the Amazon Resource Name (ARN) of the cluster backup to // restore. Use this value to restore the cluster from a backup instead of creating // a new cluster. To find the backup ID or ARN, use DescribeBackups. If using a backup in another diff --git a/service/cloudhsmv2/deserializers.go b/service/cloudhsmv2/deserializers.go index 7799e984bc0..5c394399202 100644 --- a/service/cloudhsmv2/deserializers.go +++ b/service/cloudhsmv2/deserializers.go @@ -2119,6 +2119,9 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("CloudHsmInvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorCloudHsmInvalidRequestException(response, errorBody) + case strings.EqualFold("CloudHsmResourceLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorCloudHsmResourceLimitExceededException(response, errorBody) + case strings.EqualFold("CloudHsmResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorCloudHsmResourceNotFoundException(response, errorBody) @@ -2369,6 +2372,41 @@ func awsAwsjson11_deserializeErrorCloudHsmInvalidRequestException(response *smit return output } +func awsAwsjson11_deserializeErrorCloudHsmResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.CloudHsmResourceLimitExceededException{} + err := awsAwsjson11_deserializeDocumentCloudHsmResourceLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorCloudHsmResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2927,6 +2965,46 @@ func awsAwsjson11_deserializeDocumentCloudHsmInvalidRequestException(v **types.C return nil } +func awsAwsjson11_deserializeDocumentCloudHsmResourceLimitExceededException(v **types.CloudHsmResourceLimitExceededException, 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.CloudHsmResourceLimitExceededException + if *v == nil { + sv = &types.CloudHsmResourceLimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentCloudHsmResourceNotFoundException(v **types.CloudHsmResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3136,6 +3214,15 @@ func awsAwsjson11_deserializeDocumentCluster(v **types.Cluster, value interface{ sv.Mode = types.ClusterMode(jtv) } + case "NetworkType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NetworkType to be of type string, got %T instead", value) + } + sv.NetworkType = types.NetworkType(jtv) + } + case "PreCoPassword": if value != nil { jtv, ok := value.(string) @@ -3411,6 +3498,15 @@ func awsAwsjson11_deserializeDocumentHsm(v **types.Hsm, value interface{}) error sv.EniIp = ptr.String(jtv) } + case "EniIpV6": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpV6Address to be of type string, got %T instead", value) + } + sv.EniIpV6 = ptr.String(jtv) + } + case "HsmId": if value != nil { jtv, ok := value.(string) diff --git a/service/cloudhsmv2/serializers.go b/service/cloudhsmv2/serializers.go index 5d6b74fc92f..c11abbd1586 100644 --- a/service/cloudhsmv2/serializers.go +++ b/service/cloudhsmv2/serializers.go @@ -1254,6 +1254,11 @@ func awsAwsjson11_serializeOpDocumentCreateClusterInput(v *CreateClusterInput, v ok.String(string(v.Mode)) } + if len(v.NetworkType) > 0 { + ok := object.Key("NetworkType") + ok.String(string(v.NetworkType)) + } + if v.SourceBackupId != nil { ok := object.Key("SourceBackupId") ok.String(*v.SourceBackupId) diff --git a/service/cloudhsmv2/types/enums.go b/service/cloudhsmv2/types/enums.go index f822474b9f5..63dbcdd0b1d 100644 --- a/service/cloudhsmv2/types/enums.go +++ b/service/cloudhsmv2/types/enums.go @@ -88,6 +88,8 @@ const ( ClusterStateInitialized ClusterState = "INITIALIZED" ClusterStateActive ClusterState = "ACTIVE" ClusterStateUpdateInProgress ClusterState = "UPDATE_IN_PROGRESS" + ClusterStateModifyInProgress ClusterState = "MODIFY_IN_PROGRESS" + ClusterStateRollbackInProgress ClusterState = "ROLLBACK_IN_PROGRESS" ClusterStateDeleteInProgress ClusterState = "DELETE_IN_PROGRESS" ClusterStateDeleted ClusterState = "DELETED" ClusterStateDegraded ClusterState = "DEGRADED" @@ -105,6 +107,8 @@ func (ClusterState) Values() []ClusterState { "INITIALIZED", "ACTIVE", "UPDATE_IN_PROGRESS", + "MODIFY_IN_PROGRESS", + "ROLLBACK_IN_PROGRESS", "DELETE_IN_PROGRESS", "DELETED", "DEGRADED", @@ -135,3 +139,22 @@ func (HsmState) Values() []HsmState { "DELETED", } } + +type NetworkType string + +// Enum values for NetworkType +const ( + NetworkTypeIpv4 NetworkType = "IPV4" + NetworkTypeDualstack NetworkType = "DUALSTACK" +) + +// Values returns all known values for NetworkType. 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 (NetworkType) Values() []NetworkType { + return []NetworkType{ + "IPV4", + "DUALSTACK", + } +} diff --git a/service/cloudhsmv2/types/errors.go b/service/cloudhsmv2/types/errors.go index 8db9046db82..b3c26426876 100644 --- a/service/cloudhsmv2/types/errors.go +++ b/service/cloudhsmv2/types/errors.go @@ -87,6 +87,34 @@ func (e *CloudHsmInvalidRequestException) ErrorCode() string { } func (e *CloudHsmInvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The request was rejected because it exceeds an CloudHSM limit. +type CloudHsmResourceLimitExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CloudHsmResourceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CloudHsmResourceLimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CloudHsmResourceLimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CloudHsmResourceLimitExceededException" + } + return *e.ErrorCodeOverride +} +func (e *CloudHsmResourceLimitExceededException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // The request was rejected because it refers to a resource that cannot be found. type CloudHsmResourceNotFoundException struct { Message *string diff --git a/service/cloudhsmv2/types/types.go b/service/cloudhsmv2/types/types.go index 388e7ee96c0..2fcd862371e 100644 --- a/service/cloudhsmv2/types/types.go +++ b/service/cloudhsmv2/types/types.go @@ -129,6 +129,19 @@ type Cluster struct { // The mode of the cluster. Mode ClusterMode + // The cluster's NetworkType can be set to either IPV4 (which is the default) or + // DUALSTACK. When set to IPV4, communication between your application and the + // Hardware Security Modules (HSMs) is restricted to the IPv4 protocol only. In + // contrast, the DUALSTACK network type enables communication over both the IPv4 + // and IPv6 protocols. To use the DUALSTACK option, you'll need to configure your + // Virtual Private Cloud (VPC) and subnets to support both IPv4 and IPv6. This + // involves adding IPv6 Classless Inter-Domain Routing (CIDR) blocks to the + // existing IPv4 CIDR blocks in your subnets. The choice between IPV4 and DUALSTACK + // network types determines the flexibility of the network addressing setup for + // your cluster. The DUALSTACK option provides more flexibility by allowing both + // IPv4 and IPv6 communication. + NetworkType NetworkType + // The default password for the cluster's Pre-Crypto Officer (PRECO) user. PreCoPassword *string @@ -200,6 +213,9 @@ type Hsm struct { // The IP address of the HSM's elastic network interface (ENI). EniIp *string + // The IPv6 address (if any) of the HSM's elastic network interface (ENI). + EniIpV6 *string + // The HSM's state. State HsmState diff --git a/service/codebuild/internal/endpoints/endpoints.go b/service/codebuild/internal/endpoints/endpoints.go index d89ef6eebb2..2da508377c6 100644 --- a/service/codebuild/internal/endpoints/endpoints.go +++ b/service/codebuild/internal/endpoints/endpoints.go @@ -348,6 +348,14 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso-b", diff --git a/service/dlm/internal/endpoints/endpoints.go b/service/dlm/internal/endpoints/endpoints.go index 8573bdce5bd..542d339239c 100644 --- a/service/dlm/internal/endpoints/endpoints.go +++ b/service/dlm/internal/endpoints/endpoints.go @@ -514,21 +514,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-iso-east-1", - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "dlm-fips.us-iso-east-1.api.aws.ic.gov", - }, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-iso-west-1", - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "dlm-fips.us-iso-west-1.api.aws.ic.gov", - }, }, }, { @@ -555,12 +543,6 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-isob-east-1", - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "dlm-fips.us-isob-east-1.api.aws.scloud", - }, }, }, { @@ -643,12 +625,6 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-gov-east-1", - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "dlm-fips.us-gov-east-1.api.aws", - }, endpoints.EndpointKey{ Region: "us-gov-east-1", Variant: endpoints.FIPSVariant, @@ -667,12 +643,6 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "dlm-fips.us-gov-west-1.api.aws", - }, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, diff --git a/service/ec2/api_op_DeleteSecurityGroup.go b/service/ec2/api_op_DeleteSecurityGroup.go index 2515cb81f73..80d5cc78365 100644 --- a/service/ec2/api_op_DeleteSecurityGroup.go +++ b/service/ec2/api_op_DeleteSecurityGroup.go @@ -50,6 +50,13 @@ type DeleteSecurityGroupInput struct { } type DeleteSecurityGroupOutput struct { + + // The ID of the deleted security group. + GroupId *string + + // Returns true if the request succeeds; otherwise, returns an error. + Return *bool + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/ec2/api_op_StartDeclarativePoliciesReport.go b/service/ec2/api_op_StartDeclarativePoliciesReport.go index 9448c06499d..f2ccf8541dd 100644 --- a/service/ec2/api_op_StartDeclarativePoliciesReport.go +++ b/service/ec2/api_op_StartDeclarativePoliciesReport.go @@ -31,7 +31,8 @@ import ( // account or delegated administrators for the organization. // // - An S3 bucket must be available before generating the report (you can create -// a new one or use an existing one), and it must have an appropriate bucket +// a new one or use an existing one), it must be in the same Region where the +// report generation request is made, and it must have an appropriate bucket // policy. For a sample S3 policy, see Sample Amazon S3 policy under . // // - Trusted access must be enabled for the service for which the declarative @@ -67,7 +68,8 @@ func (c *Client) StartDeclarativePoliciesReport(ctx context.Context, params *Sta type StartDeclarativePoliciesReportInput struct { - // The name of the S3 bucket where the report will be saved. + // The name of the S3 bucket where the report will be saved. The bucket must be in + // the same Region where the report generation request is made. // // This member is required. S3Bucket *string diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 51ce478d97e..3eefdeb4655 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -17271,10 +17271,33 @@ func (m *awsEc2query_deserializeOpDeleteSecurityGroup) HandleDeserialize(ctx con output := &DeleteSecurityGroupOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDeleteSecurityGroupOutput(&output, 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 out, metadata, err } return out, metadata, err @@ -160900,6 +160923,71 @@ func awsEc2query_deserializeOpDocumentDeleteQueuedReservedInstancesOutput(v **De return nil } +func awsEc2query_deserializeOpDocumentDeleteSecurityGroupOutput(v **DeleteSecurityGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteSecurityGroupOutput + if *v == nil { + sv = &DeleteSecurityGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("groupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GroupId = ptr.String(xtv) + } + + case strings.EqualFold("return", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Return = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentDeleteSubnetCidrReservationOutput(v **DeleteSubnetCidrReservationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 2a262e00819..5c2ceea7803 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -4944,6 +4944,10 @@ type FederatedAuthenticationRequest struct { // // If you specify multiple filters, the filters are joined with an AND , and the // request returns only results that match all of the specified filters. +// +// For more information, see [List and filter using the CLI and API] in the Amazon EC2 User Guide. +// +// [List and filter using the CLI and API]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html#Filtering_Resources_CLI type Filter struct { // The name of the filter. Filter names are case-sensitive. diff --git a/service/eks/api_op_CreateNodegroup.go b/service/eks/api_op_CreateNodegroup.go index bd78f63fc06..c44efabb1b9 100644 --- a/service/eks/api_op_CreateNodegroup.go +++ b/service/eks/api_op_CreateNodegroup.go @@ -136,6 +136,9 @@ type CreateNodegroupInput struct { // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html LaunchTemplate *types.LaunchTemplateSpecification + // The node auto repair configuration for the node group. + NodeRepairConfig *types.NodeRepairConfig + // The AMI version of the Amazon EKS optimized AMI to use with your node group. By // default, the latest available AMI version for the node group's current // Kubernetes version is used. For information about Linux versions, see [Amazon EKS optimized Amazon Linux AMI versions]in the diff --git a/service/eks/api_op_UpdateNodegroupConfig.go b/service/eks/api_op_UpdateNodegroupConfig.go index c0913e98d8c..c287486c22a 100644 --- a/service/eks/api_op_UpdateNodegroupConfig.go +++ b/service/eks/api_op_UpdateNodegroupConfig.go @@ -50,6 +50,9 @@ type UpdateNodegroupConfigInput struct { // The Kubernetes labels to apply to the nodes in the node group after the update. Labels *types.UpdateLabelsPayload + // The node auto repair configuration for the node group. + NodeRepairConfig *types.NodeRepairConfig + // The scaling configuration details for the Auto Scaling group after the update. ScalingConfig *types.NodegroupScalingConfig diff --git a/service/eks/deserializers.go b/service/eks/deserializers.go index a3663cd07ef..c88a3cf5c47 100644 --- a/service/eks/deserializers.go +++ b/service/eks/deserializers.go @@ -13827,6 +13827,11 @@ func awsRestjson1_deserializeDocumentNodegroup(v **types.Nodegroup, value interf sv.NodegroupName = ptr.String(jtv) } + case "nodeRepairConfig": + if err := awsRestjson1_deserializeDocumentNodeRepairConfig(&sv.NodeRepairConfig, value); err != nil { + return err + } + case "nodeRole": if value != nil { jtv, ok := value.(string) @@ -14115,6 +14120,46 @@ func awsRestjson1_deserializeDocumentNodegroupUpdateConfig(v **types.NodegroupUp return nil } +func awsRestjson1_deserializeDocumentNodeRepairConfig(v **types.NodeRepairConfig, 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.NodeRepairConfig + if *v == nil { + sv = &types.NodeRepairConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) + } + sv.Enabled = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/eks/serializers.go b/service/eks/serializers.go index a58b7383b0c..cfcf16c42a2 100644 --- a/service/eks/serializers.go +++ b/service/eks/serializers.go @@ -1147,6 +1147,13 @@ func awsRestjson1_serializeOpDocumentCreateNodegroupInput(v *CreateNodegroupInpu ok.String(*v.NodegroupName) } + if v.NodeRepairConfig != nil { + ok := object.Key("nodeRepairConfig") + if err := awsRestjson1_serializeDocumentNodeRepairConfig(v.NodeRepairConfig, ok); err != nil { + return err + } + } + if v.NodeRole != nil { ok := object.Key("nodeRole") ok.String(*v.NodeRole) @@ -5135,6 +5142,13 @@ func awsRestjson1_serializeOpDocumentUpdateNodegroupConfigInput(v *UpdateNodegro } } + if v.NodeRepairConfig != nil { + ok := object.Key("nodeRepairConfig") + if err := awsRestjson1_serializeDocumentNodeRepairConfig(v.NodeRepairConfig, ok); err != nil { + return err + } + } + if v.ScalingConfig != nil { ok := object.Key("scalingConfig") if err := awsRestjson1_serializeDocumentNodegroupScalingConfig(v.ScalingConfig, ok); err != nil { @@ -5860,6 +5874,18 @@ func awsRestjson1_serializeDocumentNodegroupUpdateConfig(v *types.NodegroupUpdat return nil } +func awsRestjson1_serializeDocumentNodeRepairConfig(v *types.NodeRepairConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Enabled != nil { + ok := object.Key("enabled") + ok.Boolean(*v.Enabled) + } + + return nil +} + func awsRestjson1_serializeDocumentOidcIdentityProviderConfigRequest(v *types.OidcIdentityProviderConfigRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/eks/types/enums.go b/service/eks/types/enums.go index 79bc48c4803..83a3903a0a0 100644 --- a/service/eks/types/enums.go +++ b/service/eks/types/enums.go @@ -759,6 +759,7 @@ const ( UpdateParamTypeResolveConflicts UpdateParamType = "ResolveConflicts" UpdateParamTypeMaxUnavailable UpdateParamType = "MaxUnavailable" UpdateParamTypeMaxUnavailablePercentage UpdateParamType = "MaxUnavailablePercentage" + UpdateParamTypeNodeRepairEnabled UpdateParamType = "NodeRepairEnabled" UpdateParamTypeConfigurationValues UpdateParamType = "ConfigurationValues" UpdateParamTypeSecurityGroups UpdateParamType = "SecurityGroups" UpdateParamTypeSubnets UpdateParamType = "Subnets" @@ -800,6 +801,7 @@ func (UpdateParamType) Values() []UpdateParamType { "ResolveConflicts", "MaxUnavailable", "MaxUnavailablePercentage", + "NodeRepairEnabled", "ConfigurationValues", "SecurityGroups", "Subnets", diff --git a/service/eks/types/types.go b/service/eks/types/types.go index e70cd9a7622..b7ac14cb62b 100644 --- a/service/eks/types/types.go +++ b/service/eks/types/types.go @@ -1307,6 +1307,9 @@ type Nodegroup struct { // The Unix epoch timestamp for the last modification to the object. ModifiedAt *time.Time + // The node auto repair configuration for the node group. + NodeRepairConfig *NodeRepairConfig + // The IAM role associated with your node group. The Amazon EKS node kubelet // daemon makes calls to Amazon Web Services APIs on your behalf. Nodes receive // permissions for these API calls through an IAM instance profile and associated @@ -1450,6 +1453,16 @@ type NodegroupUpdateConfig struct { noSmithyDocumentSerde } +// The node auto repair configuration for the node group. +type NodeRepairConfig struct { + + // Specifies whether to enable node auto repair for the node group. Node auto + // repair is disabled by default. + Enabled *bool + + noSmithyDocumentSerde +} + // An object representing the [OpenID Connect] (OIDC) identity provider information for the // cluster. // @@ -1790,10 +1803,56 @@ type RemoteAccessConfig struct { type RemoteNetworkConfigRequest struct { // The list of network CIDRs that can contain hybrid nodes. + // + // These CIDR blocks define the expected IP address range of the hybrid nodes that + // join the cluster. These blocks are typically determined by your network + // administrator. + // + // Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for + // example, 10.2.0.0/16 ). + // + // It must satisfy the following requirements: + // + // - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed + // size is /24, maximum allowed size is /8. Publicly-routable addresses aren't + // supported. + // + // - Each block cannot overlap with the range of the VPC CIDR blocks for your + // EKS resources, or the block of the Kubernetes service IP range. + // + // - Each block must have a route to the VPC that uses the VPC CIDR blocks, not + // public IPs or Elastic IPs. There are many options including Transit Gateway, + // Site-to-Site VPN, or Direct Connect. + // + // - Each host must allow outbound connection to the EKS cluster control plane + // on TCP ports 443 and 10250 . + // + // - Each host must allow inbound connection from the EKS cluster control plane + // on TCP port 10250 for logs, exec and port-forward operations. + // + // - Each host must allow TCP and UDP network connectivity to and from other + // hosts that are running CoreDNS on UDP port 53 for service and pod DNS names. RemoteNodeNetworks []RemoteNodeNetwork // The list of network CIDRs that can contain pods that run Kubernetes webhooks on // hybrid nodes. + // + // These CIDR blocks are determined by configuring your Container Network + // Interface (CNI) plugin. We recommend the Calico CNI or Cilium CNI. Note that the + // Amazon VPC CNI plugin for Kubernetes isn't available for on-premises and edge + // locations. + // + // Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for + // example, 10.2.0.0/16 ). + // + // It must satisfy the following requirements: + // + // - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed + // size is /24, maximum allowed size is /8. Publicly-routable addresses aren't + // supported. + // + // - Each block cannot overlap with the range of the VPC CIDR blocks for your + // EKS resources, or the block of the Kubernetes service IP range. RemotePodNetworks []RemotePodNetwork noSmithyDocumentSerde @@ -1814,9 +1873,67 @@ type RemoteNetworkConfigResponse struct { } // A network CIDR that can contain hybrid nodes. +// +// These CIDR blocks define the expected IP address range of the hybrid nodes that +// join the cluster. These blocks are typically determined by your network +// administrator. +// +// Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for +// example, 10.2.0.0/16 ). +// +// It must satisfy the following requirements: +// +// - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed +// size is /24, maximum allowed size is /8. Publicly-routable addresses aren't +// supported. +// +// - Each block cannot overlap with the range of the VPC CIDR blocks for your +// EKS resources, or the block of the Kubernetes service IP range. +// +// - Each block must have a route to the VPC that uses the VPC CIDR blocks, not +// public IPs or Elastic IPs. There are many options including Transit Gateway, +// Site-to-Site VPN, or Direct Connect. +// +// - Each host must allow outbound connection to the EKS cluster control plane +// on TCP ports 443 and 10250 . +// +// - Each host must allow inbound connection from the EKS cluster control plane +// on TCP port 10250 for logs, exec and port-forward operations. +// +// - Each host must allow TCP and UDP network connectivity to and from other +// hosts that are running CoreDNS on UDP port 53 for service and pod DNS names. type RemoteNodeNetwork struct { // A network CIDR that can contain hybrid nodes. + // + // These CIDR blocks define the expected IP address range of the hybrid nodes that + // join the cluster. These blocks are typically determined by your network + // administrator. + // + // Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for + // example, 10.2.0.0/16 ). + // + // It must satisfy the following requirements: + // + // - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed + // size is /24, maximum allowed size is /8. Publicly-routable addresses aren't + // supported. + // + // - Each block cannot overlap with the range of the VPC CIDR blocks for your + // EKS resources, or the block of the Kubernetes service IP range. + // + // - Each block must have a route to the VPC that uses the VPC CIDR blocks, not + // public IPs or Elastic IPs. There are many options including Transit Gateway, + // Site-to-Site VPN, or Direct Connect. + // + // - Each host must allow outbound connection to the EKS cluster control plane + // on TCP ports 443 and 10250 . + // + // - Each host must allow inbound connection from the EKS cluster control plane + // on TCP port 10250 for logs, exec and port-forward operations. + // + // - Each host must allow TCP and UDP network connectivity to and from other + // hosts that are running CoreDNS on UDP port 53 for service and pod DNS names. Cidrs []string noSmithyDocumentSerde @@ -1824,10 +1941,44 @@ type RemoteNodeNetwork struct { // A network CIDR that can contain pods that run Kubernetes webhooks on hybrid // nodes. +// +// These CIDR blocks are determined by configuring your Container Network +// Interface (CNI) plugin. We recommend the Calico CNI or Cilium CNI. Note that the +// Amazon VPC CNI plugin for Kubernetes isn't available for on-premises and edge +// locations. +// +// Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for +// example, 10.2.0.0/16 ). +// +// It must satisfy the following requirements: +// +// - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed +// size is /24, maximum allowed size is /8. Publicly-routable addresses aren't +// supported. +// +// - Each block cannot overlap with the range of the VPC CIDR blocks for your +// EKS resources, or the block of the Kubernetes service IP range. type RemotePodNetwork struct { // A network CIDR that can contain pods that run Kubernetes webhooks on hybrid // nodes. + // + // These CIDR blocks are determined by configuring your Container Network + // Interface (CNI) plugin. We recommend the Calico CNI or Cilium CNI. Note that the + // Amazon VPC CNI plugin for Kubernetes isn't available for on-premises and edge + // locations. + // + // Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for + // example, 10.2.0.0/16 ). + // + // It must satisfy the following requirements: + // + // - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed + // size is /24, maximum allowed size is /8. Publicly-routable addresses aren't + // supported. + // + // - Each block cannot overlap with the range of the VPC CIDR blocks for your + // EKS resources, or the block of the Kubernetes service IP range. Cidrs []string noSmithyDocumentSerde diff --git a/service/mediaconnect/deserializers.go b/service/mediaconnect/deserializers.go index d22c135acce..b2379c428bc 100644 --- a/service/mediaconnect/deserializers.go +++ b/service/mediaconnect/deserializers.go @@ -10698,6 +10698,11 @@ func awsRestjson1_deserializeDocumentBridgeNetworkSource(v **types.BridgeNetwork sv.MulticastIp = ptr.String(jtv) } + case "multicastSourceSettings": + if err := awsRestjson1_deserializeDocumentMulticastSourceSettings(&sv.MulticastSourceSettings, value); err != nil { + return err + } + case "name": if value != nil { jtv, ok := value.(string) @@ -13110,6 +13115,46 @@ func awsRestjson1_deserializeDocumentMonitoringConfig(v **types.MonitoringConfig return nil } +func awsRestjson1_deserializeDocumentMulticastSourceSettings(v **types.MulticastSourceSettings, 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.MulticastSourceSettings + if *v == nil { + sv = &types.MulticastSourceSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "multicastSourceIp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.MulticastSourceIp = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/mediaconnect/serializers.go b/service/mediaconnect/serializers.go index f46fdbdd5c1..99784be0e9c 100644 --- a/service/mediaconnect/serializers.go +++ b/service/mediaconnect/serializers.go @@ -4952,6 +4952,13 @@ func awsRestjson1_serializeDocumentAddBridgeNetworkSourceRequest(v *types.AddBri ok.String(*v.MulticastIp) } + if v.MulticastSourceSettings != nil { + ok := object.Key("multicastSourceSettings") + if err := awsRestjson1_serializeDocumentMulticastSourceSettings(v.MulticastSourceSettings, ok); err != nil { + return err + } + } + if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) @@ -5547,6 +5554,18 @@ func awsRestjson1_serializeDocumentMonitoringConfig(v *types.MonitoringConfig, v return nil } +func awsRestjson1_serializeDocumentMulticastSourceSettings(v *types.MulticastSourceSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MulticastSourceIp != nil { + ok := object.Key("multicastSourceIp") + ok.String(*v.MulticastSourceIp) + } + + return nil +} + func awsRestjson1_serializeDocumentSetGatewayBridgeSourceRequest(v *types.SetGatewayBridgeSourceRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5746,6 +5765,13 @@ func awsRestjson1_serializeDocumentUpdateBridgeNetworkSourceRequest(v *types.Upd ok.String(*v.MulticastIp) } + if v.MulticastSourceSettings != nil { + ok := object.Key("multicastSourceSettings") + if err := awsRestjson1_serializeDocumentMulticastSourceSettings(v.MulticastSourceSettings, ok); err != nil { + return err + } + } + if v.NetworkName != nil { ok := object.Key("networkName") ok.String(*v.NetworkName) diff --git a/service/mediaconnect/types/types.go b/service/mediaconnect/types/types.go index c2e91d46c68..8bc010b48b8 100644 --- a/service/mediaconnect/types/types.go +++ b/service/mediaconnect/types/types.go @@ -94,6 +94,9 @@ type AddBridgeNetworkSourceRequest struct { // This member is required. Protocol Protocol + // The settings related to the multicast source. + MulticastSourceSettings *MulticastSourceSettings + noSmithyDocumentSerde } @@ -417,6 +420,9 @@ type BridgeNetworkSource struct { // This member is required. Protocol Protocol + // The settings related to the multicast source. + MulticastSourceSettings *MulticastSourceSettings + noSmithyDocumentSerde } @@ -1397,6 +1403,15 @@ type MonitoringConfig struct { noSmithyDocumentSerde } +// The settings related to the multicast source. +type MulticastSourceSettings struct { + + // The IP address of the source for source-specific multicast (SSM). + MulticastSourceIp *string + + noSmithyDocumentSerde +} + // A savings plan that reserves a certain amount of outbound bandwidth usage at a // discounted rate each month over a period of time. type Offering struct { @@ -1977,6 +1992,9 @@ type UpdateBridgeNetworkSourceRequest struct { // The network source multicast IP. MulticastIp *string + // The settings related to the multicast source. + MulticastSourceSettings *MulticastSourceSettings + // The network source's gateway network name. NetworkName *string diff --git a/service/networkmanager/api_op_UpdateDirectConnectGatewayAttachment.go b/service/networkmanager/api_op_UpdateDirectConnectGatewayAttachment.go index 9f8418c39d9..5924c176eb6 100644 --- a/service/networkmanager/api_op_UpdateDirectConnectGatewayAttachment.go +++ b/service/networkmanager/api_op_UpdateDirectConnectGatewayAttachment.go @@ -37,7 +37,7 @@ type UpdateDirectConnectGatewayAttachmentInput struct { // One or more edge locations to update for the Direct Connect gateway attachment. // The updated array of edge locations overwrites the previous array of locations. - // EdgeLocations is only used for Direct Connect gateway attachments. Do + // EdgeLocations is only used for Direct Connect gateway attachments. EdgeLocations []string noSmithyDocumentSerde diff --git a/service/scheduler/internal/endpoints/endpoints.go b/service/scheduler/internal/endpoints/endpoints.go index e238301fe55..99a2dbf2423 100644 --- a/service/scheduler/internal/endpoints/endpoints.go +++ b/service/scheduler/internal/endpoints/endpoints.go @@ -277,6 +277,14 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso-b", @@ -298,6 +306,11 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso-e", diff --git a/service/servicediscovery/api_op_DeleteService.go b/service/servicediscovery/api_op_DeleteService.go index e8bd1a52215..30d2c1f4c8e 100644 --- a/service/servicediscovery/api_op_DeleteService.go +++ b/service/servicediscovery/api_op_DeleteService.go @@ -10,8 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a specified service. If the service still contains one or more -// registered instances, the request fails. +// Deletes a specified service and all associated service attributes. If the +// service still contains one or more registered instances, the request fails. func (c *Client) DeleteService(ctx context.Context, params *DeleteServiceInput, optFns ...func(*Options)) (*DeleteServiceOutput, error) { if params == nil { params = &DeleteServiceInput{} diff --git a/service/servicediscovery/api_op_DeleteServiceAttributes.go b/service/servicediscovery/api_op_DeleteServiceAttributes.go new file mode 100644 index 00000000000..fef057b8b41 --- /dev/null +++ b/service/servicediscovery/api_op_DeleteServiceAttributes.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicediscovery + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes specific attributes associated with a service. +func (c *Client) DeleteServiceAttributes(ctx context.Context, params *DeleteServiceAttributesInput, optFns ...func(*Options)) (*DeleteServiceAttributesOutput, error) { + if params == nil { + params = &DeleteServiceAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteServiceAttributes", params, optFns, c.addOperationDeleteServiceAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteServiceAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteServiceAttributesInput struct { + + // A list of keys corresponding to each attribute that you want to delete. + // + // This member is required. + Attributes []string + + // The ID of the service from which the attributes will be deleted. + // + // This member is required. + ServiceId *string + + noSmithyDocumentSerde +} + +type DeleteServiceAttributesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteServiceAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteServiceAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteServiceAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteServiceAttributes"); 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 = addOpDeleteServiceAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteServiceAttributes(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 +} + +func newServiceMetadataMiddleware_opDeleteServiceAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteServiceAttributes", + } +} diff --git a/service/servicediscovery/api_op_GetServiceAttributes.go b/service/servicediscovery/api_op_GetServiceAttributes.go new file mode 100644 index 00000000000..dc3f092829a --- /dev/null +++ b/service/servicediscovery/api_op_GetServiceAttributes.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicediscovery + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the attributes associated with a specified service. +func (c *Client) GetServiceAttributes(ctx context.Context, params *GetServiceAttributesInput, optFns ...func(*Options)) (*GetServiceAttributesOutput, error) { + if params == nil { + params = &GetServiceAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetServiceAttributes", params, optFns, c.addOperationGetServiceAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetServiceAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetServiceAttributesInput struct { + + // The ID of the service that you want to get attributes for. + // + // This member is required. + ServiceId *string + + noSmithyDocumentSerde +} + +type GetServiceAttributesOutput struct { + + // A complex type that contains the service ARN and a list of attribute key-value + // pairs associated with the service. + ServiceAttributes *types.ServiceAttributes + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetServiceAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetServiceAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetServiceAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetServiceAttributes"); 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 = addOpGetServiceAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceAttributes(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 +} + +func newServiceMetadataMiddleware_opGetServiceAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetServiceAttributes", + } +} diff --git a/service/servicediscovery/api_op_UpdateService.go b/service/servicediscovery/api_op_UpdateService.go index ef35b280efa..c439cfe59c4 100644 --- a/service/servicediscovery/api_op_UpdateService.go +++ b/service/servicediscovery/api_op_UpdateService.go @@ -52,7 +52,8 @@ type UpdateServiceInput struct { // This member is required. Id *string - // A complex type that contains the new settings for the service. + // A complex type that contains the new settings for the service. You can specify + // a maximum of 30 attributes (key-value pairs). // // This member is required. Service *types.ServiceChange diff --git a/service/servicediscovery/api_op_UpdateServiceAttributes.go b/service/servicediscovery/api_op_UpdateServiceAttributes.go new file mode 100644 index 00000000000..20603c622ab --- /dev/null +++ b/service/servicediscovery/api_op_UpdateServiceAttributes.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicediscovery + +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" +) + +// Submits a request to update a specified service to add service-level attributes. +func (c *Client) UpdateServiceAttributes(ctx context.Context, params *UpdateServiceAttributesInput, optFns ...func(*Options)) (*UpdateServiceAttributesOutput, error) { + if params == nil { + params = &UpdateServiceAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateServiceAttributes", params, optFns, c.addOperationUpdateServiceAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateServiceAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateServiceAttributesInput struct { + + // A string map that contains attribute key-value pairs. + // + // This member is required. + Attributes map[string]string + + // The ID of the service that you want to update. + // + // This member is required. + ServiceId *string + + noSmithyDocumentSerde +} + +type UpdateServiceAttributesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateServiceAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateServiceAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateServiceAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateServiceAttributes"); 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 = addOpUpdateServiceAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateServiceAttributes(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 +} + +func newServiceMetadataMiddleware_opUpdateServiceAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateServiceAttributes", + } +} diff --git a/service/servicediscovery/deserializers.go b/service/servicediscovery/deserializers.go index 4a010e86caa..aec053e2694 100644 --- a/service/servicediscovery/deserializers.go +++ b/service/servicediscovery/deserializers.go @@ -759,6 +759,120 @@ func awsAwsjson11_deserializeOpErrorDeleteService(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpDeleteServiceAttributes struct { +} + +func (*awsAwsjson11_deserializeOpDeleteServiceAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteServiceAttributes) 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, awsAwsjson11_deserializeOpErrorDeleteServiceAttributes(response, &metadata) + } + output := &DeleteServiceAttributesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDeleteServiceAttributesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteServiceAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidInput", errorCode): + return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("ServiceNotFound", errorCode): + return awsAwsjson11_deserializeErrorServiceNotFound(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeregisterInstance struct { } @@ -1698,6 +1812,120 @@ func awsAwsjson11_deserializeOpErrorGetService(response *smithyhttp.Response, me } } +type awsAwsjson11_deserializeOpGetServiceAttributes struct { +} + +func (*awsAwsjson11_deserializeOpGetServiceAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetServiceAttributes) 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, awsAwsjson11_deserializeOpErrorGetServiceAttributes(response, &metadata) + } + output := &GetServiceAttributesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetServiceAttributesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetServiceAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidInput", errorCode): + return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("ServiceNotFound", errorCode): + return awsAwsjson11_deserializeErrorServiceNotFound(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListInstances struct { } @@ -2976,9 +3204,129 @@ func (m *awsAwsjson11_deserializeOpUpdatePublicDnsNamespace) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePublicDnsNamespace(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePublicDnsNamespace(response, &metadata) + } + output := &UpdatePublicDnsNamespaceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdatePublicDnsNamespaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdatePublicDnsNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("DuplicateRequest", errorCode): + return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) + + case strings.EqualFold("InvalidInput", errorCode): + return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("NamespaceNotFound", errorCode): + return awsAwsjson11_deserializeErrorNamespaceNotFound(response, errorBody) + + case strings.EqualFold("ResourceInUse", errorCode): + return awsAwsjson11_deserializeErrorResourceInUse(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateService struct { +} + +func (*awsAwsjson11_deserializeOpUpdateService) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateService) 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, awsAwsjson11_deserializeOpErrorUpdateService(response, &metadata) } - output := &UpdatePublicDnsNamespaceOutput{} + output := &UpdateServiceOutput{} out.Result = output var buff [1024]byte @@ -2998,7 +3346,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePublicDnsNamespace) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdatePublicDnsNamespaceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateServiceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3012,7 +3360,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePublicDnsNamespace) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdatePublicDnsNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateService(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)} @@ -3055,11 +3403,8 @@ func awsAwsjson11_deserializeOpErrorUpdatePublicDnsNamespace(response *smithyhtt case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NamespaceNotFound", errorCode): - return awsAwsjson11_deserializeErrorNamespaceNotFound(response, errorBody) - - case strings.EqualFold("ResourceInUse", errorCode): - return awsAwsjson11_deserializeErrorResourceInUse(response, errorBody) + case strings.EqualFold("ServiceNotFound", errorCode): + return awsAwsjson11_deserializeErrorServiceNotFound(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3071,14 +3416,14 @@ func awsAwsjson11_deserializeOpErrorUpdatePublicDnsNamespace(response *smithyhtt } } -type awsAwsjson11_deserializeOpUpdateService struct { +type awsAwsjson11_deserializeOpUpdateServiceAttributes struct { } -func (*awsAwsjson11_deserializeOpUpdateService) ID() string { +func (*awsAwsjson11_deserializeOpUpdateServiceAttributes) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateService) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateServiceAttributes) 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) @@ -3096,9 +3441,9 @@ func (m *awsAwsjson11_deserializeOpUpdateService) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateService(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateServiceAttributes(response, &metadata) } - output := &UpdateServiceOutput{} + output := &UpdateServiceAttributesOutput{} out.Result = output var buff [1024]byte @@ -3118,7 +3463,7 @@ func (m *awsAwsjson11_deserializeOpUpdateService) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateServiceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateServiceAttributesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3132,7 +3477,7 @@ func (m *awsAwsjson11_deserializeOpUpdateService) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateService(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateServiceAttributes(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)} @@ -3169,12 +3514,12 @@ func awsAwsjson11_deserializeOpErrorUpdateService(response *smithyhttp.Response, errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("DuplicateRequest", errorCode): - return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("ServiceAttributesLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceAttributesLimitExceededException(response, errorBody) + case strings.EqualFold("ServiceNotFound", errorCode): return awsAwsjson11_deserializeErrorServiceNotFound(response, errorBody) @@ -3608,6 +3953,41 @@ func awsAwsjson11_deserializeErrorServiceAlreadyExists(response *smithyhttp.Resp return output } +func awsAwsjson11_deserializeErrorServiceAttributesLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceAttributesLimitExceededException{} + err := awsAwsjson11_deserializeDocumentServiceAttributesLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorServiceNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5520,6 +5900,127 @@ func awsAwsjson11_deserializeDocumentServiceAlreadyExists(v **types.ServiceAlrea return nil } +func awsAwsjson11_deserializeDocumentServiceAttributes(v **types.ServiceAttributes, 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.ServiceAttributes + if *v == nil { + sv = &types.ServiceAttributes{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Attributes": + if err := awsAwsjson11_deserializeDocumentServiceAttributesMap(&sv.Attributes, value); err != nil { + return err + } + + case "ServiceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ServiceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceAttributesLimitExceededException(v **types.ServiceAttributesLimitExceededException, 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.ServiceAttributesLimitExceededException + if *v == nil { + sv = &types.ServiceAttributesLimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceAttributesMap(v *map[string]string, 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 mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceAttributeValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson11_deserializeDocumentServiceNotFound(v **types.ServiceNotFound, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6086,6 +6587,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteNamespaceOutput(v **DeleteNamespace return nil } +func awsAwsjson11_deserializeOpDocumentDeleteServiceAttributesOutput(v **DeleteServiceAttributesOutput, 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 *DeleteServiceAttributesOutput + if *v == nil { + sv = &DeleteServiceAttributesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteServiceOutput(v **DeleteServiceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6403,6 +6935,42 @@ func awsAwsjson11_deserializeOpDocumentGetOperationOutput(v **GetOperationOutput return nil } +func awsAwsjson11_deserializeOpDocumentGetServiceAttributesOutput(v **GetServiceAttributesOutput, 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 *GetServiceAttributesOutput + if *v == nil { + sv = &GetServiceAttributesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ServiceAttributes": + if err := awsAwsjson11_deserializeDocumentServiceAttributes(&sv.ServiceAttributes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetServiceOutput(v **GetServiceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6877,6 +7445,37 @@ func awsAwsjson11_deserializeOpDocumentUpdatePublicDnsNamespaceOutput(v **Update return nil } +func awsAwsjson11_deserializeOpDocumentUpdateServiceAttributesOutput(v **UpdateServiceAttributesOutput, 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 *UpdateServiceAttributesOutput + if *v == nil { + sv = &UpdateServiceAttributesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateServiceOutput(v **UpdateServiceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/servicediscovery/generated.json b/service/servicediscovery/generated.json index c9892de7d45..2c74b69476a 100644 --- a/service/servicediscovery/generated.json +++ b/service/servicediscovery/generated.json @@ -14,6 +14,7 @@ "api_op_CreateService.go", "api_op_DeleteNamespace.go", "api_op_DeleteService.go", + "api_op_DeleteServiceAttributes.go", "api_op_DeregisterInstance.go", "api_op_DiscoverInstances.go", "api_op_DiscoverInstancesRevision.go", @@ -22,6 +23,7 @@ "api_op_GetNamespace.go", "api_op_GetOperation.go", "api_op_GetService.go", + "api_op_GetServiceAttributes.go", "api_op_ListInstances.go", "api_op_ListNamespaces.go", "api_op_ListOperations.go", @@ -35,6 +37,7 @@ "api_op_UpdatePrivateDnsNamespace.go", "api_op_UpdatePublicDnsNamespace.go", "api_op_UpdateService.go", + "api_op_UpdateServiceAttributes.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/servicediscovery/serializers.go b/service/servicediscovery/serializers.go index b4b14b97e14..19a92bb5b8f 100644 --- a/service/servicediscovery/serializers.go +++ b/service/servicediscovery/serializers.go @@ -382,6 +382,67 @@ func (m *awsAwsjson11_serializeOpDeleteService) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteServiceAttributes struct { +} + +func (*awsAwsjson11_serializeOpDeleteServiceAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteServiceAttributes) 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.(*DeleteServiceAttributesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Route53AutoNaming_v20170314.DeleteServiceAttributes") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteServiceAttributesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeregisterInstance struct { } @@ -870,6 +931,67 @@ func (m *awsAwsjson11_serializeOpGetService) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetServiceAttributes struct { +} + +func (*awsAwsjson11_serializeOpGetServiceAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetServiceAttributes) 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.(*GetServiceAttributesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Route53AutoNaming_v20170314.GetServiceAttributes") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetServiceAttributesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListInstances struct { } @@ -1662,6 +1784,67 @@ func (m *awsAwsjson11_serializeOpUpdateService) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } + +type awsAwsjson11_serializeOpUpdateServiceAttributes struct { +} + +func (*awsAwsjson11_serializeOpUpdateServiceAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateServiceAttributes) 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.(*UpdateServiceAttributesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Route53AutoNaming_v20170314.UpdateServiceAttributes") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateServiceAttributesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} func awsAwsjson11_serializeDocumentAttributes(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2033,6 +2216,28 @@ func awsAwsjson11_serializeDocumentPublicDnsPropertiesMutableChange(v *types.Pub return nil } +func awsAwsjson11_serializeDocumentServiceAttributeKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentServiceAttributesMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + func awsAwsjson11_serializeDocumentServiceChange(v *types.ServiceChange, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2339,6 +2544,25 @@ func awsAwsjson11_serializeOpDocumentDeleteNamespaceInput(v *DeleteNamespaceInpu return nil } +func awsAwsjson11_serializeOpDocumentDeleteServiceAttributesInput(v *DeleteServiceAttributesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Attributes != nil { + ok := object.Key("Attributes") + if err := awsAwsjson11_serializeDocumentServiceAttributeKeyList(v.Attributes, ok); err != nil { + return err + } + } + + if v.ServiceId != nil { + ok := object.Key("ServiceId") + ok.String(*v.ServiceId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteServiceInput(v *DeleteServiceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2496,6 +2720,18 @@ func awsAwsjson11_serializeOpDocumentGetOperationInput(v *GetOperationInput, val return nil } +func awsAwsjson11_serializeOpDocumentGetServiceAttributesInput(v *GetServiceAttributesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ServiceId != nil { + ok := object.Key("ServiceId") + ok.String(*v.ServiceId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetServiceInput(v *GetServiceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2775,6 +3011,25 @@ func awsAwsjson11_serializeOpDocumentUpdatePublicDnsNamespaceInput(v *UpdatePubl return nil } +func awsAwsjson11_serializeOpDocumentUpdateServiceAttributesInput(v *UpdateServiceAttributesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Attributes != nil { + ok := object.Key("Attributes") + if err := awsAwsjson11_serializeDocumentServiceAttributesMap(v.Attributes, ok); err != nil { + return err + } + } + + if v.ServiceId != nil { + ok := object.Key("ServiceId") + ok.String(*v.ServiceId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateServiceInput(v *UpdateServiceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/servicediscovery/snapshot/api_op_DeleteServiceAttributes.go.snap b/service/servicediscovery/snapshot/api_op_DeleteServiceAttributes.go.snap new file mode 100644 index 00000000000..73659e866e5 --- /dev/null +++ b/service/servicediscovery/snapshot/api_op_DeleteServiceAttributes.go.snap @@ -0,0 +1,41 @@ +DeleteServiceAttributes + 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 + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/servicediscovery/snapshot/api_op_GetServiceAttributes.go.snap b/service/servicediscovery/snapshot/api_op_GetServiceAttributes.go.snap new file mode 100644 index 00000000000..0d21857c836 --- /dev/null +++ b/service/servicediscovery/snapshot/api_op_GetServiceAttributes.go.snap @@ -0,0 +1,41 @@ +GetServiceAttributes + 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 + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/servicediscovery/snapshot/api_op_UpdateServiceAttributes.go.snap b/service/servicediscovery/snapshot/api_op_UpdateServiceAttributes.go.snap new file mode 100644 index 00000000000..8777d2f5cab --- /dev/null +++ b/service/servicediscovery/snapshot/api_op_UpdateServiceAttributes.go.snap @@ -0,0 +1,41 @@ +UpdateServiceAttributes + 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 + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/servicediscovery/snapshot_test.go b/service/servicediscovery/snapshot_test.go index 155a3a30e87..252b8145ddb 100644 --- a/service/servicediscovery/snapshot_test.go +++ b/service/servicediscovery/snapshot_test.go @@ -134,6 +134,18 @@ func TestCheckSnapshot_DeleteService(t *testing.T) { } } +func TestCheckSnapshot_DeleteServiceAttributes(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteServiceAttributes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteServiceAttributes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeregisterInstance(t *testing.T) { svc := New(Options{}) _, err := svc.DeregisterInstance(context.Background(), nil, func(o *Options) { @@ -230,6 +242,18 @@ func TestCheckSnapshot_GetService(t *testing.T) { } } +func TestCheckSnapshot_GetServiceAttributes(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetServiceAttributes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetServiceAttributes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListInstances(t *testing.T) { svc := New(Options{}) _, err := svc.ListInstances(context.Background(), nil, func(o *Options) { @@ -385,6 +409,18 @@ func TestCheckSnapshot_UpdateService(t *testing.T) { t.Fatal(err) } } + +func TestCheckSnapshot_UpdateServiceAttributes(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateServiceAttributes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateServiceAttributes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} func TestUpdateSnapshot_CreateHttpNamespace(t *testing.T) { svc := New(Options{}) _, err := svc.CreateHttpNamespace(context.Background(), nil, func(o *Options) { @@ -457,6 +493,18 @@ func TestUpdateSnapshot_DeleteService(t *testing.T) { } } +func TestUpdateSnapshot_DeleteServiceAttributes(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteServiceAttributes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteServiceAttributes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeregisterInstance(t *testing.T) { svc := New(Options{}) _, err := svc.DeregisterInstance(context.Background(), nil, func(o *Options) { @@ -553,6 +601,18 @@ func TestUpdateSnapshot_GetService(t *testing.T) { } } +func TestUpdateSnapshot_GetServiceAttributes(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetServiceAttributes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetServiceAttributes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListInstances(t *testing.T) { svc := New(Options{}) _, err := svc.ListInstances(context.Background(), nil, func(o *Options) { @@ -708,3 +768,15 @@ func TestUpdateSnapshot_UpdateService(t *testing.T) { t.Fatal(err) } } + +func TestUpdateSnapshot_UpdateServiceAttributes(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateServiceAttributes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateServiceAttributes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/servicediscovery/types/errors.go b/service/servicediscovery/types/errors.go index faeb64dd981..cb9d5ac3bea 100644 --- a/service/servicediscovery/types/errors.go +++ b/service/servicediscovery/types/errors.go @@ -337,6 +337,35 @@ func (e *ServiceAlreadyExists) ErrorCode() string { } func (e *ServiceAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The attribute can't be added to the service because you've exceeded the quota +// for the number of attributes you can add to a service. +type ServiceAttributesLimitExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ServiceAttributesLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceAttributesLimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceAttributesLimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceAttributesLimitExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceAttributesLimitExceededException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // No service exists with the specified ID. type ServiceNotFound struct { Message *string diff --git a/service/servicediscovery/types/types.go b/service/servicediscovery/types/types.go index f0921d6ceee..9a4b5375787 100644 --- a/service/servicediscovery/types/types.go +++ b/service/servicediscovery/types/types.go @@ -9,14 +9,15 @@ import ( // A complex type that contains information about the Amazon Route 53 DNS records // that you want Cloud Map to create when you register an instance. -// -// The record types of a service can only be changed by deleting the service and -// recreating it with a new Dnsconfig . type DnsConfig struct { // An array that contains one DnsRecord object for each Route 53 DNS record that // you want Cloud Map to create when you register an instance. // + // The record type of a service specified in a DnsRecord object can't be updated. + // To change a record type, you need to delete the service and recreate it with a + // new DnsConfig . + // // This member is required. DnsRecords []DnsRecord @@ -1057,6 +1058,26 @@ type Service struct { noSmithyDocumentSerde } +// A complex type that contains information about attributes associated with a +// specific service. +type ServiceAttributes struct { + + // A string map that contains the following information for the service that you + // specify in ServiceArn : + // + // - The attributes that apply to the service. + // + // - For each attribute, the applicable value. + // + // You can specify a total of 30 attributes. + Attributes map[string]string + + // The ARN of the service that the attributes are associated with. + ServiceArn *string + + noSmithyDocumentSerde +} + // A complex type that contains changes to an existing service. type ServiceChange struct { diff --git a/service/servicediscovery/validators.go b/service/servicediscovery/validators.go index 6b774a073d9..58a440ee103 100644 --- a/service/servicediscovery/validators.go +++ b/service/servicediscovery/validators.go @@ -110,6 +110,26 @@ func (m *validateOpDeleteNamespace) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpDeleteServiceAttributes struct { +} + +func (*validateOpDeleteServiceAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteServiceAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteServiceAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteServiceAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteService struct { } @@ -270,6 +290,26 @@ func (m *validateOpGetOperation) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpGetServiceAttributes struct { +} + +func (*validateOpGetServiceAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetServiceAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetServiceAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetServiceAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetService struct { } @@ -530,6 +570,26 @@ func (m *validateOpUpdatePublicDnsNamespace) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpUpdateServiceAttributes struct { +} + +func (*validateOpUpdateServiceAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateServiceAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateServiceAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateServiceAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateService struct { } @@ -570,6 +630,10 @@ func addOpDeleteNamespaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteNamespace{}, middleware.After) } +func addOpDeleteServiceAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteServiceAttributes{}, middleware.After) +} + func addOpDeleteServiceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteService{}, middleware.After) } @@ -602,6 +666,10 @@ func addOpGetOperationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetOperation{}, middleware.After) } +func addOpGetServiceAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetServiceAttributes{}, middleware.After) +} + func addOpGetServiceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetService{}, middleware.After) } @@ -654,6 +722,10 @@ func addOpUpdatePublicDnsNamespaceValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpUpdatePublicDnsNamespace{}, middleware.After) } +func addOpUpdateServiceAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateServiceAttributes{}, middleware.After) +} + func addOpUpdateServiceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateService{}, middleware.After) } @@ -1257,6 +1329,24 @@ func validateOpDeleteNamespaceInput(v *DeleteNamespaceInput) error { } } +func validateOpDeleteServiceAttributesInput(v *DeleteServiceAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteServiceAttributesInput"} + if v.ServiceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) + } + if v.Attributes == nil { + invalidParams.Add(smithy.NewErrParamRequired("Attributes")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteServiceInput(v *DeleteServiceInput) error { if v == nil { return nil @@ -1389,6 +1479,21 @@ func validateOpGetOperationInput(v *GetOperationInput) error { } } +func validateOpGetServiceAttributesInput(v *GetServiceAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetServiceAttributesInput"} + if v.ServiceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetServiceInput(v *GetServiceInput) error { if v == nil { return nil @@ -1633,6 +1738,24 @@ func validateOpUpdatePublicDnsNamespaceInput(v *UpdatePublicDnsNamespaceInput) e } } +func validateOpUpdateServiceAttributesInput(v *UpdateServiceAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateServiceAttributesInput"} + if v.ServiceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) + } + if v.Attributes == nil { + invalidParams.Add(smithy.NewErrParamRequired("Attributes")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateServiceInput(v *UpdateServiceInput) error { if v == nil { return nil diff --git a/service/trustedadvisor/internal/endpoints/endpoints.go b/service/trustedadvisor/internal/endpoints/endpoints.go index fde3fcbeb1f..c80f9ff85bc 100644 --- a/service/trustedadvisor/internal/endpoints/endpoints.go +++ b/service/trustedadvisor/internal/endpoints/endpoints.go @@ -138,6 +138,32 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "fips-us-east-1", + }: endpoints.Endpoint{ + Hostname: "trustedadvisor-fips.us-east-1.api.aws", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "fips-us-east-2", + }: endpoints.Endpoint{ + Hostname: "trustedadvisor-fips.us-east-2.api.aws", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-2", + }: endpoints.Endpoint{ + Hostname: "trustedadvisor-fips.us-west-2.api.aws", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + }, }, { ID: "aws-cn",