diff --git a/.changelog/296ce2a09a9c4061984c02aaa6bd1a3a.json b/.changelog/296ce2a09a9c4061984c02aaa6bd1a3a.json new file mode 100644 index 00000000000..1c9aa84a49d --- /dev/null +++ b/.changelog/296ce2a09a9c4061984c02aaa6bd1a3a.json @@ -0,0 +1,8 @@ +{ + "id": "296ce2a0-9a9c-4061-984c-02aaa6bd1a3a", + "type": "feature", + "description": "AWS Elemental MediaConvert SDK has added support for rules that constrain Automatic-ABR rendition selection when generating ABR package ladders.", + "modules": [ + "service/mediaconvert" + ] +} \ No newline at end of file diff --git a/.changelog/51094e4adf1f4b39bbc1606cb39dfab8.json b/.changelog/51094e4adf1f4b39bbc1606cb39dfab8.json new file mode 100644 index 00000000000..41972ddfb47 --- /dev/null +++ b/.changelog/51094e4adf1f4b39bbc1606cb39dfab8.json @@ -0,0 +1,8 @@ +{ + "id": "51094e4a-df1f-4b39-bbc1-606cb39dfab8", + "type": "feature", + "description": "Add a budgets ThrottlingException. Update the CostFilters value pattern.", + "modules": [ + "service/budgets" + ] +} \ No newline at end of file diff --git a/.changelog/5c609c026f2c495c96cef4474becfcd4.json b/.changelog/5c609c026f2c495c96cef4474becfcd4.json new file mode 100644 index 00000000000..fb2096b126b --- /dev/null +++ b/.changelog/5c609c026f2c495c96cef4474becfcd4.json @@ -0,0 +1,8 @@ +{ + "id": "5c609c02-6f2c-495c-96ce-f4474becfcd4", + "type": "feature", + "description": "Adding filters to Alert and adding new UpdateAlert API.", + "modules": [ + "service/lookoutmetrics" + ] +} \ No newline at end of file diff --git a/service/budgets/deserializers.go b/service/budgets/deserializers.go index a0f1a0defd7..096205815a3 100644 --- a/service/budgets/deserializers.go +++ b/service/budgets/deserializers.go @@ -133,6 +133,9 @@ func awsAwsjson11_deserializeOpErrorCreateBudget(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -259,6 +262,9 @@ func awsAwsjson11_deserializeOpErrorCreateBudgetAction(response *smithyhttp.Resp case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -385,6 +391,9 @@ func awsAwsjson11_deserializeOpErrorCreateNotification(response *smithyhttp.Resp case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -511,6 +520,9 @@ func awsAwsjson11_deserializeOpErrorCreateSubscriber(response *smithyhttp.Respon case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -631,6 +643,9 @@ func awsAwsjson11_deserializeOpErrorDeleteBudget(response *smithyhttp.Response, case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -754,6 +769,9 @@ func awsAwsjson11_deserializeOpErrorDeleteBudgetAction(response *smithyhttp.Resp case strings.EqualFold("ResourceLockedException", errorCode): return awsAwsjson11_deserializeErrorResourceLockedException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -874,6 +892,9 @@ func awsAwsjson11_deserializeOpErrorDeleteNotification(response *smithyhttp.Resp case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -994,6 +1015,9 @@ func awsAwsjson11_deserializeOpErrorDeleteSubscriber(response *smithyhttp.Respon case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1114,6 +1138,9 @@ func awsAwsjson11_deserializeOpErrorDescribeBudget(response *smithyhttp.Response case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1234,6 +1261,9 @@ func awsAwsjson11_deserializeOpErrorDescribeBudgetAction(response *smithyhttp.Re case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1357,6 +1387,9 @@ func awsAwsjson11_deserializeOpErrorDescribeBudgetActionHistories(response *smit case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1477,6 +1510,9 @@ func awsAwsjson11_deserializeOpErrorDescribeBudgetActionsForAccount(response *sm case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1600,6 +1636,9 @@ func awsAwsjson11_deserializeOpErrorDescribeBudgetActionsForBudget(response *smi case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1726,6 +1765,9 @@ func awsAwsjson11_deserializeOpErrorDescribeBudgetNotificationsForAccount(respon case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1852,6 +1894,9 @@ func awsAwsjson11_deserializeOpErrorDescribeBudgetPerformanceHistory(response *s case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1978,6 +2023,9 @@ func awsAwsjson11_deserializeOpErrorDescribeBudgets(response *smithyhttp.Respons case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2104,6 +2152,9 @@ func awsAwsjson11_deserializeOpErrorDescribeNotificationsForBudget(response *smi case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2230,6 +2281,9 @@ func awsAwsjson11_deserializeOpErrorDescribeSubscribersForNotification(response case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2353,6 +2407,9 @@ func awsAwsjson11_deserializeOpErrorExecuteBudgetAction(response *smithyhttp.Res case strings.EqualFold("ResourceLockedException", errorCode): return awsAwsjson11_deserializeErrorResourceLockedException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2473,6 +2530,9 @@ func awsAwsjson11_deserializeOpErrorUpdateBudget(response *smithyhttp.Response, case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2596,6 +2656,9 @@ func awsAwsjson11_deserializeOpErrorUpdateBudgetAction(response *smithyhttp.Resp case strings.EqualFold("ResourceLockedException", errorCode): return awsAwsjson11_deserializeErrorResourceLockedException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2719,6 +2782,9 @@ func awsAwsjson11_deserializeOpErrorUpdateNotification(response *smithyhttp.Resp case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2842,6 +2908,9 @@ func awsAwsjson11_deserializeOpErrorUpdateSubscriber(response *smithyhttp.Respon case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3167,6 +3236,41 @@ func awsAwsjson11_deserializeErrorResourceLockedException(response *smithyhttp.R return output } +func awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson11_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4325,7 +4429,7 @@ func awsAwsjson11_deserializeDocumentDimensionValues(v *[]string, value interfac if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + return fmt.Errorf("expected DimensionValue to be of type string, got %T instead", value) } col = jtv } @@ -5273,6 +5377,46 @@ func awsAwsjson11_deserializeDocumentTargetIds(v *[]string, value interface{}) e return nil } +func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, 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.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentTimePeriod(v **types.TimePeriod, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/budgets/doc.go b/service/budgets/doc.go index ed473264cdd..c5b5d967f1f 100644 --- a/service/budgets/doc.go +++ b/service/budgets/doc.go @@ -3,51 +3,51 @@ // Package budgets provides the API client, operations, and parameter types for AWS // Budgets. // -// The Amazon Web Services Budgets API enables you to use Amazon Web Services -// Budgets to plan your service usage, service costs, and instance reservations. -// The API reference provides descriptions, syntax, and usage examples for each of -// the actions and data types for Amazon Web Services Budgets. Budgets provide you -// with a way to see the following information: +// Use the Amazon Web Services Budgets API to plan your service usage, service +// costs, and instance reservations. This API reference provides descriptions, +// syntax, and usage examples for each of the actions and data types for the Amazon +// Web Services Budgets feature. Budgets provide you with a way to see the +// following information: // -// * How close your plan is to your -// budgeted amount or to the free tier limits +// * How close your plan is to your budgeted amount or to +// the free tier limits // -// * Your usage-to-date, including how -// much you've used of your Reserved Instances (RIs) +// * Your usage-to-date, including how much you've used of +// your Reserved Instances (RIs) // -// * Your current estimated -// charges from Amazon Web Services, and how much your predicted usage will accrue -// in charges by the end of the month +// * Your current estimated charges from Amazon Web +// Services, and how much your predicted usage will accrue in charges by the end of +// the month // -// * How much of your budget has been -// used +// * How much of your budget has been used // -// Amazon Web Services updates your budget status several times a day. -// Budgets track your unblended costs, subscriptions, refunds, and RIs. You can -// create the following types of budgets: +// Amazon Web Services updates +// your budget status several times a day. Budgets track your unblended costs, +// subscriptions, refunds, and RIs. You can create the following types of +// budgets: // -// * Cost budgets - Plan how much you want -// to spend on a service. +// * Cost budgets - Plan how much you want to spend on a service. // -// * Usage budgets - Plan how much you want to use one or -// more services. +// * +// Usage budgets - Plan how much you want to use one or more services. // -// * RI utilization budgets - Define a utilization threshold, and -// receive alerts when your RI usage falls below that threshold. This lets you see -// if your RIs are unused or under-utilized. +// * RI +// utilization budgets - Define a utilization threshold, and receive alerts when +// your RI usage falls below that threshold. This lets you see if your RIs are +// unused or under-utilized. // -// * RI coverage budgets - Define a -// coverage threshold, and receive alerts when the number of your instance hours -// that are covered by RIs fall below that threshold. This lets you see how much of -// your instance usage is covered by a reservation. +// * RI coverage budgets - Define a coverage threshold, +// and receive alerts when the number of your instance hours that are covered by +// RIs fall below that threshold. This lets you see how much of your instance usage +// is covered by a reservation. // -// Service Endpoint The Amazon -// Web Services Budgets API provides the following endpoint: +// Service Endpoint The Amazon Web Services Budgets +// API provides the following endpoint: // -// * -// https://budgets.amazonaws.com +// * https://budgets.amazonaws.com // -// For information about costs that are associated -// with the Amazon Web Services Budgets API, see Amazon Web Services Cost -// Management Pricing (https://aws.amazon.com/aws-cost-management/pricing/). +// For +// information about costs that are associated with the Amazon Web Services Budgets +// API, see Amazon Web Services Cost Management Pricing +// (https://aws.amazon.com/aws-cost-management/pricing/). package budgets diff --git a/service/budgets/types/errors.go b/service/budgets/types/errors.go index c6413125bb8..243d6ec8040 100644 --- a/service/budgets/types/errors.go +++ b/service/budgets/types/errors.go @@ -179,3 +179,23 @@ func (e *ResourceLockedException) ErrorMessage() string { } func (e *ResourceLockedException) ErrorCode() string { return "ResourceLockedException" } func (e *ResourceLockedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The number of API requests has exceeded the maximum allowed API request +// throttling limit for the account. +type ThrottlingException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/lookoutmetrics/api_op_CreateAlert.go b/service/lookoutmetrics/api_op_CreateAlert.go index 8cff37f3f74..b61b89c4a1c 100644 --- a/service/lookoutmetrics/api_op_CreateAlert.go +++ b/service/lookoutmetrics/api_op_CreateAlert.go @@ -39,11 +39,6 @@ type CreateAlertInput struct { // This member is required. AlertName *string - // An integer from 0 to 100 specifying the alert sensitivity threshold. - // - // This member is required. - AlertSensitivityThreshold int32 - // The ARN of the detector to which the alert is attached. // // This member is required. @@ -52,6 +47,13 @@ type CreateAlertInput struct { // A description of the alert. AlertDescription *string + // The configuration of the alert filters, containing MetricList and + // DimensionFilterList. + AlertFilters *types.AlertFilters + + // An integer from 0 to 100 specifying the alert sensitivity threshold. + AlertSensitivityThreshold int32 + // A list of tags // (https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html) to // apply to the alert. diff --git a/service/lookoutmetrics/api_op_UpdateAlert.go b/service/lookoutmetrics/api_op_UpdateAlert.go new file mode 100644 index 00000000000..3a5d0b06db6 --- /dev/null +++ b/service/lookoutmetrics/api_op_UpdateAlert.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutmetrics + +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/lookoutmetrics/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Make changes to an existing alert. +func (c *Client) UpdateAlert(ctx context.Context, params *UpdateAlertInput, optFns ...func(*Options)) (*UpdateAlertOutput, error) { + if params == nil { + params = &UpdateAlertInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAlert", params, optFns, c.addOperationUpdateAlertMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAlertOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAlertInput struct { + + // The ARN of the alert to update. + // + // This member is required. + AlertArn *string + + // Action that will be triggered when there is an alert. + Action *types.Action + + // A description of the alert. + AlertDescription *string + + // The configuration of the alert filters, containing MetricList and + // DimensionFilterList. + AlertFilters *types.AlertFilters + + // An integer from 0 to 100 specifying the alert sensitivity threshold. + AlertSensitivityThreshold int32 + + noSmithyDocumentSerde +} + +type UpdateAlertOutput struct { + + // The ARN of the updated alert. + AlertArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAlertMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAlert{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAlert{}, 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 = addOpUpdateAlertValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAlert(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_opUpdateAlert(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutmetrics", + OperationName: "UpdateAlert", + } +} diff --git a/service/lookoutmetrics/deserializers.go b/service/lookoutmetrics/deserializers.go index 8d4d018b05c..db193450550 100644 --- a/service/lookoutmetrics/deserializers.go +++ b/service/lookoutmetrics/deserializers.go @@ -3974,6 +3974,169 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } +type awsRestjson1_deserializeOpUpdateAlert struct { +} + +func (*awsRestjson1_deserializeOpUpdateAlert) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAlert) 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_deserializeOpErrorUpdateAlert(response, &metadata) + } + output := &UpdateAlertOutput{} + 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_deserializeOpDocumentUpdateAlertOutput(&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_deserializeOpErrorUpdateAlert(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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAlertOutput(v **UpdateAlertOutput, 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 *UpdateAlertOutput + if *v == nil { + sv = &UpdateAlertOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AlertArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AlertArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpUpdateAnomalyDetector struct { } @@ -4681,6 +4844,11 @@ func awsRestjson1_deserializeDocumentAlert(v **types.Alert, value interface{}) e sv.AlertDescription = ptr.String(jtv) } + case "AlertFilters": + if err := awsRestjson1_deserializeDocumentAlertFilters(&sv.AlertFilters, value); err != nil { + return err + } + case "AlertName": if value != nil { jtv, ok := value.(string) @@ -4771,6 +4939,47 @@ func awsRestjson1_deserializeDocumentAlert(v **types.Alert, value interface{}) e return nil } +func awsRestjson1_deserializeDocumentAlertFilters(v **types.AlertFilters, 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.AlertFilters + if *v == nil { + sv = &types.AlertFilters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DimensionFilterList": + if err := awsRestjson1_deserializeDocumentDimensionFilterList(&sv.DimensionFilterList, value); err != nil { + return err + } + + case "MetricList": + if err := awsRestjson1_deserializeDocumentMetricNameList(&sv.MetricList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAlertSummary(v **types.AlertSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6310,6 +6519,85 @@ func awsRestjson1_deserializeDocumentDimensionContributionList(v *[]types.Dimens return nil } +func awsRestjson1_deserializeDocumentDimensionFilter(v **types.DimensionFilter, 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.DimensionFilter + if *v == nil { + sv = &types.DimensionFilter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DimensionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + } + sv.DimensionName = ptr.String(jtv) + } + + case "DimensionValueList": + if err := awsRestjson1_deserializeDocumentDimensionValueList(&sv.DimensionValueList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDimensionFilterList(v *[]types.DimensionFilter, 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.DimensionFilter + if *v == nil { + cv = []types.DimensionFilter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DimensionFilter + destAddr := &col + if err := awsRestjson1_deserializeDocumentDimensionFilter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentDimensionList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6537,6 +6825,42 @@ func awsRestjson1_deserializeDocumentDimensionValueContributionList(v *[]types.D return nil } +func awsRestjson1_deserializeDocumentDimensionValueList(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DimensionValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentExecutionList(v *[]types.ExecutionStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7313,6 +7637,42 @@ func awsRestjson1_deserializeDocumentMetricList(v *[]types.Metric, value interfa return nil } +func awsRestjson1_deserializeDocumentMetricNameList(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentMetricSetSummary(v **types.MetricSetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/lookoutmetrics/generated.json b/service/lookoutmetrics/generated.json index fc95860eb96..e36b664e5e3 100644 --- a/service/lookoutmetrics/generated.json +++ b/service/lookoutmetrics/generated.json @@ -34,6 +34,7 @@ "api_op_PutFeedback.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateAlert.go", "api_op_UpdateAnomalyDetector.go", "api_op_UpdateMetricSet.go", "deserializers.go", diff --git a/service/lookoutmetrics/serializers.go b/service/lookoutmetrics/serializers.go index 507cc63c62d..23268f2e842 100644 --- a/service/lookoutmetrics/serializers.go +++ b/service/lookoutmetrics/serializers.go @@ -222,12 +222,19 @@ func awsRestjson1_serializeOpDocumentCreateAlertInput(v *CreateAlertInput, value ok.String(*v.AlertDescription) } + if v.AlertFilters != nil { + ok := object.Key("AlertFilters") + if err := awsRestjson1_serializeDocumentAlertFilters(v.AlertFilters, ok); err != nil { + return err + } + } + if v.AlertName != nil { ok := object.Key("AlertName") ok.String(*v.AlertName) } - { + if v.AlertSensitivityThreshold != 0 { ok := object.Key("AlertSensitivityThreshold") ok.Integer(v.AlertSensitivityThreshold) } @@ -2029,6 +2036,98 @@ func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInpu return nil } +type awsRestjson1_serializeOpUpdateAlert struct { +} + +func (*awsRestjson1_serializeOpUpdateAlert) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAlert) 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.(*UpdateAlertInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/UpdateAlert") + 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_serializeOpDocumentUpdateAlertInput(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_serializeOpHttpBindingsUpdateAlertInput(v *UpdateAlertInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAlertInput(v *UpdateAlertInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("Action") + if err := awsRestjson1_serializeDocumentAction(v.Action, ok); err != nil { + return err + } + } + + if v.AlertArn != nil { + ok := object.Key("AlertArn") + ok.String(*v.AlertArn) + } + + if v.AlertDescription != nil { + ok := object.Key("AlertDescription") + ok.String(*v.AlertDescription) + } + + if v.AlertFilters != nil { + ok := object.Key("AlertFilters") + if err := awsRestjson1_serializeDocumentAlertFilters(v.AlertFilters, ok); err != nil { + return err + } + } + + if v.AlertSensitivityThreshold != 0 { + ok := object.Key("AlertSensitivityThreshold") + ok.Integer(v.AlertSensitivityThreshold) + } + + return nil +} + type awsRestjson1_serializeOpUpdateAnomalyDetector struct { } @@ -2246,6 +2345,27 @@ func awsRestjson1_serializeDocumentAction(v *types.Action, value smithyjson.Valu return nil } +func awsRestjson1_serializeDocumentAlertFilters(v *types.AlertFilters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DimensionFilterList != nil { + ok := object.Key("DimensionFilterList") + if err := awsRestjson1_serializeDocumentDimensionFilterList(v.DimensionFilterList, ok); err != nil { + return err + } + } + + if v.MetricList != nil { + ok := object.Key("MetricList") + if err := awsRestjson1_serializeDocumentMetricNameList(v.MetricList, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentAnomalyDetectorConfig(v *types.AnomalyDetectorConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2463,6 +2583,38 @@ func awsRestjson1_serializeDocumentCsvFormatDescriptor(v *types.CsvFormatDescrip return nil } +func awsRestjson1_serializeDocumentDimensionFilter(v *types.DimensionFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DimensionName != nil { + ok := object.Key("DimensionName") + ok.String(*v.DimensionName) + } + + if v.DimensionValueList != nil { + ok := object.Key("DimensionValueList") + if err := awsRestjson1_serializeDocumentDimensionValueList(v.DimensionValueList, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentDimensionFilterList(v []types.DimensionFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDimensionFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentDimensionList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2474,6 +2626,17 @@ func awsRestjson1_serializeDocumentDimensionList(v []string, value smithyjson.Va return nil } +func awsRestjson1_serializeDocumentDimensionValueList(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_serializeDocumentFileFormatDescriptor(v *types.FileFormatDescriptor, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2586,6 +2749,17 @@ func awsRestjson1_serializeDocumentMetricList(v []types.Metric, value smithyjson return nil } +func awsRestjson1_serializeDocumentMetricNameList(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_serializeDocumentMetricSource(v *types.MetricSource, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/lookoutmetrics/types/types.go b/service/lookoutmetrics/types/types.go index 681dd1aad58..47f583c2df5 100644 --- a/service/lookoutmetrics/types/types.go +++ b/service/lookoutmetrics/types/types.go @@ -32,6 +32,10 @@ type Alert struct { // A description of the alert. AlertDescription *string + // The configuration of the alert filters, containing MetricList and + // DimensionFilter. + AlertFilters *AlertFilters + // The name of the alert. AlertName *string @@ -56,6 +60,18 @@ type Alert struct { noSmithyDocumentSerde } +// The configuration of the alert filters. +type AlertFilters struct { + + // The list of DimensionFilter objects that are used for dimension-based filtering. + DimensionFilterList []DimensionFilter + + // The list of measures that you want to get alerts for. + MetricList []string + + noSmithyDocumentSerde +} + // Provides a summary of an alert's configuration. type AlertSummary struct { @@ -480,6 +496,19 @@ type DimensionContribution struct { noSmithyDocumentSerde } +// The dimension filter, containing DimensionName and DimensionValueList. +type DimensionFilter struct { + + // The name of the dimension to filter on. + DimensionName *string + + // The list of values for the dimension specified in DimensionName that you want to + // filter on. + DimensionValueList []string + + noSmithyDocumentSerde +} + // A dimension name and value. type DimensionNameValue struct { @@ -804,6 +833,17 @@ type SNSConfiguration struct { SnsTopicArn *string // The format of the SNS topic. + // + // * JSON – Send JSON alerts with an anomaly ID and a + // link to the anomaly detail page. This is the default. + // + // * LONG_TEXT – Send + // human-readable alerts with information about the impacted timeseries and a link + // to the anomaly detail page. We recommend this for email. + // + // * SHORT_TEXT – Send + // human-readable alerts with a link to the anomaly detail page. We recommend this + // for SMS. SnsFormat SnsFormat noSmithyDocumentSerde diff --git a/service/lookoutmetrics/validators.go b/service/lookoutmetrics/validators.go index 27109e4f1b8..5075a04c376 100644 --- a/service/lookoutmetrics/validators.go +++ b/service/lookoutmetrics/validators.go @@ -470,6 +470,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateAlert struct { +} + +func (*validateOpUpdateAlert) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAlert) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAlertInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAlertInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateAnomalyDetector struct { } @@ -602,6 +622,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateAlertValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAlert{}, middleware.After) +} + func addOpUpdateAnomalyDetectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAnomalyDetector{}, middleware.After) } @@ -1302,6 +1326,26 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateAlertInput(v *UpdateAlertInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAlertInput"} + if v.AlertArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AlertArn")) + } + if v.Action != nil { + if err := validateAction(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateAnomalyDetectorInput(v *UpdateAnomalyDetectorInput) error { if v == nil { return nil diff --git a/service/mediaconvert/deserializers.go b/service/mediaconvert/deserializers.go index 2d30db40a60..0abafa86e95 100644 --- a/service/mediaconvert/deserializers.go +++ b/service/mediaconvert/deserializers.go @@ -6642,6 +6642,15 @@ func awsRestjson1_deserializeDocumentAudioSelector(v **types.AudioSelector, valu for key, value := range shape { switch key { + case "audioDurationCorrection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AudioDurationCorrection to be of type string, got %T instead", value) + } + sv.AudioDurationCorrection = types.AudioDurationCorrection(jtv) + } + case "customLanguageCode": if value != nil { jtv, ok := value.(string) diff --git a/service/mediaconvert/serializers.go b/service/mediaconvert/serializers.go index a7b4c3fd391..ff07710ff5b 100644 --- a/service/mediaconvert/serializers.go +++ b/service/mediaconvert/serializers.go @@ -2939,6 +2939,11 @@ func awsRestjson1_serializeDocumentAudioSelector(v *types.AudioSelector, value s object := value.Object() defer object.Close() + if len(v.AudioDurationCorrection) > 0 { + ok := object.Key("audioDurationCorrection") + ok.String(string(v.AudioDurationCorrection)) + } + if v.CustomLanguageCode != nil { ok := object.Key("customLanguageCode") ok.String(*v.CustomLanguageCode) diff --git a/service/mediaconvert/types/enums.go b/service/mediaconvert/types/enums.go index cab3db1cff7..b990f3c47f1 100644 --- a/service/mediaconvert/types/enums.go +++ b/service/mediaconvert/types/enums.go @@ -533,6 +533,28 @@ func (AudioDefaultSelection) Values() []AudioDefaultSelection { } } +type AudioDurationCorrection string + +// Enum values for AudioDurationCorrection +const ( + AudioDurationCorrectionDisabled AudioDurationCorrection = "DISABLED" + AudioDurationCorrectionAuto AudioDurationCorrection = "AUTO" + AudioDurationCorrectionTrack AudioDurationCorrection = "TRACK" + AudioDurationCorrectionFrame AudioDurationCorrection = "FRAME" +) + +// Values returns all known values for AudioDurationCorrection. 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 (AudioDurationCorrection) Values() []AudioDurationCorrection { + return []AudioDurationCorrection{ + "DISABLED", + "AUTO", + "TRACK", + "FRAME", + } +} + type AudioLanguageCodeControl string // Enum values for AudioLanguageCodeControl diff --git a/service/mediaconvert/types/types.go b/service/mediaconvert/types/types.go index 7f2ec4eb1db..af7a599a205 100644 --- a/service/mediaconvert/types/types.go +++ b/service/mediaconvert/types/types.go @@ -424,6 +424,22 @@ type AudioNormalizationSettings struct { // selectors per input. type AudioSelector struct { + // Apply audio timing corrections to help synchronize audio and video in your + // output. To apply timing corrections, your input must meet the following + // requirements: * Container: MP4, or MOV, with an accurate time-to-sample (STTS) + // table. * Audio track: AAC. Choose from the following audio timing correction + // settings: * Disabled (Default): Apply no correction. * Auto: Recommended for + // most inputs. MediaConvert analyzes the audio timing in your input and determines + // which correction setting to use, if needed. * Track: Adjust the duration of each + // audio frame by a constant amount to align the audio track length with STTS + // duration. Track-level correction does not affect pitch, and is recommended for + // tonal audio content such as music. * Frame: Adjust the duration of each audio + // frame by a variable amount to align audio frames with STTS timestamps. No + // corrections are made to already-aligned frames. Frame-level correction may + // affect the pitch of corrected frames, and is recommended for atonal audio + // content such as speech or percussion. + AudioDurationCorrection AudioDurationCorrection + // Selects a specific language code from within an audio source, using the ISO // 639-2 or ISO 639-3 three-letter language code CustomLanguageCode *string @@ -4352,11 +4368,12 @@ type Input struct { // https://docs.aws.amazon.com/console/mediaconvert/timecode. TimecodeStart *string - // Use this setting if you do not have a video input or if you want to add black - // video frames before, or after, other inputs. When you include Video generator, - // MediaConvert creates a video input with black frames and without an audio track. - // You can specify a value for Video generator, or you can specify an Input file, - // but you cannot specify both. + // When you include Video generator, MediaConvert creates a video input with black + // frames. Use this setting if you do not have a video input or if you want to add + // black video frames before, or after, other inputs. You can specify Video + // generator, or you can specify an Input file, but you cannot specify both. For + // more information, see + // https://docs.aws.amazon.com/mediaconvert/latest/ug/video-generator.html VideoGenerator *InputVideoGenerator // Input video selectors contain the video settings for the input. Each of your @@ -4553,11 +4570,12 @@ type InputTemplate struct { noSmithyDocumentSerde } -// Use this setting if you do not have a video input or if you want to add black -// video frames before, or after, other inputs. When you include Video generator, -// MediaConvert creates a video input with black frames and without an audio track. -// You can specify a value for Video generator, or you can specify an Input file, -// but you cannot specify both. +// When you include Video generator, MediaConvert creates a video input with black +// frames. Use this setting if you do not have a video input or if you want to add +// black video frames before, or after, other inputs. You can specify Video +// generator, or you can specify an Input file, but you cannot specify both. For +// more information, see +// https://docs.aws.amazon.com/mediaconvert/latest/ug/video-generator.html type InputVideoGenerator struct { // Specify an integer value for Black video duration from 50 to 86400000 to