diff --git a/.changelog/09d52f92d28f48ce8cbcde8ec0968621.json b/.changelog/09d52f92d28f48ce8cbcde8ec0968621.json new file mode 100644 index 00000000000..4e61888c1d2 --- /dev/null +++ b/.changelog/09d52f92d28f48ce8cbcde8ec0968621.json @@ -0,0 +1,8 @@ +{ + "id": "09d52f92-d28f-48ce-8cbc-de8ec0968621", + "type": "feature", + "description": "This release add new api listRelatedResourcesForAuditFinding and new member type IssuerCertificates for Iot device device defender Audit.", + "modules": [ + "service/iot" + ] +} \ No newline at end of file diff --git a/.changelog/2e5b0d645ad140838fece0573fb3018e.json b/.changelog/2e5b0d645ad140838fece0573fb3018e.json new file mode 100644 index 00000000000..7dfc64064bd --- /dev/null +++ b/.changelog/2e5b0d645ad140838fece0573fb3018e.json @@ -0,0 +1,8 @@ +{ + "id": "2e5b0d64-5ad1-4083-8fec-e0573fb3018e", + "type": "feature", + "description": "AWS License Manager now supports onboarded Management Accounts or Delegated Admins to view granted licenses aggregated from all accounts in the organization.", + "modules": [ + "service/licensemanager" + ] +} \ No newline at end of file diff --git a/.changelog/441368b53c974d7b84d7b48a31ee9b35.json b/.changelog/441368b53c974d7b84d7b48a31ee9b35.json new file mode 100644 index 00000000000..56c2002eb48 --- /dev/null +++ b/.changelog/441368b53c974d7b84d7b48a31ee9b35.json @@ -0,0 +1,8 @@ +{ + "id": "441368b5-3c97-4d7b-84d7-b48a31ee9b35", + "type": "documentation", + "description": "Documentation updates for Security Hub", + "modules": [ + "service/securityhub" + ] +} \ No newline at end of file diff --git a/.changelog/48fc6704bd714925a203f57c995668eb.json b/.changelog/48fc6704bd714925a203f57c995668eb.json new file mode 100644 index 00000000000..31852fa34e5 --- /dev/null +++ b/.changelog/48fc6704bd714925a203f57c995668eb.json @@ -0,0 +1,8 @@ +{ + "id": "48fc6704-bd71-4925-a203-f57c995668eb", + "type": "documentation", + "description": "Added links related to enabling job bookmarks.", + "modules": [ + "service/glue" + ] +} \ No newline at end of file diff --git a/.changelog/7b0d603d72bf47538aae6516204d3833.json b/.changelog/7b0d603d72bf47538aae6516204d3833.json new file mode 100644 index 00000000000..2f7443b251c --- /dev/null +++ b/.changelog/7b0d603d72bf47538aae6516204d3833.json @@ -0,0 +1,8 @@ +{ + "id": "7b0d603d-72bf-4753-8aae-6516204d3833", + "type": "feature", + "description": "RelatedItems now have an ID field which can be used for referencing them else where. Introducing event references in TimelineEvent API and increasing maximum length of \"eventData\" to 12K characters.", + "modules": [ + "service/ssmincidents" + ] +} \ No newline at end of file diff --git a/.changelog/a30d951fb7aa48e38bdb4841d4a9ded0.json b/.changelog/a30d951fb7aa48e38bdb4841d4a9ded0.json new file mode 100644 index 00000000000..53dd0c594f4 --- /dev/null +++ b/.changelog/a30d951fb7aa48e38bdb4841d4a9ded0.json @@ -0,0 +1,8 @@ +{ + "id": "a30d951f-b7aa-48e3-8bdb-4841d4a9ded0", + "type": "feature", + "description": "Adding support for ImageProperties feature to detect dominant colors and image brightness, sharpness, and contrast, inclusion and exclusion filters for labels and label categories, new fields to the API response, \"aliases\" and \"categories\"", + "modules": [ + "service/rekognition" + ] +} \ No newline at end of file diff --git a/.changelog/ca2595cbdb604a4782423111eed50fab.json b/.changelog/ca2595cbdb604a4782423111eed50fab.json new file mode 100644 index 00000000000..430e33f4e0c --- /dev/null +++ b/.changelog/ca2595cbdb604a4782423111eed50fab.json @@ -0,0 +1,8 @@ +{ + "id": "ca2595cb-db60-4a47-8242-3111eed50fab", + "type": "feature", + "description": "Added three new APIs to support tagging and tag-based authorization: TagResource, UntagResource, and ListTagsForResource. Added optional parameters to the StartChangeSet API to support tagging a resource while making a request to create it.", + "modules": [ + "service/marketplacecatalog" + ] +} \ No newline at end of file diff --git a/service/gamesparks/internal/endpoints/endpoints.go b/service/gamesparks/internal/endpoints/endpoints.go index e0922f9a68a..8fe6b243660 100644 --- a/service/gamesparks/internal/endpoints/endpoints.go +++ b/service/gamesparks/internal/endpoints/endpoints.go @@ -135,6 +135,9 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, diff --git a/service/glue/api_op_CreateDevEndpoint.go b/service/glue/api_op_CreateDevEndpoint.go index f1874c45220..d0b22f7d0f1 100644 --- a/service/glue/api_op_CreateDevEndpoint.go +++ b/service/glue/api_op_CreateDevEndpoint.go @@ -141,7 +141,7 @@ type CreateDevEndpointOutput struct { // Python 2. Arguments map[string]string - // The AWS Availability Zone where this DevEndpoint is located. + // The Amazon Web Services Availability Zone where this DevEndpoint is located. AvailabilityZone *string // The point in time at which this DevEndpoint was created. diff --git a/service/glue/api_op_GetDevEndpoints.go b/service/glue/api_op_GetDevEndpoints.go index d1ca7e8b5ac..591d48d1558 100644 --- a/service/glue/api_op_GetDevEndpoints.go +++ b/service/glue/api_op_GetDevEndpoints.go @@ -12,10 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves all the development endpoints in this AWS account. When you create a -// development endpoint in a virtual private cloud (VPC), Glue returns only a -// private IP address and the public IP address field is not populated. When you -// create a non-VPC development endpoint, Glue returns only a public IP address. +// Retrieves all the development endpoints in this Amazon Web Services account. +// When you create a development endpoint in a virtual private cloud (VPC), Glue +// returns only a private IP address and the public IP address field is not +// populated. When you create a non-VPC development endpoint, Glue returns only a +// public IP address. func (c *Client) GetDevEndpoints(ctx context.Context, params *GetDevEndpointsInput, optFns ...func(*Options)) (*GetDevEndpointsOutput, error) { if params == nil { params = &GetDevEndpointsInput{} diff --git a/service/glue/api_op_GetJobBookmark.go b/service/glue/api_op_GetJobBookmark.go index 54ae9b40118..12aa634271f 100644 --- a/service/glue/api_op_GetJobBookmark.go +++ b/service/glue/api_op_GetJobBookmark.go @@ -11,7 +11,19 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns information on a job bookmark entry. +// Returns information on a job bookmark entry. For more information about enabling +// and using job bookmarks, see: +// +// * Tracking processed data using job bookmarks +// (https://docs.aws.amazon.com/glue/latest/dg/monitor-continuations.html) +// +// * Job +// parameters used by Glue +// (https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html) +// +// * +// Job structure +// (https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-job.html#aws-glue-api-jobs-job-Job) func (c *Client) GetJobBookmark(ctx context.Context, params *GetJobBookmarkInput, optFns ...func(*Options)) (*GetJobBookmarkOutput, error) { if params == nil { params = &GetJobBookmarkInput{} diff --git a/service/glue/api_op_ResetJobBookmark.go b/service/glue/api_op_ResetJobBookmark.go index 50a871969d8..d1b233fc654 100644 --- a/service/glue/api_op_ResetJobBookmark.go +++ b/service/glue/api_op_ResetJobBookmark.go @@ -11,7 +11,19 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Resets a bookmark entry. +// Resets a bookmark entry. For more information about enabling and using job +// bookmarks, see: +// +// * Tracking processed data using job bookmarks +// (https://docs.aws.amazon.com/glue/latest/dg/monitor-continuations.html) +// +// * Job +// parameters used by Glue +// (https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html) +// +// * +// Job structure +// (https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-job.html#aws-glue-api-jobs-job-Job) func (c *Client) ResetJobBookmark(ctx context.Context, params *ResetJobBookmarkInput, optFns ...func(*Options)) (*ResetJobBookmarkOutput, error) { if params == nil { params = &ResetJobBookmarkInput{} diff --git a/service/glue/types/types.go b/service/glue/types/types.go index 54de094ed0d..94cbb3cbf14 100644 --- a/service/glue/types/types.go +++ b/service/glue/types/types.go @@ -1986,7 +1986,7 @@ type DevEndpoint struct { // Python 2. Arguments map[string]string - // The AWS Availability Zone where this DevEndpoint is located. + // The Amazon Web Services Availability Zone where this DevEndpoint is located. AvailabilityZone *string // The point in time at which this DevEndpoint was created. diff --git a/service/iot/api_op_ListRelatedResourcesForAuditFinding.go b/service/iot/api_op_ListRelatedResourcesForAuditFinding.go new file mode 100644 index 00000000000..df05f506123 --- /dev/null +++ b/service/iot/api_op_ListRelatedResourcesForAuditFinding.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The related resources of an Audit finding. The following resources can be +// returned from calling this API: +// +// * DEVICE_CERTIFICATE +// +// * CA_CERTIFICATE +// +// * +// IOT_POLICY +// +// * COGNITO_IDENTITY_POOL +// +// * CLIENT_ID +// +// * ACCOUNT_SETTINGS +// +// * +// ROLE_ALIAS +// +// * IAM_ROLE +// +// * ISSUER_CERTIFICATE +// +// This API is similar to +// DescribeAuditFinding's RelatedResources +// (https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeAuditFinding.html) +// but provides pagination and is not limited to 10 resources. When calling +// DescribeAuditFinding +// (https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeAuditFinding.html) +// for the intermediate CA revoked for active device certificates check, +// RelatedResources will not be populated. You must use this API, +// ListRelatedResourcesForAuditFinding, to list the certificates. +func (c *Client) ListRelatedResourcesForAuditFinding(ctx context.Context, params *ListRelatedResourcesForAuditFindingInput, optFns ...func(*Options)) (*ListRelatedResourcesForAuditFindingOutput, error) { + if params == nil { + params = &ListRelatedResourcesForAuditFindingInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRelatedResourcesForAuditFinding", params, optFns, c.addOperationListRelatedResourcesForAuditFindingMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRelatedResourcesForAuditFindingOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRelatedResourcesForAuditFindingInput struct { + + // The finding Id. + // + // This member is required. + FindingId *string + + // The maximum number of results to return at one time. + MaxResults *int32 + + // A token that can be used to retrieve the next set of results, or null if there + // are no additional results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListRelatedResourcesForAuditFindingOutput struct { + + // A token that can be used to retrieve the next set of results, or null for the + // first API call. + NextToken *string + + // The related resources. + RelatedResources []types.RelatedResource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRelatedResourcesForAuditFindingMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRelatedResourcesForAuditFinding{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListRelatedResourcesForAuditFindingValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRelatedResourcesForAuditFinding(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListRelatedResourcesForAuditFinding(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "execute-api", + OperationName: "ListRelatedResourcesForAuditFinding", + } +} diff --git a/service/iot/api_op_ListThings.go b/service/iot/api_op_ListThings.go index 4901cc5a551..0ad8bbecfde 100644 --- a/service/iot/api_op_ListThings.go +++ b/service/iot/api_op_ListThings.go @@ -15,7 +15,10 @@ import ( // Lists your things. Use the attributeName and attributeValue parameters to filter // your things. For example, calling ListThings with attributeName=Color and // attributeValue=Red retrieves all things in the registry that contain an -// attribute Color with the value Red. Requires permission to access the ListThings +// attribute Color with the value Red. For more information, see List Things +// (https://docs.aws.amazon.com/iot/latest/developerguide/thing-registry.html#list-things) +// from the Amazon Web Services IoT Core Developer Guide. Requires permission to +// access the ListThings // (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) // action. You will not be charged for calling this API if an Access denied error // is returned. You will also not be charged if no attributes or pagination token diff --git a/service/iot/deserializers.go b/service/iot/deserializers.go index 2ffa5e4eb19..57b5065ec15 100644 --- a/service/iot/deserializers.go +++ b/service/iot/deserializers.go @@ -25719,6 +25719,171 @@ func awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(v return nil } +type awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding struct { +} + +func (*awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListRelatedResourcesForAuditFinding(response, &metadata) + } + output := &ListRelatedResourcesForAuditFindingOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListRelatedResourcesForAuditFinding(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput(v **ListRelatedResourcesForAuditFindingOutput, 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 *ListRelatedResourcesForAuditFindingOutput + if *v == nil { + sv = &ListRelatedResourcesForAuditFindingOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "relatedResources": + if err := awsRestjson1_deserializeDocumentRelatedResources(&sv.RelatedResources, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListRoleAliases struct { } @@ -44891,6 +45056,64 @@ func awsRestjson1_deserializeDocumentIotSiteWiseAction(v **types.IotSiteWiseActi return nil } +func awsRestjson1_deserializeDocumentIssuerCertificateIdentifier(v **types.IssuerCertificateIdentifier, 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.IssuerCertificateIdentifier + if *v == nil { + sv = &types.IssuerCertificateIdentifier{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "issuerCertificateSerialNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IssuerCertificateSerialNumber to be of type string, got %T instead", value) + } + sv.IssuerCertificateSerialNumber = ptr.String(jtv) + } + + case "issuerCertificateSubject": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IssuerCertificateSubject to be of type string, got %T instead", value) + } + sv.IssuerCertificateSubject = ptr.String(jtv) + } + + case "issuerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IssuerId to be of type string, got %T instead", value) + } + sv.IssuerId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentJob(v **types.Job, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -49943,6 +50166,15 @@ func awsRestjson1_deserializeDocumentResourceIdentifier(v **types.ResourceIdenti sv.CognitoIdentityPoolId = ptr.String(jtv) } + case "deviceCertificateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + } + sv.DeviceCertificateArn = ptr.String(jtv) + } + case "deviceCertificateId": if value != nil { jtv, ok := value.(string) @@ -49961,6 +50193,11 @@ func awsRestjson1_deserializeDocumentResourceIdentifier(v **types.ResourceIdenti sv.IamRoleArn = ptr.String(jtv) } + case "issuerCertificateIdentifier": + if err := awsRestjson1_deserializeDocumentIssuerCertificateIdentifier(&sv.IssuerCertificateIdentifier, value); err != nil { + return err + } + case "policyVersionIdentifier": if err := awsRestjson1_deserializeDocumentPolicyVersionIdentifier(&sv.PolicyVersionIdentifier, value); err != nil { return err diff --git a/service/iot/generated.json b/service/iot/generated.json index 40682ebddaa..55058d561ce 100644 --- a/service/iot/generated.json +++ b/service/iot/generated.json @@ -174,6 +174,7 @@ "api_op_ListPrincipalThings.go", "api_op_ListProvisioningTemplateVersions.go", "api_op_ListProvisioningTemplates.go", + "api_op_ListRelatedResourcesForAuditFinding.go", "api_op_ListRoleAliases.go", "api_op_ListScheduledAudits.go", "api_op_ListSecurityProfiles.go", diff --git a/service/iot/serializers.go b/service/iot/serializers.go index 9af78430fa6..ba1a7fce1cb 100644 --- a/service/iot/serializers.go +++ b/service/iot/serializers.go @@ -11571,6 +11571,67 @@ func awsRestjson1_serializeOpHttpBindingsListProvisioningTemplateVersionsInput(v return nil } +type awsRestjson1_serializeOpListRelatedResourcesForAuditFinding struct { +} + +func (*awsRestjson1_serializeOpListRelatedResourcesForAuditFinding) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRelatedResourcesForAuditFinding) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListRelatedResourcesForAuditFindingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/audit/relatedResources") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListRelatedResourcesForAuditFindingInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListRelatedResourcesForAuditFindingInput(v *ListRelatedResourcesForAuditFindingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FindingId != nil { + encoder.SetQuery("findingId").String(*v.FindingId) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListRoleAliases struct { } @@ -18972,6 +19033,28 @@ func awsRestjson1_serializeDocumentIotSiteWiseAction(v *types.IotSiteWiseAction, return nil } +func awsRestjson1_serializeDocumentIssuerCertificateIdentifier(v *types.IssuerCertificateIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IssuerCertificateSerialNumber != nil { + ok := object.Key("issuerCertificateSerialNumber") + ok.String(*v.IssuerCertificateSerialNumber) + } + + if v.IssuerCertificateSubject != nil { + ok := object.Key("issuerCertificateSubject") + ok.String(*v.IssuerCertificateSubject) + } + + if v.IssuerId != nil { + ok := object.Key("issuerId") + ok.String(*v.IssuerId) + } + + return nil +} + func awsRestjson1_serializeDocumentJobExecutionsRetryConfig(v *types.JobExecutionsRetryConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -19805,6 +19888,11 @@ func awsRestjson1_serializeDocumentResourceIdentifier(v *types.ResourceIdentifie ok.String(*v.CognitoIdentityPoolId) } + if v.DeviceCertificateArn != nil { + ok := object.Key("deviceCertificateArn") + ok.String(*v.DeviceCertificateArn) + } + if v.DeviceCertificateId != nil { ok := object.Key("deviceCertificateId") ok.String(*v.DeviceCertificateId) @@ -19815,6 +19903,13 @@ func awsRestjson1_serializeDocumentResourceIdentifier(v *types.ResourceIdentifie ok.String(*v.IamRoleArn) } + if v.IssuerCertificateIdentifier != nil { + ok := object.Key("issuerCertificateIdentifier") + if err := awsRestjson1_serializeDocumentIssuerCertificateIdentifier(v.IssuerCertificateIdentifier, ok); err != nil { + return err + } + } + if v.PolicyVersionIdentifier != nil { ok := object.Key("policyVersionIdentifier") if err := awsRestjson1_serializeDocumentPolicyVersionIdentifier(v.PolicyVersionIdentifier, ok); err != nil { diff --git a/service/iot/types/enums.go b/service/iot/types/enums.go index 731ca437e26..0e8e938cc41 100644 --- a/service/iot/types/enums.go +++ b/service/iot/types/enums.go @@ -1205,6 +1205,7 @@ const ( ResourceTypeAccountSettings ResourceType = "ACCOUNT_SETTINGS" ResourceTypeRoleAlias ResourceType = "ROLE_ALIAS" ResourceTypeIamRole ResourceType = "IAM_ROLE" + ResourceTypeIssuerCertificate ResourceType = "ISSUER_CERTIFICATE" ) // Values returns all known values for ResourceType. Note that this can be expanded @@ -1220,6 +1221,7 @@ func (ResourceType) Values() []ResourceType { "ACCOUNT_SETTINGS", "ROLE_ALIAS", "IAM_ROLE", + "ISSUER_CERTIFICATE", } } diff --git a/service/iot/types/types.go b/service/iot/types/types.go index 14d1c8e236a..772904e853f 100644 --- a/service/iot/types/types.go +++ b/service/iot/types/types.go @@ -1872,6 +1872,21 @@ type IotSiteWiseAction struct { noSmithyDocumentSerde } +// The certificate issuer indentifier. +type IssuerCertificateIdentifier struct { + + // The issuer certificate serial number. + IssuerCertificateSerialNumber *string + + // The subject of the issuer certificate. + IssuerCertificateSubject *string + + // The issuer ID. + IssuerId *string + + noSmithyDocumentSerde +} + // The Job object contains details about a job. type Job struct { @@ -3004,12 +3019,18 @@ type ResourceIdentifier struct { // The ID of the Amazon Cognito identity pool. CognitoIdentityPoolId *string + // The ARN of the identified device certificate. + DeviceCertificateArn *string + // The ID of the certificate attached to the resource. DeviceCertificateId *string // The ARN of the IAM role that has overly permissive actions. IamRoleArn *string + // The issuer certificate identifier. + IssuerCertificateIdentifier *IssuerCertificateIdentifier + // The version of the policy associated with the resource. PolicyVersionIdentifier *PolicyVersionIdentifier diff --git a/service/iot/validators.go b/service/iot/validators.go index 6e0565b26d9..4a362ad5ffe 100644 --- a/service/iot/validators.go +++ b/service/iot/validators.go @@ -2590,6 +2590,26 @@ func (m *validateOpListProvisioningTemplateVersions) HandleInitialize(ctx contex return next.HandleInitialize(ctx, in) } +type validateOpListRelatedResourcesForAuditFinding struct { +} + +func (*validateOpListRelatedResourcesForAuditFinding) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRelatedResourcesForAuditFinding) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRelatedResourcesForAuditFindingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRelatedResourcesForAuditFindingInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListSecurityProfilesForTarget struct { } @@ -4186,6 +4206,10 @@ func addOpListProvisioningTemplateVersionsValidationMiddleware(stack *middleware return stack.Initialize.Add(&validateOpListProvisioningTemplateVersions{}, middleware.After) } +func addOpListRelatedResourcesForAuditFindingValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRelatedResourcesForAuditFinding{}, middleware.After) +} + func addOpListSecurityProfilesForTargetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSecurityProfilesForTarget{}, middleware.After) } @@ -8353,6 +8377,21 @@ func validateOpListProvisioningTemplateVersionsInput(v *ListProvisioningTemplate } } +func validateOpListRelatedResourcesForAuditFindingInput(v *ListRelatedResourcesForAuditFindingInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRelatedResourcesForAuditFindingInput"} + if v.FindingId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FindingId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListSecurityProfilesForTargetInput(v *ListSecurityProfilesForTargetInput) error { if v == nil { return nil diff --git a/service/licensemanager/api_op_CheckoutLicense.go b/service/licensemanager/api_op_CheckoutLicense.go index b4b56bf611e..1d24a6e5c11 100644 --- a/service/licensemanager/api_op_CheckoutLicense.go +++ b/service/licensemanager/api_op_CheckoutLicense.go @@ -11,7 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Checks out the specified license. +// Checks out the specified license. If the account that created the license is the +// same that is performing the check out, you must specify the account as the +// beneficiary. func (c *Client) CheckoutLicense(ctx context.Context, params *CheckoutLicenseInput, optFns ...func(*Options)) (*CheckoutLicenseOutput, error) { if params == nil { params = &CheckoutLicenseInput{} diff --git a/service/licensemanager/api_op_CreateGrant.go b/service/licensemanager/api_op_CreateGrant.go index 22810523f12..5b8d9952e14 100644 --- a/service/licensemanager/api_op_CreateGrant.go +++ b/service/licensemanager/api_op_CreateGrant.go @@ -56,7 +56,8 @@ type CreateGrantInput struct { // This member is required. LicenseArn *string - // The grant principals. + // The grant principals. This value should be specified as an Amazon Resource Name + // (ARN). // // This member is required. Principals []string diff --git a/service/licensemanager/api_op_CreateLicenseConversionTaskForResource.go b/service/licensemanager/api_op_CreateLicenseConversionTaskForResource.go index a9eb9ecc51e..c0a613798e3 100644 --- a/service/licensemanager/api_op_CreateLicenseConversionTaskForResource.go +++ b/service/licensemanager/api_op_CreateLicenseConversionTaskForResource.go @@ -30,8 +30,8 @@ func (c *Client) CreateLicenseConversionTaskForResource(ctx context.Context, par type CreateLicenseConversionTaskForResourceInput struct { // Information that identifies the license type you are converting to. For the - // structure of the destination license, see Convert a license type using the AWS - // CLI + // structure of the destination license, see Convert a license type using the + // Amazon Web Services CLI // (https://docs.aws.amazon.com/license-manager/latest/userguide/conversion-procedures.html#conversion-cli) // in the License Manager User Guide. // @@ -45,7 +45,8 @@ type CreateLicenseConversionTaskForResourceInput struct { ResourceArn *string // Information that identifies the license type you are converting from. For the - // structure of the source license, see Convert a license type using the AWS CLI + // structure of the source license, see Convert a license type using the Amazon Web + // Services CLI // (https://docs.aws.amazon.com/license-manager/latest/userguide/conversion-procedures.html#conversion-cli) // in the License Manager User Guide. // diff --git a/service/licensemanager/api_op_ListReceivedGrantsForOrganization.go b/service/licensemanager/api_op_ListReceivedGrantsForOrganization.go new file mode 100644 index 00000000000..b8209107b84 --- /dev/null +++ b/service/licensemanager/api_op_ListReceivedGrantsForOrganization.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanager + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/licensemanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the grants received for all accounts in the organization. +func (c *Client) ListReceivedGrantsForOrganization(ctx context.Context, params *ListReceivedGrantsForOrganizationInput, optFns ...func(*Options)) (*ListReceivedGrantsForOrganizationOutput, error) { + if params == nil { + params = &ListReceivedGrantsForOrganizationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListReceivedGrantsForOrganization", params, optFns, c.addOperationListReceivedGrantsForOrganizationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListReceivedGrantsForOrganizationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListReceivedGrantsForOrganizationInput struct { + + // The Amazon Resource Name (ARN) of the received license. + // + // This member is required. + LicenseArn *string + + // Filters to scope the results. The following filters are supported: + // + // * + // ParentArn + // + // * GranteePrincipalArn + Filters []types.Filter + + // Maximum number of results to return in a single call. + MaxResults *int32 + + // Token for the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListReceivedGrantsForOrganizationOutput struct { + + // Lists the grants the organization has received. + Grants []types.Grant + + // Token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListReceivedGrantsForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReceivedGrantsForOrganization{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReceivedGrantsForOrganization{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListReceivedGrantsForOrganizationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReceivedGrantsForOrganization(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListReceivedGrantsForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "license-manager", + OperationName: "ListReceivedGrantsForOrganization", + } +} diff --git a/service/licensemanager/api_op_ListReceivedLicensesForOrganization.go b/service/licensemanager/api_op_ListReceivedLicensesForOrganization.go new file mode 100644 index 00000000000..d55a759d4a7 --- /dev/null +++ b/service/licensemanager/api_op_ListReceivedLicensesForOrganization.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanager + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/licensemanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the licenses received for all accounts in the organization. +func (c *Client) ListReceivedLicensesForOrganization(ctx context.Context, params *ListReceivedLicensesForOrganizationInput, optFns ...func(*Options)) (*ListReceivedLicensesForOrganizationOutput, error) { + if params == nil { + params = &ListReceivedLicensesForOrganizationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListReceivedLicensesForOrganization", params, optFns, c.addOperationListReceivedLicensesForOrganizationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListReceivedLicensesForOrganizationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListReceivedLicensesForOrganizationInput struct { + + // Filters to scope the results. The following filters are supported: + // + // * + // Beneficiary + // + // * ProductSKU + Filters []types.Filter + + // Maximum number of results to return in a single call. + MaxResults *int32 + + // Token for the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListReceivedLicensesForOrganizationOutput struct { + + // Lists the licenses the organization has received. + Licenses []types.GrantedLicense + + // Token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListReceivedLicensesForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReceivedLicensesForOrganization{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReceivedLicensesForOrganization{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReceivedLicensesForOrganization(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListReceivedLicensesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "license-manager", + OperationName: "ListReceivedLicensesForOrganization", + } +} diff --git a/service/licensemanager/deserializers.go b/service/licensemanager/deserializers.go index c21f19ea9e9..e2a934625fc 100644 --- a/service/licensemanager/deserializers.go +++ b/service/licensemanager/deserializers.go @@ -4630,6 +4630,135 @@ func awsAwsjson11_deserializeOpErrorListReceivedGrants(response *smithyhttp.Resp } } +type awsAwsjson11_deserializeOpListReceivedGrantsForOrganization struct { +} + +func (*awsAwsjson11_deserializeOpListReceivedGrantsForOrganization) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListReceivedGrantsForOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListReceivedGrantsForOrganization(response, &metadata) + } + output := &ListReceivedGrantsForOrganizationOutput{} + 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_deserializeOpDocumentListReceivedGrantsForOrganizationOutput(&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_deserializeOpErrorListReceivedGrantsForOrganization(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("AuthorizationException", errorCode): + return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("RateLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServerInternalException", errorCode): + return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListReceivedLicenses struct { } @@ -4759,6 +4888,135 @@ func awsAwsjson11_deserializeOpErrorListReceivedLicenses(response *smithyhttp.Re } } +type awsAwsjson11_deserializeOpListReceivedLicensesForOrganization struct { +} + +func (*awsAwsjson11_deserializeOpListReceivedLicensesForOrganization) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListReceivedLicensesForOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListReceivedLicensesForOrganization(response, &metadata) + } + output := &ListReceivedLicensesForOrganizationOutput{} + 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_deserializeOpDocumentListReceivedLicensesForOrganizationOutput(&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_deserializeOpErrorListReceivedLicensesForOrganization(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("AuthorizationException", errorCode): + return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("RateLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServerInternalException", errorCode): + return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListResourceInventory struct { } @@ -12671,6 +12929,51 @@ func awsAwsjson11_deserializeOpDocumentListLicenseVersionsOutput(v **ListLicense return nil } +func awsAwsjson11_deserializeOpDocumentListReceivedGrantsForOrganizationOutput(v **ListReceivedGrantsForOrganizationOutput, 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 *ListReceivedGrantsForOrganizationOutput + if *v == nil { + sv = &ListReceivedGrantsForOrganizationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Grants": + if err := awsAwsjson11_deserializeDocumentGrantList(&sv.Grants, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListReceivedGrantsOutput(v **ListReceivedGrantsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12716,6 +13019,51 @@ func awsAwsjson11_deserializeOpDocumentListReceivedGrantsOutput(v **ListReceived return nil } +func awsAwsjson11_deserializeOpDocumentListReceivedLicensesForOrganizationOutput(v **ListReceivedLicensesForOrganizationOutput, 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 *ListReceivedLicensesForOrganizationOutput + if *v == nil { + sv = &ListReceivedLicensesForOrganizationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Licenses": + if err := awsAwsjson11_deserializeDocumentGrantedLicenseList(&sv.Licenses, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListReceivedLicensesOutput(v **ListReceivedLicensesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/licensemanager/generated.json b/service/licensemanager/generated.json index be4317e1447..397a8697f49 100644 --- a/service/licensemanager/generated.json +++ b/service/licensemanager/generated.json @@ -44,7 +44,9 @@ "api_op_ListLicenseVersions.go", "api_op_ListLicenses.go", "api_op_ListReceivedGrants.go", + "api_op_ListReceivedGrantsForOrganization.go", "api_op_ListReceivedLicenses.go", + "api_op_ListReceivedLicensesForOrganization.go", "api_op_ListResourceInventory.go", "api_op_ListTagsForResource.go", "api_op_ListTokens.go", diff --git a/service/licensemanager/serializers.go b/service/licensemanager/serializers.go index 588a4391ca5..da4df77be0e 100644 --- a/service/licensemanager/serializers.go +++ b/service/licensemanager/serializers.go @@ -1995,6 +1995,61 @@ func (m *awsAwsjson11_serializeOpListReceivedGrants) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListReceivedGrantsForOrganization struct { +} + +func (*awsAwsjson11_serializeOpListReceivedGrantsForOrganization) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListReceivedGrantsForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListReceivedGrantsForOrganizationInput) + _ = 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("AWSLicenseManager.ListReceivedGrantsForOrganization") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListReceivedGrantsForOrganizationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListReceivedLicenses struct { } @@ -2050,6 +2105,61 @@ func (m *awsAwsjson11_serializeOpListReceivedLicenses) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListReceivedLicensesForOrganization struct { +} + +func (*awsAwsjson11_serializeOpListReceivedLicensesForOrganization) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListReceivedLicensesForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListReceivedLicensesForOrganizationInput) + _ = 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("AWSLicenseManager.ListReceivedLicensesForOrganization") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListReceivedLicensesForOrganizationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListResourceInventory struct { } @@ -4157,6 +4267,35 @@ func awsAwsjson11_serializeOpDocumentListLicenseVersionsInput(v *ListLicenseVers return nil } +func awsAwsjson11_serializeOpDocumentListReceivedGrantsForOrganizationInput(v *ListReceivedGrantsForOrganizationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.LicenseArn != nil { + ok := object.Key("LicenseArn") + ok.String(*v.LicenseArn) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListReceivedGrantsInput(v *ListReceivedGrantsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4188,6 +4327,30 @@ func awsAwsjson11_serializeOpDocumentListReceivedGrantsInput(v *ListReceivedGran return nil } +func awsAwsjson11_serializeOpDocumentListReceivedLicensesForOrganizationInput(v *ListReceivedLicensesForOrganizationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListReceivedLicensesInput(v *ListReceivedLicensesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/licensemanager/validators.go b/service/licensemanager/validators.go index 349aa4e9172..875be94eb87 100644 --- a/service/licensemanager/validators.go +++ b/service/licensemanager/validators.go @@ -590,6 +590,26 @@ func (m *validateOpListLicenseVersions) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListReceivedGrantsForOrganization struct { +} + +func (*validateOpListReceivedGrantsForOrganization) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListReceivedGrantsForOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListReceivedGrantsForOrganizationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListReceivedGrantsForOrganizationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListResourceInventory struct { } @@ -906,6 +926,10 @@ func addOpListLicenseVersionsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListLicenseVersions{}, middleware.After) } +func addOpListReceivedGrantsForOrganizationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListReceivedGrantsForOrganization{}, middleware.After) +} + func addOpListResourceInventoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListResourceInventory{}, middleware.After) } @@ -1876,6 +1900,21 @@ func validateOpListLicenseVersionsInput(v *ListLicenseVersionsInput) error { } } +func validateOpListReceivedGrantsForOrganizationInput(v *ListReceivedGrantsForOrganizationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListReceivedGrantsForOrganizationInput"} + if v.LicenseArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("LicenseArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListResourceInventoryInput(v *ListResourceInventoryInput) error { if v == nil { return nil diff --git a/service/marketplacecatalog/api_op_ListTagsForResource.go b/service/marketplacecatalog/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..b068fcdd402 --- /dev/null +++ b/service/marketplacecatalog/api_op_ListTagsForResource.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecatalog + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/marketplacecatalog/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all tags that have been added to a resource (either an entity +// (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#catalog-api-entities) +// or change set +// (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets)). +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // Required. The Amazon Resource Name (ARN) associated with the resource you want + // to list tags on. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // Required. The ARN associated with the resource you want to list tags on. + ResourceArn *string + + // Required. A list of objects specifying each key name and value. Number of + // objects allowed: 1-50. + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aws-marketplace", + OperationName: "ListTagsForResource", + } +} diff --git a/service/marketplacecatalog/api_op_StartChangeSet.go b/service/marketplacecatalog/api_op_StartChangeSet.go index 71dadccad05..3cf2e0e433e 100644 --- a/service/marketplacecatalog/api_op_StartChangeSet.go +++ b/service/marketplacecatalog/api_op_StartChangeSet.go @@ -12,18 +12,18 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation allows you to request changes for your entities. Within a single -// ChangeSet, you cannot start the same change type against the same entity -// multiple times. Additionally, when a ChangeSet is running, all the entities -// targeted by the different changes are locked until the ChangeSet has completed -// (either succeeded, cancelled, or failed). If you try to start a ChangeSet -// containing a change against an entity that is already locked, you will receive a -// ResourceInUseException. For example, you cannot start the ChangeSet described in -// the example +// Allows you to request changes for your entities. Within a single ChangeSet, you +// can't start the same change type against the same entity multiple times. +// Additionally, when a ChangeSet is running, all the entities targeted by the +// different changes are locked until the change set has completed (either +// succeeded, cancelled, or failed). If you try to start a change set containing a +// change against an entity that is already locked, you will receive a +// ResourceInUseException error. For example, you can't start the ChangeSet +// described in the example // (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/API_StartChangeSet.html#API_StartChangeSet_Examples) -// later in this topic, because it contains two changes to execute the same change -// type (AddRevisions) against the same entity (entity-id@1). For more information -// about working with change sets, see Working with change sets +// later in this topic because it contains two changes to run the same change type +// (AddRevisions) against the same entity (entity-id@1). For more information about +// working with change sets, see Working with change sets // (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets). func (c *Client) StartChangeSet(ctx context.Context, params *StartChangeSetInput, optFns ...func(*Options)) (*StartChangeSetOutput, error) { if params == nil { @@ -56,6 +56,10 @@ type StartChangeSetInput struct { // name can be used to filter the list of change sets. ChangeSetName *string + // A list of objects specifying each key name and value for the ChangeSetTags + // property. + ChangeSetTags []types.Tag + // A unique token to identify the request to ensure idempotency. ClientRequestToken *string diff --git a/service/marketplacecatalog/api_op_TagResource.go b/service/marketplacecatalog/api_op_TagResource.go new file mode 100644 index 00000000000..7d0108a54eb --- /dev/null +++ b/service/marketplacecatalog/api_op_TagResource.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecatalog + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/marketplacecatalog/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Tags a resource (either an entity +// (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#catalog-api-entities) +// or change set +// (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets)). +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // Required. The Amazon Resource Name (ARN) associated with the resource you want + // to tag. + // + // This member is required. + ResourceArn *string + + // Required. A list of objects specifying each key name and value. Number of + // objects allowed: 1-50. + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aws-marketplace", + OperationName: "TagResource", + } +} diff --git a/service/marketplacecatalog/api_op_UntagResource.go b/service/marketplacecatalog/api_op_UntagResource.go new file mode 100644 index 00000000000..575b36280ce --- /dev/null +++ b/service/marketplacecatalog/api_op_UntagResource.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecatalog + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes a tag or list of tags from a resource (either an entity +// (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#catalog-api-entities) +// or change set +// (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets)). +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // Required. The Amazon Resource Name (ARN) associated with the resource you want + // to remove the tag from. + // + // This member is required. + ResourceArn *string + + // Required. A list of key names of tags to be removed. Number of strings allowed: + // 0-256. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aws-marketplace", + OperationName: "UntagResource", + } +} diff --git a/service/marketplacecatalog/deserializers.go b/service/marketplacecatalog/deserializers.go index 16797d7f221..fa7a1697508 100644 --- a/service/marketplacecatalog/deserializers.go +++ b/service/marketplacecatalog/deserializers.go @@ -959,6 +959,174 @@ func awsRestjson1_deserializeOpDocumentListEntitiesOutput(v **ListEntitiesOutput return nil } +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpStartChangeSet struct { } @@ -1137,6 +1305,196 @@ func awsRestjson1_deserializeOpDocumentStartChangeSetOutput(v **StartChangeSetOu return nil } +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte @@ -2187,6 +2545,89 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } +func awsRestjson1_deserializeDocumentTag(v **types.Tag, 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.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/marketplacecatalog/generated.json b/service/marketplacecatalog/generated.json index 082e746834a..99aee86d4fd 100644 --- a/service/marketplacecatalog/generated.json +++ b/service/marketplacecatalog/generated.json @@ -13,7 +13,10 @@ "api_op_DescribeEntity.go", "api_op_ListChangeSets.go", "api_op_ListEntities.go", + "api_op_ListTagsForResource.go", "api_op_StartChangeSet.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/marketplacecatalog/serializers.go b/service/marketplacecatalog/serializers.go index 5d9df68e04d..35a05536b95 100644 --- a/service/marketplacecatalog/serializers.go +++ b/service/marketplacecatalog/serializers.go @@ -374,6 +374,74 @@ func awsRestjson1_serializeOpDocumentListEntitiesInput(v *ListEntitiesInput, val return nil } +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListTagsForResource") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + type awsRestjson1_serializeOpStartChangeSet struct { } @@ -451,6 +519,13 @@ func awsRestjson1_serializeOpDocumentStartChangeSetInput(v *StartChangeSetInput, ok.String(*v.ChangeSetName) } + if v.ChangeSetTags != nil { + ok := object.Key("ChangeSetTags") + if err := awsRestjson1_serializeDocumentTagList(v.ChangeSetTags, ok); err != nil { + return err + } + } + if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) @@ -459,6 +534,156 @@ func awsRestjson1_serializeOpDocumentStartChangeSetInput(v *StartChangeSetInput, return nil } +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/TagResource") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/UntagResource") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentChange(v *types.Change, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -485,6 +710,13 @@ func awsRestjson1_serializeDocumentChange(v *types.Change, value smithyjson.Valu } } + if v.EntityTags != nil { + ok := object.Key("EntityTags") + if err := awsRestjson1_serializeDocumentTagList(v.EntityTags, ok); err != nil { + return err + } + } + return nil } @@ -567,6 +799,47 @@ func awsRestjson1_serializeDocumentSort(v *types.Sort, value smithyjson.Value) e return nil } +func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentValueList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/marketplacecatalog/types/types.go b/service/marketplacecatalog/types/types.go index 8a9a0103300..f4c085f6aa9 100644 --- a/service/marketplacecatalog/types/types.go +++ b/service/marketplacecatalog/types/types.go @@ -30,6 +30,9 @@ type Change struct { // Optional name for the change. ChangeName *string + // The tags associated with the change. + EntityTags []Tag + noSmithyDocumentSerde } @@ -206,4 +209,20 @@ type Sort struct { noSmithyDocumentSerde } +// A list of objects specifying each key name and value. +type Tag struct { + + // The key associated with the tag. + // + // This member is required. + Key *string + + // The value associated with the tag. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/marketplacecatalog/validators.go b/service/marketplacecatalog/validators.go index ed9d394798d..2b58438c1f2 100644 --- a/service/marketplacecatalog/validators.go +++ b/service/marketplacecatalog/validators.go @@ -110,6 +110,26 @@ func (m *validateOpListEntities) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartChangeSet struct { } @@ -130,6 +150,46 @@ func (m *validateOpStartChangeSet) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpCancelChangeSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelChangeSet{}, middleware.After) } @@ -150,10 +210,22 @@ func addOpListEntitiesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListEntities{}, middleware.After) } +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + func addOpStartChangeSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartChangeSet{}, middleware.After) } +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + func validateChange(v *types.Change) error { if v == nil { return nil @@ -169,6 +241,11 @@ func validateChange(v *types.Change) error { invalidParams.AddNested("Entity", err.(smithy.InvalidParamsError)) } } + if v.EntityTags != nil { + if err := validateTagList(v.EntityTags); err != nil { + invalidParams.AddNested("EntityTags", err.(smithy.InvalidParamsError)) + } + } if v.Details == nil { invalidParams.Add(smithy.NewErrParamRequired("Details")) } @@ -211,6 +288,41 @@ func validateRequestedChangeList(v []types.Change) error { } } +func validateTag(v *types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tag"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTagList(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagList"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCancelChangeSetInput(v *CancelChangeSetInput) error { if v == nil { return nil @@ -298,6 +410,21 @@ func validateOpListEntitiesInput(v *ListEntitiesInput) error { } } +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartChangeSetInput(v *StartChangeSetInput) error { if v == nil { return nil @@ -313,6 +440,51 @@ func validateOpStartChangeSetInput(v *StartChangeSetInput) error { invalidParams.AddNested("ChangeSet", err.(smithy.InvalidParamsError)) } } + if v.ChangeSetTags != nil { + if err := validateTagList(v.ChangeSetTags); err != nil { + invalidParams.AddNested("ChangeSetTags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } else if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/networkfirewall/internal/endpoints/endpoints.go b/service/networkfirewall/internal/endpoints/endpoints.go index a69e901afe6..0fb82210931 100644 --- a/service/networkfirewall/internal/endpoints/endpoints.go +++ b/service/networkfirewall/internal/endpoints/endpoints.go @@ -159,9 +159,6 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-3", - }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, diff --git a/service/pinpointemail/internal/endpoints/endpoints.go b/service/pinpointemail/internal/endpoints/endpoints.go index 09489e0bd2b..b3538b1c254 100644 --- a/service/pinpointemail/internal/endpoints/endpoints.go +++ b/service/pinpointemail/internal/endpoints/endpoints.go @@ -156,6 +156,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, diff --git a/service/rekognition/api_op_DetectLabels.go b/service/rekognition/api_op_DetectLabels.go index 667e91925fd..d03aa2d2699 100644 --- a/service/rekognition/api_op_DetectLabels.go +++ b/service/rekognition/api_op_DetectLabels.go @@ -15,54 +15,95 @@ import ( // as input. This includes objects like flower, tree, and table; events like // wedding, graduation, and birthday party; and concepts like landscape, evening, // and nature. For an example, see Analyzing images stored in an Amazon S3 bucket -// in the Amazon Rekognition Developer Guide. DetectLabels does not support the -// detection of activities. However, activity detection is supported for label -// detection in videos. For more information, see StartLabelDetection in the Amazon -// Rekognition Developer Guide. You pass the input image as base64-encoded image -// bytes or as a reference to an image in an Amazon S3 bucket. If you use the AWS -// CLI to call Amazon Rekognition operations, passing image bytes is not supported. -// The image must be either a PNG or JPEG formatted file. For each object, scene, -// and concept the API returns one or more labels. Each label provides the object -// name, and the level of confidence that the image contains the object. For -// example, suppose the input image has a lighthouse, the sea, and a rock. The -// response includes all three labels, one for each object. {Name: lighthouse, -// Confidence: 98.4629} +// in the Amazon Rekognition Developer Guide. You pass the input image as +// base64-encoded image bytes or as a reference to an image in an Amazon S3 bucket. +// If you use the AWS CLI to call Amazon Rekognition operations, passing image +// bytes is not supported. The image must be either a PNG or JPEG formatted file. +// Optional Parameters You can specify one or both of the GENERAL_LABELS and +// IMAGE_PROPERTIES feature types when calling the DetectLabels API. Including +// GENERAL_LABELS will ensure the response includes the labels detected in the +// input image, while including IMAGE_PROPERTIES will ensure the response includes +// information about the image quality and color. When using GENERAL_LABELS and/or +// IMAGE_PROPERTIES you can provide filtering criteria to the Settings parameter. +// You can filter with sets of individual labels or with label categories. You can +// specify inclusive filters, exclusive filters, or a combination of inclusive and +// exclusive filters. For more information on filtering see Detecting Labels in an +// Image +// (https://docs.aws.amazon.com/rekognition/latest/dg/labels-detect-labels-image.html). +// You can specify MinConfidence to control the confidence threshold for the labels +// returned. The default is 55%. You can also add the MaxLabels parameter to limit +// the number of labels returned. The default and upper limit is 1000 labels. +// Response Elements For each object, scene, and concept the API returns one or +// more labels. The API returns the following types of information regarding +// labels: +// +// * Name - The name of the detected label. +// +// * Confidence - The level of +// confidence in the label assigned to a detected object. +// +// * Parents - The ancestor +// labels for a detected label. DetectLabels returns a hierarchical taxonomy of +// detected labels. For example, a detected car might be assigned the label car. +// The label car has two parent labels: Vehicle (its parent) and Transportation +// (its grandparent). The response includes the all ancestors for a label, where +// every ancestor is a unique label. In the previous example, Car, Vehicle, and +// Transportation are returned as unique labels in the response. +// +// * Aliases - +// Possible Aliases for the label. +// +// * Categories - The label categories that the +// detected label belongs to. A given label can belong to more than one +// category. +// +// * BoundingBox — Bounding boxes are described for all instances of +// detected common object labels, returned in an array of Instance objects. An +// Instance object contains a BoundingBox object, describing the location of the +// label on the input image. It also includes the confidence for the accuracy of +// the detected bounding box. +// +// The API returns the following information regarding +// the image, as part of the ImageProperties structure: +// +// * Quality - Information +// about the Sharpness, Brightness, and Contrast of the input image, scored between +// 0 to 100. Image quality is returned for the entire image, as well as the +// background and the foreground. +// +// * Dominant Color - An array of the dominant +// colors in the image. +// +// * Foreground - Information about the Sharpness and +// Brightness of the input image’s foreground. +// +// * Background - Information about +// the Sharpness and Brightness of the input image’s background. +// +// The list of +// returned labels will include at least one label for every detected object, along +// with information about that label. In the following example, suppose the input +// image has a lighthouse, the sea, and a rock. The response includes all three +// labels, one for each object, as well as the confidence in the label: {Name: +// lighthouse, Confidence: 98.4629} // // {Name: rock,Confidence: 79.2097} // // {Name: -// sea,Confidence: 75.061} In the preceding example, the operation returns one -// label for each of the three objects. The operation can also return multiple -// labels for the same object in the image. For example, if the input image shows a -// flower (for example, a tulip), the operation might return the following three -// labels. {Name: flower,Confidence: 99.0562} -// -// {Name: plant,Confidence: -// -// 99.0562} -// -// {Name: tulip,Confidence: 99.0562} In this example, the detection -// algorithm more precisely identifies the flower as a tulip. In response, the API -// returns an array of labels. In addition, the response also includes the -// orientation correction. Optionally, you can specify MinConfidence to control the -// confidence threshold for the labels returned. The default is 55%. You can also -// add the MaxLabels parameter to limit the number of labels returned. If the -// object detected is a person, the operation doesn't provide the same facial -// details that the DetectFaces operation provides. DetectLabels returns bounding -// boxes for instances of common object labels in an array of Instance objects. An -// Instance object contains a BoundingBox object, for the location of the label on -// the image. It also includes the confidence by which the bounding box was -// detected. DetectLabels also returns a hierarchical taxonomy of detected labels. -// For example, a detected car might be assigned the label car. The label car has -// two parent labels: Vehicle (its parent) and Transportation (its -// grandparent). -// -// The response returns the entire list of ancestors for a label. -// Each ancestor is a unique label in the response. In the previous example, Car, -// Vehicle, and Transportation are returned as unique labels in the response. This -// is a stateless API operation. That is, the operation does not persist any data. -// This operation requires permissions to perform the rekognition:DetectLabels -// action. +// sea,Confidence: 75.061} The list of labels can include multiple labels for the +// same object. For example, if the input image shows a flower (for example, a +// tulip), the operation might return the following three labels. {Name: +// flower,Confidence: 99.0562} +// +// {Name: plant,Confidence: 99.0562} +// +// {Name: +// tulip,Confidence: 99.0562} In this example, the detection algorithm more +// precisely identifies the flower as a tulip. If the object detected is a person, +// the operation doesn't provide the same facial details that the DetectFaces +// operation provides. This is a stateless API operation. That is, the operation +// does not persist any data. This operation requires permissions to perform the +// rekognition:DetectLabels action. func (c *Client) DetectLabels(ctx context.Context, params *DetectLabelsInput, optFns ...func(*Options)) (*DetectLabelsOutput, error) { if params == nil { params = &DetectLabelsInput{} @@ -90,6 +131,12 @@ type DetectLabelsInput struct { // This member is required. Image *types.Image + // A list of the types of analysis to perform. Specifying GENERAL_LABELS uses the + // label detection feature, while specifying IMAGE_PROPERTIES returns information + // regarding image color and quality. If no option is specified GENERAL_LABELS is + // used by default. + Features []types.DetectLabelsFeatureName + // Maximum number of labels you want the service to return in the response. The // service returns the specified number of highest confidence labels. MaxLabels *int32 @@ -100,11 +147,22 @@ type DetectLabelsInput struct { // confidence values greater than or equal to 55 percent. MinConfidence *float32 + // A list of the filters to be applied to returned detected labels and image + // properties. Specified filters can be inclusive, exclusive, or a combination of + // both. Filters can be used for individual labels or label categories. The exact + // label names or label categories must be supplied. For a full list of labels and + // label categories, see LINK HERE. + Settings *types.DetectLabelsSettings + noSmithyDocumentSerde } type DetectLabelsOutput struct { + // Information about the properties of the input image, such as brightness, + // sharpness, contrast, and dominant colors. + ImageProperties *types.DetectLabelsImageProperties + // Version number of the label detection model that was used to detect labels. LabelModelVersion *string diff --git a/service/rekognition/api_op_StartStreamProcessor.go b/service/rekognition/api_op_StartStreamProcessor.go index 4a3a95cadf7..7d043512ba6 100644 --- a/service/rekognition/api_op_StartStreamProcessor.go +++ b/service/rekognition/api_op_StartStreamProcessor.go @@ -40,8 +40,9 @@ type StartStreamProcessorInput struct { Name *string // Specifies the starting point in the Kinesis stream to start processing. You can - // use the producer timestamp or the fragment number. For more information, see - // Fragment + // use the producer timestamp or the fragment number. If you use the producer + // timestamp, you must put the time in milliseconds. For more information about + // fragment numbers, see Fragment // (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_reader_Fragment.html). // This is a required parameter for label detection stream processors and should // not be used to start a face search stream processor. diff --git a/service/rekognition/deserializers.go b/service/rekognition/deserializers.go index 704376a9447..76b0796e3d3 100644 --- a/service/rekognition/deserializers.go +++ b/service/rekognition/deserializers.go @@ -11083,6 +11083,437 @@ func awsAwsjson11_deserializeDocumentDatasetStats(v **types.DatasetStats, value return nil } +func awsAwsjson11_deserializeDocumentDetectLabelsImageBackground(v **types.DetectLabelsImageBackground, 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.DetectLabelsImageBackground + if *v == nil { + sv = &types.DetectLabelsImageBackground{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DominantColors": + if err := awsAwsjson11_deserializeDocumentDominantColors(&sv.DominantColors, value); err != nil { + return err + } + + case "Quality": + if err := awsAwsjson11_deserializeDocumentDetectLabelsImageQuality(&sv.Quality, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDetectLabelsImageForeground(v **types.DetectLabelsImageForeground, 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.DetectLabelsImageForeground + if *v == nil { + sv = &types.DetectLabelsImageForeground{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DominantColors": + if err := awsAwsjson11_deserializeDocumentDominantColors(&sv.DominantColors, value); err != nil { + return err + } + + case "Quality": + if err := awsAwsjson11_deserializeDocumentDetectLabelsImageQuality(&sv.Quality, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDetectLabelsImageProperties(v **types.DetectLabelsImageProperties, 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.DetectLabelsImageProperties + if *v == nil { + sv = &types.DetectLabelsImageProperties{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Background": + if err := awsAwsjson11_deserializeDocumentDetectLabelsImageBackground(&sv.Background, value); err != nil { + return err + } + + case "DominantColors": + if err := awsAwsjson11_deserializeDocumentDominantColors(&sv.DominantColors, value); err != nil { + return err + } + + case "Foreground": + if err := awsAwsjson11_deserializeDocumentDetectLabelsImageForeground(&sv.Foreground, value); err != nil { + return err + } + + case "Quality": + if err := awsAwsjson11_deserializeDocumentDetectLabelsImageQuality(&sv.Quality, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDetectLabelsImageQuality(v **types.DetectLabelsImageQuality, 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.DetectLabelsImageQuality + if *v == nil { + sv = &types.DetectLabelsImageQuality{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Brightness": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Brightness = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Brightness = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Contrast": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Contrast = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Contrast = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Sharpness": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Sharpness = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Sharpness = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDominantColor(v **types.DominantColor, 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.DominantColor + if *v == nil { + sv = &types.DominantColor{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Blue": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Blue = ptr.Int32(int32(i64)) + } + + case "CSSColor": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CSSColor = ptr.String(jtv) + } + + case "Green": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Green = ptr.Int32(int32(i64)) + } + + case "HexCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HexCode = ptr.String(jtv) + } + + case "PixelPercent": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PixelPercent = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.PixelPercent = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } + } + + case "Red": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Red = ptr.Int32(int32(i64)) + } + + case "SimplifiedColor": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SimplifiedColor = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDominantColors(v *[]types.DominantColor, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.DominantColor + if *v == nil { + cv = []types.DominantColor{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DominantColor + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDominantColor(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentEmotion(v **types.Emotion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12846,6 +13277,11 @@ func awsAwsjson11_deserializeDocumentInstance(v **types.Instance, value interfac } } + case "DominantColors": + if err := awsAwsjson11_deserializeDocumentDominantColors(&sv.DominantColors, value); err != nil { + return err + } + default: _, _ = key, value @@ -13379,6 +13815,16 @@ func awsAwsjson11_deserializeDocumentLabel(v **types.Label, value interface{}) e for key, value := range shape { switch key { + case "Aliases": + if err := awsAwsjson11_deserializeDocumentLabelAliases(&sv.Aliases, value); err != nil { + return err + } + + case "Categories": + if err := awsAwsjson11_deserializeDocumentLabelCategories(&sv.Categories, value); err != nil { + return err + } + case "Confidence": if value != nil { switch jtv := value.(type) { @@ -13441,6 +13887,154 @@ func awsAwsjson11_deserializeDocumentLabel(v **types.Label, value interface{}) e return nil } +func awsAwsjson11_deserializeDocumentLabelAlias(v **types.LabelAlias, 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.LabelAlias + if *v == nil { + sv = &types.LabelAlias{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentLabelAliases(v *[]types.LabelAlias, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.LabelAlias + if *v == nil { + cv = []types.LabelAlias{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LabelAlias + destAddr := &col + if err := awsAwsjson11_deserializeDocumentLabelAlias(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentLabelCategories(v *[]types.LabelCategory, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.LabelCategory + if *v == nil { + cv = []types.LabelCategory{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LabelCategory + destAddr := &col + if err := awsAwsjson11_deserializeDocumentLabelCategory(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentLabelCategory(v **types.LabelCategory, 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.LabelCategory + if *v == nil { + sv = &types.LabelCategory{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentLabelDetection(v **types.LabelDetection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18781,6 +19375,11 @@ func awsAwsjson11_deserializeOpDocumentDetectLabelsOutput(v **DetectLabelsOutput for key, value := range shape { switch key { + case "ImageProperties": + if err := awsAwsjson11_deserializeDocumentDetectLabelsImageProperties(&sv.ImageProperties, value); err != nil { + return err + } + case "LabelModelVersion": if value != nil { jtv, ok := value.(string) diff --git a/service/rekognition/doc.go b/service/rekognition/doc.go index 596e5af64c5..d1b05d2b5d9 100644 --- a/service/rekognition/doc.go +++ b/service/rekognition/doc.go @@ -12,9 +12,7 @@ // Rekognition Streaming Video // (https://docs.aws.amazon.com/rekognition/latest/dg/streaming-video.html). It // provides descriptions of actions, data types, common parameters, and common -// errors. -// -// # Amazon Rekognition Image +// errors. Amazon Rekognition Image // // * CompareFaces // (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CompareFaces.html) diff --git a/service/rekognition/serializers.go b/service/rekognition/serializers.go index f2a108dd474..795b8ce4f17 100644 --- a/service/rekognition/serializers.go +++ b/service/rekognition/serializers.go @@ -3829,6 +3829,50 @@ func awsAwsjson11_serializeDocumentDetectionFilter(v *types.DetectionFilter, val return nil } +func awsAwsjson11_serializeDocumentDetectLabelsFeatureList(v []types.DetectLabelsFeatureName, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsjson11_serializeDocumentDetectLabelsImagePropertiesSettings(v *types.DetectLabelsImagePropertiesSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxDominantColors != 0 { + ok := object.Key("MaxDominantColors") + ok.Integer(v.MaxDominantColors) + } + + return nil +} + +func awsAwsjson11_serializeDocumentDetectLabelsSettings(v *types.DetectLabelsSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GeneralLabels != nil { + ok := object.Key("GeneralLabels") + if err := awsAwsjson11_serializeDocumentGeneralLabelsSettings(v.GeneralLabels, ok); err != nil { + return err + } + } + + if v.ImageProperties != nil { + ok := object.Key("ImageProperties") + if err := awsAwsjson11_serializeDocumentDetectLabelsImagePropertiesSettings(v.ImageProperties, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentDetectTextFilters(v *types.DetectTextFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3916,6 +3960,52 @@ func awsAwsjson11_serializeDocumentFaceSearchSettings(v *types.FaceSearchSetting return nil } +func awsAwsjson11_serializeDocumentGeneralLabelsFilterList(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_serializeDocumentGeneralLabelsSettings(v *types.GeneralLabelsSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LabelCategoryExclusionFilters != nil { + ok := object.Key("LabelCategoryExclusionFilters") + if err := awsAwsjson11_serializeDocumentGeneralLabelsFilterList(v.LabelCategoryExclusionFilters, ok); err != nil { + return err + } + } + + if v.LabelCategoryInclusionFilters != nil { + ok := object.Key("LabelCategoryInclusionFilters") + if err := awsAwsjson11_serializeDocumentGeneralLabelsFilterList(v.LabelCategoryInclusionFilters, ok); err != nil { + return err + } + } + + if v.LabelExclusionFilters != nil { + ok := object.Key("LabelExclusionFilters") + if err := awsAwsjson11_serializeDocumentGeneralLabelsFilterList(v.LabelExclusionFilters, ok); err != nil { + return err + } + } + + if v.LabelInclusionFilters != nil { + ok := object.Key("LabelInclusionFilters") + if err := awsAwsjson11_serializeDocumentGeneralLabelsFilterList(v.LabelInclusionFilters, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentGroundTruthManifest(v *types.GroundTruthManifest, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5089,6 +5179,13 @@ func awsAwsjson11_serializeOpDocumentDetectLabelsInput(v *DetectLabelsInput, val object := value.Object() defer object.Close() + if v.Features != nil { + ok := object.Key("Features") + if err := awsAwsjson11_serializeDocumentDetectLabelsFeatureList(v.Features, ok); err != nil { + return err + } + } + if v.Image != nil { ok := object.Key("Image") if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil { @@ -5119,6 +5216,13 @@ func awsAwsjson11_serializeOpDocumentDetectLabelsInput(v *DetectLabelsInput, val } } + if v.Settings != nil { + ok := object.Key("Settings") + if err := awsAwsjson11_serializeDocumentDetectLabelsSettings(v.Settings, ok); err != nil { + return err + } + } + return nil } diff --git a/service/rekognition/types/enums.go b/service/rekognition/types/enums.go index 441b4ba0fa3..fab9ea087b0 100644 --- a/service/rekognition/types/enums.go +++ b/service/rekognition/types/enums.go @@ -162,6 +162,24 @@ func (DatasetType) Values() []DatasetType { } } +type DetectLabelsFeatureName string + +// Enum values for DetectLabelsFeatureName +const ( + DetectLabelsFeatureNameGeneralLabels DetectLabelsFeatureName = "GENERAL_LABELS" + DetectLabelsFeatureNameImageProperties DetectLabelsFeatureName = "IMAGE_PROPERTIES" +) + +// Values returns all known values for DetectLabelsFeatureName. 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 (DetectLabelsFeatureName) Values() []DetectLabelsFeatureName { + return []DetectLabelsFeatureName{ + "GENERAL_LABELS", + "IMAGE_PROPERTIES", + } +} + type EmotionName string // Enum values for EmotionName diff --git a/service/rekognition/types/types.go b/service/rekognition/types/types.go index 2d008a50730..abc5f6c5062 100644 --- a/service/rekognition/types/types.go +++ b/service/rekognition/types/types.go @@ -195,7 +195,8 @@ type CelebrityRecognition struct { Celebrity *CelebrityDetail // The time, in milliseconds from the start of the video, that the celebrity was - // recognized. + // recognized. Note that Timestamp is not guaranteed to be accurate to the + // individual frame where the celebrity first appears. Timestamp int64 noSmithyDocumentSerde @@ -311,7 +312,8 @@ type ContentModerationDetection struct { ModerationLabel *ModerationLabel // Time, in milliseconds from the beginning of the video, that the content - // moderation label was detected. + // moderation label was detected. Note that Timestamp is not guaranteed to be + // accurate to the individual frame where the moderated content first appears. Timestamp int64 noSmithyDocumentSerde @@ -509,6 +511,102 @@ type DetectionFilter struct { noSmithyDocumentSerde } +// The background of the image with regard to image quality and dominant colors. +type DetectLabelsImageBackground struct { + + // The dominant colors found in the background of an image, defined with RGB + // values, CSS color name, simplified color name, and PixelPercentage (the + // percentage of image pixels that have a particular color). + DominantColors []DominantColor + + // The quality of the image background as defined by brightness and sharpness. + Quality *DetectLabelsImageQuality + + noSmithyDocumentSerde +} + +// The foreground of the image with regard to image quality and dominant colors. +type DetectLabelsImageForeground struct { + + // The dominant colors found in the foreground of an image, defined with RGB + // values, CSS color name, simplified color name, and PixelPercentage (the + // percentage of image pixels that have a particular color). + DominantColors []DominantColor + + // The quality of the image foreground as defined by brightness and sharpness. + Quality *DetectLabelsImageQuality + + noSmithyDocumentSerde +} + +// Information about the quality and dominant colors of an input image. Quality and +// color information is returned for the entire image, foreground, and background. +type DetectLabelsImageProperties struct { + + // Information about the properties of an image’s background, including the + // background’s quality and dominant colors, including the quality and dominant + // colors of the image. + Background *DetectLabelsImageBackground + + // Information about the dominant colors found in an image, described with RGB + // values, CSS color name, simplified color name, and PixelPercentage (the + // percentage of image pixels that have a particular color). + DominantColors []DominantColor + + // Information about the properties of an image’s foreground, including the + // foreground’s quality and dominant colors, including the quality and dominant + // colors of the image. + Foreground *DetectLabelsImageForeground + + // Information about the quality of the image foreground as defined by brightness, + // sharpness, and contrast. The higher the value the greater the brightness, + // sharpness, and contrast respectively. + Quality *DetectLabelsImageQuality + + noSmithyDocumentSerde +} + +// Settings for the IMAGE_PROPERTIES feature type. +type DetectLabelsImagePropertiesSettings struct { + + // The maximum number of dominant colors to return when detecting labels in an + // image. The default value is 10. + MaxDominantColors int32 + + noSmithyDocumentSerde +} + +// The quality of an image provided for label detection, with regard to brightness, +// sharpness, and contrast. +type DetectLabelsImageQuality struct { + + // The brightness of an image provided for label detection. + Brightness *float32 + + // The contrast of an image provided for label detection. + Contrast *float32 + + // The sharpness of an image provided for label detection. + Sharpness *float32 + + noSmithyDocumentSerde +} + +// Settings for the DetectLabels request. Settings can include filters for both +// GENERAL_LABELS and IMAGE_PROPERTIES. GENERAL_LABELS filters can be inclusive or +// exclusive and applied to individual labels or label categories. IMAGE_PROPERTIES +// filters allow specification of a maximum number of dominant colors. +type DetectLabelsSettings struct { + + // Contains the specified filters for GENERAL_LABELS. + GeneralLabels *GeneralLabelsSettings + + // Contains the chosen number of maximum dominant colors in an image. + ImageProperties *DetectLabelsImagePropertiesSettings + + noSmithyDocumentSerde +} + // A set of optional parameters that you can use to set the criteria that the text // must meet to be included in your response. WordFilter looks at a word’s height, // width, and minimum confidence. RegionOfInterest lets you set a specific region @@ -538,6 +636,33 @@ type DistributeDataset struct { noSmithyDocumentSerde } +// A description of the dominant colors in an image. +type DominantColor struct { + + // The Blue RGB value for a dominant color. + Blue *int32 + + // The CSS color name of a dominant color. + CSSColor *string + + // The Green RGB value for a dominant color. + Green *int32 + + // The Hex code equivalent of the RGB values for a dominant color. + HexCode *string + + // The percentage of image pixels that have a given dominant color. + PixelPercent *float32 + + // The Red RGB value for a dominant color. + Red *int32 + + // One of 12 simplified color names applied to a dominant color. + SimplifiedColor *string + + noSmithyDocumentSerde +} + // The emotions that appear to be expressed on the face, and the confidence level // in the determination. The API is only making a determination of the physical // appearance of a person's face. It is not a determination of the person’s @@ -735,6 +860,8 @@ type FaceDetection struct { Face *FaceDetail // Time, in milliseconds from the start of the video, that the face was detected. + // Note that Timestamp is not guaranteed to be accurate to the individual frame + // where the face first appears. Timestamp int64 noSmithyDocumentSerde @@ -809,6 +936,26 @@ type Gender struct { noSmithyDocumentSerde } +// Contains filters for the object labels returned by DetectLabels. Filters can be +// inclusive, exclusive, or a combination of both and can be applied to individual +// l abels or entire label categories. +type GeneralLabelsSettings struct { + + // The label categories that should be excluded from the return from DetectLabels. + LabelCategoryExclusionFilters []string + + // The label categories that should be included in the return from DetectLabels. + LabelCategoryInclusionFilters []string + + // The labels that should be excluded from the return from DetectLabels. + LabelExclusionFilters []string + + // The labels that should be included in the return from DetectLabels. + LabelInclusionFilters []string + + noSmithyDocumentSerde +} + // Information about where an object (DetectCustomLabels) or text (DetectText) is // located on an image. type Geometry struct { @@ -942,6 +1089,9 @@ type Instance struct { // The confidence that Amazon Rekognition has in the accuracy of the bounding box. Confidence *float32 + // The dominant colors found in an individual instance of a label. + DominantColors []DominantColor + noSmithyDocumentSerde } @@ -968,8 +1118,10 @@ type KinesisVideoStream struct { } // Specifies the starting point in a Kinesis stream to start processing. You can -// use the producer timestamp or the fragment number. For more information, see -// Fragment +// use the producer timestamp or the fragment number. One of either producer +// timestamp or fragment number is required. If you use the producer timestamp, you +// must put the time in milliseconds. For more information about fragment numbers, +// see Fragment // (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_reader_Fragment.html). type KinesisVideoStreamStartSelector struct { @@ -977,7 +1129,8 @@ type KinesisVideoStreamStartSelector struct { // on the ingestion order. FragmentNumber *string - // The timestamp from the producer corresponding to the fragment. + // The timestamp from the producer corresponding to the fragment, in milliseconds, + // expressed in unix time format. ProducerTimestamp *int64 noSmithyDocumentSerde @@ -997,6 +1150,12 @@ type KnownGender struct { // detected instances, parent labels, and level of confidence. type Label struct { + // A list of potential aliases for a given label. + Aliases []LabelAlias + + // A list of the categories associated with a given label. + Categories []LabelCategory + // Level of confidence. Confidence *float32 @@ -1014,6 +1173,24 @@ type Label struct { noSmithyDocumentSerde } +// A potential alias of for a given label. +type LabelAlias struct { + + // The name of an alias for a given label. + Name *string + + noSmithyDocumentSerde +} + +// The category that applies to a given label. +type LabelCategory struct { + + // The name of a category that applies to a given label. + Name *string + + noSmithyDocumentSerde +} + // Information about a label detected in a video analysis request and the time the // label was detected in the video. type LabelDetection struct { @@ -1022,6 +1199,8 @@ type LabelDetection struct { Label *Label // Time, in milliseconds from the start of the video, that the label was detected. + // Note that Timestamp is not guaranteed to be accurate to the individual frame + // where the label first appears. Timestamp int64 noSmithyDocumentSerde @@ -1169,7 +1348,8 @@ type PersonDetection struct { Person *PersonDetail // The time, in milliseconds from the start of the video, that the person's path - // was tracked. + // was tracked. Note that Timestamp is not guaranteed to be accurate to the + // individual frame where the person's path first appears. Timestamp int64 noSmithyDocumentSerde @@ -1658,10 +1838,12 @@ type StartTextDetectionFilters struct { noSmithyDocumentSerde } +// This is a required parameter for label detection stream processors and should +// not be used to start a face search stream processor. type StreamProcessingStartSelector struct { // Specifies the starting point in the stream to start processing. This can be done - // with a timestamp or a fragment number in a Kinesis stream. + // with a producer timestamp or a fragment number in a Kinesis stream. KVSStreamStartSelector *KinesisVideoStreamStartSelector noSmithyDocumentSerde @@ -1909,7 +2091,8 @@ type TextDetectionResult struct { TextDetection *TextDetection // The time, in milliseconds from the start of the video, that the text was - // detected. + // detected. Note that Timestamp is not guaranteed to be accurate to the individual + // frame where the text first appears. Timestamp int64 noSmithyDocumentSerde diff --git a/service/scheduler/internal/endpoints/endpoints.go b/service/scheduler/internal/endpoints/endpoints.go index a10c6b6f600..e58cb05183b 100644 --- a/service/scheduler/internal/endpoints/endpoints.go +++ b/service/scheduler/internal/endpoints/endpoints.go @@ -134,6 +134,35 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-cn", diff --git a/service/securityhub/api_op_CreateFindingAggregator.go b/service/securityhub/api_op_CreateFindingAggregator.go index ce563478a57..25372b89733 100644 --- a/service/securityhub/api_op_CreateFindingAggregator.go +++ b/service/securityhub/api_op_CreateFindingAggregator.go @@ -58,9 +58,9 @@ type CreateFindingAggregatorInput struct { RegionLinkingMode *string // If RegionLinkingMode is ALL_REGIONS_EXCEPT_SPECIFIED, then this is a - // comma-separated list of Regions that do not aggregate findings to the + // space-separated list of Regions that do not aggregate findings to the // aggregation Region. If RegionLinkingMode is SPECIFIED_REGIONS, then this is a - // comma-separated list of Regions that do aggregate findings to the aggregation + // space-separated list of Regions that do aggregate findings to the aggregation // Region. Regions []string diff --git a/service/securityhub/api_op_UpdateFindingAggregator.go b/service/securityhub/api_op_UpdateFindingAggregator.go index 0a664866e7f..cc24c681586 100644 --- a/service/securityhub/api_op_UpdateFindingAggregator.go +++ b/service/securityhub/api_op_UpdateFindingAggregator.go @@ -63,9 +63,9 @@ type UpdateFindingAggregatorInput struct { RegionLinkingMode *string // If RegionLinkingMode is ALL_REGIONS_EXCEPT_SPECIFIED, then this is a - // comma-separated list of Regions that do not aggregate findings to the + // space-separated list of Regions that do not aggregate findings to the // aggregation Region. If RegionLinkingMode is SPECIFIED_REGIONS, then this is a - // comma-separated list of Regions that do aggregate findings to the aggregation + // space-separated list of Regions that do aggregate findings to the aggregation // Region. Regions []string diff --git a/service/securityhub/types/types.go b/service/securityhub/types/types.go index 9bc85b8dc73..de9ea7d4cd9 100644 --- a/service/securityhub/types/types.go +++ b/service/securityhub/types/types.go @@ -987,7 +987,7 @@ type AwsBackupBackupPlanLifecycleDetails struct { noSmithyDocumentSerde } -// An array of CopyAction objects, which contains the details of the copy +// An array of CopyAction objects, each of which contains details of the copy // operation. type AwsBackupBackupPlanRuleCopyActionsDetails struct { @@ -1014,7 +1014,7 @@ type AwsBackupBackupPlanRuleDetails struct { // completed, or it is canceled by Backup. CompletionWindowMinutes int64 - // An array of CopyAction objects, which contains the details of the copy + // An array of CopyAction objects, each of which contains details of the copy // operation. CopyActions []AwsBackupBackupPlanRuleCopyActionsDetails diff --git a/service/ses/internal/endpoints/endpoints.go b/service/ses/internal/endpoints/endpoints.go index 65cc57ca0f1..922ab3cdc50 100644 --- a/service/ses/internal/endpoints/endpoints.go +++ b/service/ses/internal/endpoints/endpoints.go @@ -156,6 +156,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, diff --git a/service/sesv2/internal/endpoints/endpoints.go b/service/sesv2/internal/endpoints/endpoints.go index ff9e30023c6..b72d8540d1a 100644 --- a/service/sesv2/internal/endpoints/endpoints.go +++ b/service/sesv2/internal/endpoints/endpoints.go @@ -156,6 +156,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, diff --git a/service/ssmincidents/api_op_CreateTimelineEvent.go b/service/ssmincidents/api_op_CreateTimelineEvent.go index f026bf6053d..468cf868273 100644 --- a/service/ssmincidents/api_op_CreateTimelineEvent.go +++ b/service/ssmincidents/api_op_CreateTimelineEvent.go @@ -7,6 +7,7 @@ import ( "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/ssmincidents/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -57,6 +58,15 @@ type CreateTimelineEventInput struct { // A token ensuring that the action is called only once with the specified details. ClientToken *string + // Adds one or more references to the TimelineEvent. A reference can be an Amazon + // Web Services resource involved in the incident or in some way associated with + // it. When you specify a reference, you enter the Amazon Resource Name (ARN) of + // the resource. You can also specify a related item. As an example, you could + // specify the ARN of an Amazon DynamoDB (DynamoDB) table. The table for this + // example is the resource. You could also specify a Amazon CloudWatch metric for + // that table. The metric is the related item. + EventReferences []types.EventReference + noSmithyDocumentSerde } diff --git a/service/ssmincidents/api_op_UpdateTimelineEvent.go b/service/ssmincidents/api_op_UpdateTimelineEvent.go index 39027c02fa9..a656fcb2b02 100644 --- a/service/ssmincidents/api_op_UpdateTimelineEvent.go +++ b/service/ssmincidents/api_op_UpdateTimelineEvent.go @@ -7,6 +7,7 @@ import ( "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/ssmincidents/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -48,6 +49,18 @@ type UpdateTimelineEventInput struct { // A short description of the event. EventData *string + // Updates all existing references in a TimelineEvent. A reference can be an Amazon + // Web Services resource involved in the incident or in some way associated with + // it. When you specify a reference, you enter the Amazon Resource Name (ARN) of + // the resource. You can also specify a related item. As an example, you could + // specify the ARN of an Amazon DynamoDB (DynamoDB) table. The table for this + // example is the resource. You could also specify a Amazon CloudWatch metric for + // that table. The metric is the related item. This update action overrides all + // existing references. If you want to keep existing references, you must specify + // them in the call. If you don't, this action removes them and enters only new + // references. + EventReferences []types.EventReference + // The time that the event occurred. EventTime *time.Time diff --git a/service/ssmincidents/deserializers.go b/service/ssmincidents/deserializers.go index 9b6ccea6473..b1cf1e0abfe 100644 --- a/service/ssmincidents/deserializers.go +++ b/service/ssmincidents/deserializers.go @@ -4674,6 +4674,92 @@ func awsRestjson1_deserializeDocumentEngagementSet(v *[]string, value interface{ return nil } +func awsRestjson1_deserializeDocumentEventReference(v *types.EventReference, 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 uv types.EventReference +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "relatedItemId": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeneratedId to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.EventReferenceMemberRelatedItemId{Value: mv} + break loop + + case "resource": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.EventReferenceMemberResource{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentEventReferenceList(v *[]types.EventReference, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.EventReference + if *v == nil { + cv = []types.EventReference{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EventReference + if err := awsRestjson1_deserializeDocumentEventReference(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentEventSummary(v **types.EventSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4705,6 +4791,11 @@ func awsRestjson1_deserializeDocumentEventSummary(v **types.EventSummary, value sv.EventId = ptr.String(jtv) } + case "eventReferences": + if err := awsRestjson1_deserializeDocumentEventReferenceList(&sv.EventReferences, value); err != nil { + return err + } + case "eventTime": if value != nil { switch jtv := value.(type) { @@ -5610,6 +5701,15 @@ func awsRestjson1_deserializeDocumentRelatedItem(v **types.RelatedItem, value in for key, value := range shape { switch key { + case "generatedId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeneratedId to be of type string, got %T instead", value) + } + sv.GeneratedId = ptr.String(jtv) + } + case "identifier": if err := awsRestjson1_deserializeDocumentItemIdentifier(&sv.Identifier, value); err != nil { return err @@ -6415,6 +6515,11 @@ func awsRestjson1_deserializeDocumentTimelineEvent(v **types.TimelineEvent, valu sv.EventId = ptr.String(jtv) } + case "eventReferences": + if err := awsRestjson1_deserializeDocumentEventReferenceList(&sv.EventReferences, value); err != nil { + return err + } + case "eventTime": if value != nil { switch jtv := value.(type) { diff --git a/service/ssmincidents/serializers.go b/service/ssmincidents/serializers.go index 5e21a29ca7f..798c830a07f 100644 --- a/service/ssmincidents/serializers.go +++ b/service/ssmincidents/serializers.go @@ -280,6 +280,13 @@ func awsRestjson1_serializeOpDocumentCreateTimelineEventInput(v *CreateTimelineE ok.String(*v.EventData) } + if v.EventReferences != nil { + ok := object.Key("eventReferences") + if err := awsRestjson1_serializeDocumentEventReferenceList(v.EventReferences, ok); err != nil { + return err + } + } + if v.EventTime != nil { ok := object.Key("eventTime") ok.Double(smithytime.FormatEpochSeconds(*v.EventTime)) @@ -2257,6 +2264,13 @@ func awsRestjson1_serializeOpDocumentUpdateTimelineEventInput(v *UpdateTimelineE ok.String(*v.EventId) } + if v.EventReferences != nil { + ok := object.Key("eventReferences") + if err := awsRestjson1_serializeDocumentEventReferenceList(v.EventReferences, ok); err != nil { + return err + } + } + if v.EventTime != nil { ok := object.Key("eventTime") ok.Double(smithytime.FormatEpochSeconds(*v.EventTime)) @@ -2473,6 +2487,42 @@ func awsRestjson1_serializeDocumentEngagementSet(v []string, value smithyjson.Va return nil } +func awsRestjson1_serializeDocumentEventReference(v types.EventReference, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.EventReferenceMemberRelatedItemId: + av := object.Key("relatedItemId") + av.String(uv.Value) + + case *types.EventReferenceMemberResource: + av := object.Key("resource") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentEventReferenceList(v []types.EventReference, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentEventReference(v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2662,6 +2712,11 @@ func awsRestjson1_serializeDocumentRelatedItem(v *types.RelatedItem, value smith object := value.Object() defer object.Close() + if v.GeneratedId != nil { + ok := object.Key("generatedId") + ok.String(*v.GeneratedId) + } + if v.Identifier != nil { ok := object.Key("identifier") if err := awsRestjson1_serializeDocumentItemIdentifier(v.Identifier, ok); err != nil { diff --git a/service/ssmincidents/types/types.go b/service/ssmincidents/types/types.go index 8dba3bf29da..839880282b4 100644 --- a/service/ssmincidents/types/types.go +++ b/service/ssmincidents/types/types.go @@ -197,6 +197,37 @@ type EmptyChatChannel struct { noSmithyDocumentSerde } +// An item referenced in a TimelineEvent that is involved in or somehow associated +// with an incident. You can specify an Amazon Resource Name (ARN) for an Amazon +// Web Services resource or a RelatedItem ID. +// +// The following types satisfy this interface: +// +// EventReferenceMemberRelatedItemId +// EventReferenceMemberResource +type EventReference interface { + isEventReference() +} + +// The ID of a RelatedItem referenced in a TimelineEvent. +type EventReferenceMemberRelatedItemId struct { + Value string + + noSmithyDocumentSerde +} + +func (*EventReferenceMemberRelatedItemId) isEventReference() {} + +// The Amazon Resource Name (ARN) of an Amazon Web Services resource referenced in +// a TimelineEvent. +type EventReferenceMemberResource struct { + Value string + + noSmithyDocumentSerde +} + +func (*EventReferenceMemberResource) isEventReference() {} + // Details about a timeline event during an incident. type EventSummary struct { @@ -225,6 +256,9 @@ type EventSummary struct { // This member is required. IncidentRecordArn *string + // A list of references in a TimelineEvent. + EventReferences []EventReference + noSmithyDocumentSerde } @@ -526,6 +560,10 @@ type RelatedItem struct { // This member is required. Identifier *ItemIdentifier + // A unique ID for a RelatedItem. Don't specify this parameter when you add a + // RelatedItem by using the UpdateRelatedItems API action. + GeneratedId *string + // The title of the related item. Title *string @@ -716,6 +754,9 @@ type TimelineEvent struct { // This member is required. IncidentRecordArn *string + // A list of references in a TimelineEvent. + EventReferences []EventReference + noSmithyDocumentSerde } @@ -792,6 +833,7 @@ func (*UnknownUnionMember) isAutomationExecution() {} func (*UnknownUnionMember) isChatChannel() {} func (*UnknownUnionMember) isCondition() {} func (*UnknownUnionMember) isDynamicSsmParameterValue() {} +func (*UnknownUnionMember) isEventReference() {} func (*UnknownUnionMember) isItemValue() {} func (*UnknownUnionMember) isNotificationTargetItem() {} func (*UnknownUnionMember) isRelatedItemsUpdate() {} diff --git a/service/ssmincidents/types/types_exported_test.go b/service/ssmincidents/types/types_exported_test.go index 32c89371a23..4374c21fb3d 100644 --- a/service/ssmincidents/types/types_exported_test.go +++ b/service/ssmincidents/types/types_exported_test.go @@ -131,6 +131,28 @@ func ExampleDynamicSsmParameterValue_outputUsage() { var _ types.VariableType +func ExampleEventReference_outputUsage() { + var union types.EventReference + // type switches can be used to check the union value + switch v := union.(type) { + case *types.EventReferenceMemberRelatedItemId: + _ = v.Value // Value is string + + case *types.EventReferenceMemberResource: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string +var _ *string + func ExampleItemValue_outputUsage() { var union types.ItemValue // type switches can be used to check the union value