diff --git a/.changelog/3bfa40dbf22340a7b533efaece46137d.json b/.changelog/3bfa40dbf22340a7b533efaece46137d.json new file mode 100644 index 00000000000..842e201632e --- /dev/null +++ b/.changelog/3bfa40dbf22340a7b533efaece46137d.json @@ -0,0 +1,8 @@ +{ + "id": "3bfa40db-f223-40a7-b533-efaece46137d", + "type": "feature", + "description": "This release adds a new API called ListAssets to the Outposts SDK, which lists the hardware assets in an Outpost.", + "modules": [ + "service/outposts" + ] +} \ No newline at end of file diff --git a/.changelog/47349b98a076480ab92e3ea4864414ba.json b/.changelog/47349b98a076480ab92e3ea4864414ba.json new file mode 100644 index 00000000000..2d48d666f13 --- /dev/null +++ b/.changelog/47349b98a076480ab92e3ea4864414ba.json @@ -0,0 +1,8 @@ +{ + "id": "47349b98-a076-480a-b92e-3ea4864414ba", + "type": "feature", + "description": "CloudWatch Synthetics has introduced a new feature to provide customers with an option to delete the underlying resources that Synthetics canary creates when the user chooses to delete the canary.", + "modules": [ + "service/synthetics" + ] +} \ No newline at end of file diff --git a/.changelog/90ea14b3873d43d1be955f312395ea7e.json b/.changelog/90ea14b3873d43d1be955f312395ea7e.json new file mode 100644 index 00000000000..fd78d9a754a --- /dev/null +++ b/.changelog/90ea14b3873d43d1be955f312395ea7e.json @@ -0,0 +1,8 @@ +{ + "id": "90ea14b3-873d-43d1-be95-5f312395ea7e", + "type": "feature", + "description": "This release adds the INVALID_PAYMENT_INSTRUMENT as a fail reason and an error message.", + "modules": [ + "service/organizations" + ] +} \ No newline at end of file diff --git a/service/chimesdkmediapipelines/internal/endpoints/endpoints.go b/service/chimesdkmediapipelines/internal/endpoints/endpoints.go index 5df5225495e..00bd62fff2e 100644 --- a/service/chimesdkmediapipelines/internal/endpoints/endpoints.go +++ b/service/chimesdkmediapipelines/internal/endpoints/endpoints.go @@ -134,6 +134,50 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "media-pipelines-chime-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "media-pipelines-chime-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "media-pipelines-chime-fips.us-west-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2-fips", + }: endpoints.Endpoint{ + Hostname: "media-pipelines-chime-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + }, }, { ID: "aws-cn", diff --git a/service/ivschat/internal/endpoints/endpoints.go b/service/ivschat/internal/endpoints/endpoints.go index 3cf7913d574..7714d953afd 100644 --- a/service/ivschat/internal/endpoints/endpoints.go +++ b/service/ivschat/internal/endpoints/endpoints.go @@ -134,6 +134,17 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-cn", diff --git a/service/nimble/internal/endpoints/endpoints.go b/service/nimble/internal/endpoints/endpoints.go index 7d59ba42197..d42002ebb20 100644 --- a/service/nimble/internal/endpoints/endpoints.go +++ b/service/nimble/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: "ap-southeast-2", }: endpoints.Endpoint{}, diff --git a/service/organizations/api_op_CloseAccount.go b/service/organizations/api_op_CloseAccount.go index f84ac579178..ada11569615 100644 --- a/service/organizations/api_op_CloseAccount.go +++ b/service/organizations/api_op_CloseAccount.go @@ -10,8 +10,46 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Closes an Amazon Web Services account that is now a part of an Organizations, -// either created within the organization, or invited to join the organization. +// Closes an Amazon Web Services member account within an organization. You can't +// close the management account with this API. This is an asynchronous request that +// Amazon Web Services performs in the background. Because CloseAccount operates +// asynchronously, it can return a successful completion message even though +// account closure might still be in progress. You need to wait a few minutes +// before the account is fully closed. To check the status of the request, do one +// of the following: +// +// * Use the AccountId that you sent in the CloseAccount request +// to provide as a parameter to the DescribeAccount operation. While the close +// account request is in progress, Account status will indicate PENDING_CLOSURE. +// When the close account request completes, the status will change to +// SUSPENDED. +// +// * Check the CloudTrail log for the CloseAccountResult event that +// gets published after the account closes successfully. For information on using +// CloudTrail with Organizations, see Logging and monitoring in Organizations +// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration) +// in the Organizations User Guide. +// +// * You can only close 10% of active member +// accounts within a rolling 30 day period. This quota is not bound by a calendar +// month, but starts when you close an account. Within 30 days of that initial +// account closure, you can't exceed the 10% account closure limit. +// +// * To reinstate +// a closed account, contact Amazon Web Services Support within the 90-day grace +// period while the account is in SUSPENDED status. +// +// * If the Amazon Web Services +// account you attempt to close is linked to an Amazon Web Services GovCloud (US) +// account, the CloseAccount request will close both accounts. To learn important +// pre-closure details, see Closing an Amazon Web Services GovCloud (US) account +// (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html) +// in the Amazon Web Services GovCloud User Guide. +// +// For more information about +// closing accounts, see Closing an Amazon Web Services account +// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) +// in the Organizations User Guide. func (c *Client) CloseAccount(ctx context.Context, params *CloseAccountInput, optFns ...func(*Options)) (*CloseAccountOutput, error) { if params == nil { params = &CloseAccountInput{} diff --git a/service/organizations/api_op_CreateGovCloudAccount.go b/service/organizations/api_op_CreateGovCloudAccount.go index 1b866226107..18e581482cf 100644 --- a/service/organizations/api_op_CreateGovCloudAccount.go +++ b/service/organizations/api_op_CreateGovCloudAccount.go @@ -150,7 +150,9 @@ func (c *Client) CreateGovCloudAccount(ctx context.Context, params *CreateGovClo type CreateGovCloudAccountInput struct { - // The friendly name of the member account. + // The friendly name of the member account. The account name can consist of only + // the characters [a-z],[A-Z],[0-9], hyphen (-), or dot (.) You can't separate + // characters with a dash (–). // // This member is required. AccountName *string diff --git a/service/organizations/types/enums.go b/service/organizations/types/enums.go index ac4479dd09d..cc0da4c7503 100644 --- a/service/organizations/types/enums.go +++ b/service/organizations/types/enums.go @@ -133,6 +133,7 @@ const ( ConstraintViolationExceptionReasonCloseAccountQuotaExceeded ConstraintViolationExceptionReason = "CLOSE_ACCOUNT_QUOTA_EXCEEDED" ConstraintViolationExceptionReasonCloseAccountRequestsLimitExceeded ConstraintViolationExceptionReason = "CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonServiceAccessNotEnabled ConstraintViolationExceptionReason = "SERVICE_ACCESS_NOT_ENABLED" + ConstraintViolationExceptionReasonInvalidPaymentInstrument ConstraintViolationExceptionReason = "INVALID_PAYMENT_INSTRUMENT" ) // Values returns all known values for ConstraintViolationExceptionReason. Note @@ -173,6 +174,7 @@ func (ConstraintViolationExceptionReason) Values() []ConstraintViolationExceptio "CLOSE_ACCOUNT_QUOTA_EXCEEDED", "CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED", "SERVICE_ACCESS_NOT_ENABLED", + "INVALID_PAYMENT_INSTRUMENT", } } @@ -193,6 +195,7 @@ const ( CreateAccountFailureReasonInvalidIdentityForBusinessValidation CreateAccountFailureReason = "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION" CreateAccountFailureReasonUnknownBusinessValidation CreateAccountFailureReason = "UNKNOWN_BUSINESS_VALIDATION" CreateAccountFailureReasonMissingPaymentInstrument CreateAccountFailureReason = "MISSING_PAYMENT_INSTRUMENT" + CreateAccountFailureReasonInvalidPaymentInstrument CreateAccountFailureReason = "INVALID_PAYMENT_INSTRUMENT" ) // Values returns all known values for CreateAccountFailureReason. Note that this @@ -213,6 +216,7 @@ func (CreateAccountFailureReason) Values() []CreateAccountFailureReason { "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION", "UNKNOWN_BUSINESS_VALIDATION", "MISSING_PAYMENT_INSTRUMENT", + "INVALID_PAYMENT_INSTRUMENT", } } diff --git a/service/organizations/types/errors.go b/service/organizations/types/errors.go index a2d6d9b4e0c..2aaf4ddf5f9 100644 --- a/service/organizations/types/errors.go +++ b/service/organizations/types/errors.go @@ -313,11 +313,24 @@ func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.Fault // only a member account as a delegated administrator. // // * +// CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management account. +// To close the management account for the organization, you must first either +// remove or close all member accounts in the organization. Follow standard account +// closure process using root credentials. +// +// * // CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove an // account that is registered as a delegated administrator for a service integrated // with your organization. To complete this operation, you must first deregister // this account as a delegated administrator. // +// * CLOSE_ACCOUNT_QUOTA_EXCEEDED: You +// have exceeded close account quota for the past 30 days. +// +// * +// CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number of +// accounts that you can close at a time. +// // * // CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an // organization in the specified region, you must enable all features mode. @@ -337,6 +350,13 @@ func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.Fault // to exceed the number of handshakes that you can send in one day. // // * +// INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no supported +// payment method is associated with the account. Amazon Web Services does not +// support cards issued by financial institutions in Russia or Belarus. For more +// information, see Managing your Amazon Web Services payments +// (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). +// +// * // MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account in this // organization, you first must migrate the organization's management account to // the marketplace that corresponds to the management account's address. For diff --git a/service/organizations/types/types.go b/service/organizations/types/types.go index 560f823dcec..bc7f6aab2c5 100644 --- a/service/organizations/types/types.go +++ b/service/organizations/types/types.go @@ -115,24 +115,32 @@ type CreateAccountStatus struct { // INVALID_EMAIL: The account could not be created because the email address you // provided is not valid. // - // * INTERNAL_FAILURE: The account could not be created - // because of an internal failure. Try again later. If the problem persists, - // contact Amazon Web Services Customer Support. + // * INVALID_PAYMENT_INSTRUMENT: The Amazon Web Services + // account that owns your organization does not have a supported payment method + // associated with the account. Amazon Web Services does not support cards issued + // by financial institutions in Russia or Belarus. For more information, see + // Managing your Amazon Web Services payments + // (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). // - // * MISSING_BUSINESS_VALIDATION: - // The Amazon Web Services account that owns your organization has not received - // Business Validation. + // * + // INTERNAL_FAILURE: The account could not be created because of an internal + // failure. Try again later. If the problem persists, contact Amazon Web Services + // Customer Support. // - // * MISSING_PAYMENT_INSTRUMENT: You must configure the - // management account with a valid payment method, such as a credit card. + // * MISSING_BUSINESS_VALIDATION: The Amazon Web Services + // account that owns your organization has not received Business Validation. // // * - // PENDING_BUSINESS_VALIDATION: The Amazon Web Services account that owns your - // organization is still in the process of completing business license - // validation. + // MISSING_PAYMENT_INSTRUMENT: You must configure the management account with a + // valid payment method, such as a credit card. + // + // * PENDING_BUSINESS_VALIDATION: The + // Amazon Web Services account that owns your organization is still in the process + // of completing business license validation. // - // * UNKNOWN_BUSINESS_VALIDATION: The Amazon Web Services account that - // owns your organization has an unknown issue with business license validation. + // * UNKNOWN_BUSINESS_VALIDATION: The + // Amazon Web Services account that owns your organization has an unknown issue + // with business license validation. FailureReason CreateAccountFailureReason // If the account was created successfully, the unique identifier (ID) of the new diff --git a/service/outposts/api_op_GetOutpostInstanceTypes.go b/service/outposts/api_op_GetOutpostInstanceTypes.go index 3e38eb2f55b..d905814a717 100644 --- a/service/outposts/api_op_GetOutpostInstanceTypes.go +++ b/service/outposts/api_op_GetOutpostInstanceTypes.go @@ -4,6 +4,7 @@ package outposts import ( "context" + "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/outposts/types" @@ -11,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the instance types for the specified Outpost. +// Gets the instance types for the specified Outpost. func (c *Client) GetOutpostInstanceTypes(ctx context.Context, params *GetOutpostInstanceTypesInput, optFns ...func(*Options)) (*GetOutpostInstanceTypesOutput, error) { if params == nil { params = &GetOutpostInstanceTypesInput{} @@ -126,6 +127,98 @@ func (c *Client) addOperationGetOutpostInstanceTypesMiddlewares(stack *middlewar return nil } +// GetOutpostInstanceTypesAPIClient is a client that implements the +// GetOutpostInstanceTypes operation. +type GetOutpostInstanceTypesAPIClient interface { + GetOutpostInstanceTypes(context.Context, *GetOutpostInstanceTypesInput, ...func(*Options)) (*GetOutpostInstanceTypesOutput, error) +} + +var _ GetOutpostInstanceTypesAPIClient = (*Client)(nil) + +// GetOutpostInstanceTypesPaginatorOptions is the paginator options for +// GetOutpostInstanceTypes +type GetOutpostInstanceTypesPaginatorOptions struct { + // The maximum page size. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// GetOutpostInstanceTypesPaginator is a paginator for GetOutpostInstanceTypes +type GetOutpostInstanceTypesPaginator struct { + options GetOutpostInstanceTypesPaginatorOptions + client GetOutpostInstanceTypesAPIClient + params *GetOutpostInstanceTypesInput + nextToken *string + firstPage bool +} + +// NewGetOutpostInstanceTypesPaginator returns a new +// GetOutpostInstanceTypesPaginator +func NewGetOutpostInstanceTypesPaginator(client GetOutpostInstanceTypesAPIClient, params *GetOutpostInstanceTypesInput, optFns ...func(*GetOutpostInstanceTypesPaginatorOptions)) *GetOutpostInstanceTypesPaginator { + if params == nil { + params = &GetOutpostInstanceTypesInput{} + } + + options := GetOutpostInstanceTypesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetOutpostInstanceTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetOutpostInstanceTypesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetOutpostInstanceTypes page. +func (p *GetOutpostInstanceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetOutpostInstanceTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.GetOutpostInstanceTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetOutpostInstanceTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/outposts/api_op_ListAssets.go b/service/outposts/api_op_ListAssets.go new file mode 100644 index 00000000000..515dd251241 --- /dev/null +++ b/service/outposts/api_op_ListAssets.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package outposts + +import ( + "context" + "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/outposts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the hardware assets in an Outpost. If you are using Dedicated Hosts on +// Amazon Web Services Outposts, you can filter your request by host ID to return a +// list of hardware assets that allocate resources for Dedicated Hosts. +func (c *Client) ListAssets(ctx context.Context, params *ListAssetsInput, optFns ...func(*Options)) (*ListAssetsOutput, error) { + if params == nil { + params = &ListAssetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAssets", params, optFns, c.addOperationListAssetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAssetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAssetsInput struct { + + // The ID or the Amazon Resource Name (ARN) of the Outpost. + // + // This member is required. + OutpostIdentifier *string + + // A filter for the host ID of Dedicated Hosts on the Outpost. Filter values are + // case sensitive. If you specify multiple values for a filter, the values are + // joined with an OR, and the request returns all results that match any of the + // specified values. + HostIdFilter []string + + // The maximum page size. + MaxResults *int32 + + // The pagination token. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAssetsOutput struct { + + // Information about hardware assets. + Assets []types.AssetInfo + + // The pagination token. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAssetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssets{}, 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 = addOpListAssetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssets(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 +} + +// ListAssetsAPIClient is a client that implements the ListAssets operation. +type ListAssetsAPIClient interface { + ListAssets(context.Context, *ListAssetsInput, ...func(*Options)) (*ListAssetsOutput, error) +} + +var _ ListAssetsAPIClient = (*Client)(nil) + +// ListAssetsPaginatorOptions is the paginator options for ListAssets +type ListAssetsPaginatorOptions struct { + // The maximum page size. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListAssetsPaginator is a paginator for ListAssets +type ListAssetsPaginator struct { + options ListAssetsPaginatorOptions + client ListAssetsAPIClient + params *ListAssetsInput + nextToken *string + firstPage bool +} + +// NewListAssetsPaginator returns a new ListAssetsPaginator +func NewListAssetsPaginator(client ListAssetsAPIClient, params *ListAssetsInput, optFns ...func(*ListAssetsPaginatorOptions)) *ListAssetsPaginator { + if params == nil { + params = &ListAssetsInput{} + } + + options := ListAssetsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAssets page. +func (p *ListAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListAssets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "outposts", + OperationName: "ListAssets", + } +} diff --git a/service/outposts/api_op_ListCatalogItems.go b/service/outposts/api_op_ListCatalogItems.go index 3091d751e39..bbbfa36a9b6 100644 --- a/service/outposts/api_op_ListCatalogItems.go +++ b/service/outposts/api_op_ListCatalogItems.go @@ -12,11 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Use to create a list of every item in the catalog. Add filters to your request -// to return a more specific list of results. Use filters to match an item class, -// storage option, or EC2 family. If you specify multiple filters, the filters are -// joined with an AND, and the request returns only results that match all of the -// specified filters. +// Lists the items in the catalog. Add filters to your request to return a more +// specific list of results. Use filters to match an item class, storage option, or +// EC2 family. If you specify multiple filters, the filters are joined with an AND, +// and the request returns only results that match all of the specified filters. func (c *Client) ListCatalogItems(ctx context.Context, params *ListCatalogItemsInput, optFns ...func(*Options)) (*ListCatalogItemsOutput, error) { if params == nil { params = &ListCatalogItemsInput{} diff --git a/service/outposts/api_op_ListOrders.go b/service/outposts/api_op_ListOrders.go index 138631d6917..b7d92136c03 100644 --- a/service/outposts/api_op_ListOrders.go +++ b/service/outposts/api_op_ListOrders.go @@ -12,8 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Create a list of the Outpost orders for your Amazon Web Services account. You -// can filter your request by Outpost to return a more specific list of results. +// Lists the Outpost orders for your Amazon Web Services account. You can filter +// your request by Outpost to return a more specific list of results. func (c *Client) ListOrders(ctx context.Context, params *ListOrdersInput, optFns ...func(*Options)) (*ListOrdersOutput, error) { if params == nil { params = &ListOrdersInput{} diff --git a/service/outposts/api_op_ListOutposts.go b/service/outposts/api_op_ListOutposts.go index af7d51cd8f0..7feb35eccba 100644 --- a/service/outposts/api_op_ListOutposts.go +++ b/service/outposts/api_op_ListOutposts.go @@ -12,11 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Create a list of the Outposts for your Amazon Web Services account. Add filters -// to your request to return a more specific list of results. Use filters to match -// an Outpost lifecycle status, Availability Zone (us-east-1a), and AZ ID -// (use1-az1). If you specify multiple filters, the filters are joined with an AND, -// and the request returns only results that match all of the specified filters. +// Lists the Outposts for your Amazon Web Services account. Add filters to your +// request to return a more specific list of results. Use filters to match an +// Outpost lifecycle status, Availability Zone (us-east-1a), and AZ ID (use1-az1). +// If you specify multiple filters, the filters are joined with an AND, and the +// request returns only results that match all of the specified filters. func (c *Client) ListOutposts(ctx context.Context, params *ListOutpostsInput, optFns ...func(*Options)) (*ListOutpostsOutput, error) { if params == nil { params = &ListOutpostsInput{} diff --git a/service/outposts/api_op_ListSites.go b/service/outposts/api_op_ListSites.go index 149afd18581..449d97fefea 100644 --- a/service/outposts/api_op_ListSites.go +++ b/service/outposts/api_op_ListSites.go @@ -12,12 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Create a list of the Outpost sites for your Amazon Web Services account. Add -// operating address filters to your request to return a more specific list of -// results. Use filters to match site city, country code, or state/region of the -// operating address. If you specify multiple filters, the filters are joined with -// an AND, and the request returns only results that match all of the specified -// filters. +// Lists the Outpost sites for your Amazon Web Services account. Add operating +// address filters to your request to return a more specific list of results. Use +// filters to match site city, country code, or state/region of the operating +// address. If you specify multiple filters, the filters are joined with an AND, +// and the request returns only results that match all of the specified filters. func (c *Client) ListSites(ctx context.Context, params *ListSitesInput, optFns ...func(*Options)) (*ListSitesOutput, error) { if params == nil { params = &ListSitesInput{} diff --git a/service/outposts/deserializers.go b/service/outposts/deserializers.go index 0c4f2b19ef9..177e7ebe464 100644 --- a/service/outposts/deserializers.go +++ b/service/outposts/deserializers.go @@ -1763,6 +1763,171 @@ func awsRestjson1_deserializeOpDocumentGetSiteAddressOutput(v **GetSiteAddressOu return nil } +type awsRestjson1_deserializeOpListAssets struct { +} + +func (*awsRestjson1_deserializeOpListAssets) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAssets) 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_deserializeOpErrorListAssets(response, &metadata) + } + output := &ListAssetsOutput{} + 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_deserializeOpDocumentListAssetsOutput(&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_deserializeOpErrorListAssets(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("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, 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 *ListAssetsOutput + if *v == nil { + sv = &ListAssetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Assets": + if err := awsRestjson1_deserializeDocumentAssetListDefinition(&sv.Assets, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListCatalogItems struct { } @@ -3776,6 +3941,103 @@ func awsRestjson1_deserializeDocumentAddress(v **types.Address, value interface{ return nil } +func awsRestjson1_deserializeDocumentAssetInfo(v **types.AssetInfo, 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.AssetInfo + if *v == nil { + sv = &types.AssetInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetId to be of type string, got %T instead", value) + } + sv.AssetId = ptr.String(jtv) + } + + case "AssetType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetType to be of type string, got %T instead", value) + } + sv.AssetType = types.AssetType(jtv) + } + + case "ComputeAttributes": + if err := awsRestjson1_deserializeDocumentComputeAttributes(&sv.ComputeAttributes, value); err != nil { + return err + } + + case "RackId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RackId to be of type string, got %T instead", value) + } + sv.RackId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetListDefinition(v *[]types.AssetInfo, 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.AssetInfo + if *v == nil { + cv = []types.AssetInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCatalogItem(v **types.CatalogItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3921,6 +4183,46 @@ func awsRestjson1_deserializeDocumentCatalogItemListDefinition(v *[]types.Catalo return nil } +func awsRestjson1_deserializeDocumentComputeAttributes(v **types.ComputeAttributes, 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.ComputeAttributes + if *v == nil { + sv = &types.ComputeAttributes{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HostId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HostId to be of type string, got %T instead", value) + } + sv.HostId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/outposts/generated.json b/service/outposts/generated.json index 529a4c3b513..f8067d96e6f 100644 --- a/service/outposts/generated.json +++ b/service/outposts/generated.json @@ -20,6 +20,7 @@ "api_op_GetOutpostInstanceTypes.go", "api_op_GetSite.go", "api_op_GetSiteAddress.go", + "api_op_ListAssets.go", "api_op_ListCatalogItems.go", "api_op_ListOrders.go", "api_op_ListOutposts.go", diff --git a/service/outposts/serializers.go b/service/outposts/serializers.go index 7a68bb24301..352186df8c9 100644 --- a/service/outposts/serializers.go +++ b/service/outposts/serializers.go @@ -839,6 +839,78 @@ func awsRestjson1_serializeOpHttpBindingsGetSiteAddressInput(v *GetSiteAddressIn return nil } +type awsRestjson1_serializeOpListAssets struct { +} + +func (*awsRestjson1_serializeOpListAssets) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAssets) 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.(*ListAssetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/outposts/{OutpostIdentifier}/assets") + 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_serializeOpHttpBindingsListAssetsInput(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_serializeOpHttpBindingsListAssetsInput(v *ListAssetsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.HostIdFilter != nil { + for i := range v.HostIdFilter { + encoder.AddQuery("HostIdFilter").String(v.HostIdFilter[i]) + } + } + + if v.MaxResults != nil { + encoder.SetQuery("MaxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.OutpostIdentifier == nil || len(*v.OutpostIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member OutpostIdentifier must not be empty")} + } + if v.OutpostIdentifier != nil { + if err := encoder.SetURI("OutpostIdentifier").String(*v.OutpostIdentifier); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListCatalogItems struct { } diff --git a/service/outposts/types/enums.go b/service/outposts/types/enums.go index 9769a60fdd9..621ed7e2978 100644 --- a/service/outposts/types/enums.go +++ b/service/outposts/types/enums.go @@ -20,6 +20,22 @@ func (AddressType) Values() []AddressType { } } +type AssetType string + +// Enum values for AssetType +const ( + AssetTypeCompute AssetType = "COMPUTE" +) + +// Values returns all known values for AssetType. 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 (AssetType) Values() []AssetType { + return []AssetType{ + "COMPUTE", + } +} + type CatalogItemClass string // Enum values for CatalogItemClass diff --git a/service/outposts/types/types.go b/service/outposts/types/types.go index a81c94d1d8a..01de2eb0a2b 100644 --- a/service/outposts/types/types.go +++ b/service/outposts/types/types.go @@ -56,6 +56,24 @@ type Address struct { noSmithyDocumentSerde } +// Information about hardware assets. +type AssetInfo struct { + + // The ID of the asset. + AssetId *string + + // The type of the asset. + AssetType AssetType + + // Information about compute hardware assets. + ComputeAttributes *ComputeAttributes + + // The rack ID of the asset. + RackId *string + + noSmithyDocumentSerde +} + // Information about a catalog item. type CatalogItem struct { @@ -83,6 +101,15 @@ type CatalogItem struct { noSmithyDocumentSerde } +// Information about compute hardware assets. +type ComputeAttributes struct { + + // The host ID of any Dedicated Hosts on the asset. + HostId *string + + noSmithyDocumentSerde +} + // Information about EC2 capacity. type EC2Capacity struct { diff --git a/service/outposts/validators.go b/service/outposts/validators.go index f770d2e7eff..ce9b687dd0f 100644 --- a/service/outposts/validators.go +++ b/service/outposts/validators.go @@ -250,6 +250,26 @@ func (m *validateOpGetSite) HandleInitialize(ctx context.Context, in middleware. return next.HandleInitialize(ctx, in) } +type validateOpListAssets struct { +} + +func (*validateOpListAssets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAssets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAssetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAssetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -438,6 +458,10 @@ func addOpGetSiteValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSite{}, middleware.After) } +func addOpListAssetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAssets{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -695,6 +719,21 @@ func validateOpGetSiteInput(v *GetSiteInput) error { } } +func validateOpListAssetsInput(v *ListAssetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAssetsInput"} + if v.OutpostIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutpostIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil diff --git a/service/ram/internal/endpoints/endpoints.go b/service/ram/internal/endpoints/endpoints.go index 1db51b204ab..106f96c31e1 100644 --- a/service/ram/internal/endpoints/endpoints.go +++ b/service/ram/internal/endpoints/endpoints.go @@ -367,6 +367,11 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-us-gov", diff --git a/service/route53resolver/internal/endpoints/endpoints.go b/service/route53resolver/internal/endpoints/endpoints.go index b3e3aebfcbb..9999838b873 100644 --- a/service/route53resolver/internal/endpoints/endpoints.go +++ b/service/route53resolver/internal/endpoints/endpoints.go @@ -159,6 +159,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/synthetics/api_op_DeleteCanary.go b/service/synthetics/api_op_DeleteCanary.go index 01c877b2d86..ddacbe0fb7b 100644 --- a/service/synthetics/api_op_DeleteCanary.go +++ b/service/synthetics/api_op_DeleteCanary.go @@ -10,32 +10,31 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Permanently deletes the specified canary. When you delete a canary, resources -// used and created by the canary are not automatically deleted. After you delete a -// canary that you do not intend to use again, you should also delete the -// following: +// Permanently deletes the specified canary. If you specify DeleteLambda to true, +// CloudWatch Synthetics also deletes the Lambda functions and layers that are used +// by the canary. Other esources used and created by the canary are not +// automatically deleted. After you delete a canary that you do not intend to use +// again, you should also delete the following: // -// * The Lambda functions and layers used by this canary. These have -// the prefix cwsyn-MyCanaryName . +// * The CloudWatch alarms created +// for this canary. These alarms have a name of +// Synthetics-SharpDrop-Alarm-MyCanaryName . // -// * The CloudWatch alarms created for this -// canary. These alarms have a name of Synthetics-SharpDrop-Alarm-MyCanaryName . +// * Amazon S3 objects and buckets, such +// as the canary's artifact location. // -// * -// Amazon S3 objects and buckets, such as the canary's artifact location. +// * IAM roles created for the canary. If they +// were created in the console, these roles have the name +// role/service-role/CloudWatchSyntheticsRole-MyCanaryName . // -// * IAM -// roles created for the canary. If they were created in the console, these roles -// have the name role/service-role/CloudWatchSyntheticsRole-MyCanaryName . +// * CloudWatch Logs log +// groups created for the canary. These logs groups have the name +// /aws/lambda/cwsyn-MyCanaryName . // -// * -// CloudWatch Logs log groups created for the canary. These logs groups have the -// name /aws/lambda/cwsyn-MyCanaryName . -// -// Before you delete a canary, you might -// want to use GetCanary to display the information about this canary. Make note of -// the information returned by this operation so that you can delete these -// resources after you delete the canary. +// Before you delete a canary, you might want to +// use GetCanary to display the information about this canary. Make note of the +// information returned by this operation so that you can delete these resources +// after you delete the canary. func (c *Client) DeleteCanary(ctx context.Context, params *DeleteCanaryInput, optFns ...func(*Options)) (*DeleteCanaryOutput, error) { if params == nil { params = &DeleteCanaryInput{} @@ -60,6 +59,10 @@ type DeleteCanaryInput struct { // This member is required. Name *string + // Specifies whether to also delete the Lambda functions and layers used by this + // canary. The default is false. Type: Boolean + DeleteLambda bool + noSmithyDocumentSerde } diff --git a/service/synthetics/serializers.go b/service/synthetics/serializers.go index fe2b0c9c572..1cc76930ad4 100644 --- a/service/synthetics/serializers.go +++ b/service/synthetics/serializers.go @@ -195,6 +195,10 @@ func awsRestjson1_serializeOpHttpBindingsDeleteCanaryInput(v *DeleteCanaryInput, return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.DeleteLambda { + encoder.SetQuery("deleteLambda").Boolean(v.DeleteLambda) + } + if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } diff --git a/service/synthetics/types/enums.go b/service/synthetics/types/enums.go index 584fbeb5d7c..0fbd1d65a0c 100644 --- a/service/synthetics/types/enums.go +++ b/service/synthetics/types/enums.go @@ -76,7 +76,18 @@ type CanaryStateReasonCode string // Enum values for CanaryStateReasonCode const ( - CanaryStateReasonCodeInvalidPermissions CanaryStateReasonCode = "INVALID_PERMISSIONS" + CanaryStateReasonCodeInvalidPermissions CanaryStateReasonCode = "INVALID_PERMISSIONS" + CanaryStateReasonCodeCreatePending CanaryStateReasonCode = "CREATE_PENDING" + CanaryStateReasonCodeCreateInProgress CanaryStateReasonCode = "CREATE_IN_PROGRESS" + CanaryStateReasonCodeCreateFailed CanaryStateReasonCode = "CREATE_FAILED" + CanaryStateReasonCodeUpdatePending CanaryStateReasonCode = "UPDATE_PENDING" + CanaryStateReasonCodeUpdateInProgress CanaryStateReasonCode = "UPDATE_IN_PROGRESS" + CanaryStateReasonCodeUpdateComplete CanaryStateReasonCode = "UPDATE_COMPLETE" + CanaryStateReasonCodeRollbackComplete CanaryStateReasonCode = "ROLLBACK_COMPLETE" + CanaryStateReasonCodeRollbackFailed CanaryStateReasonCode = "ROLLBACK_FAILED" + CanaryStateReasonCodeDeleteInProgress CanaryStateReasonCode = "DELETE_IN_PROGRESS" + CanaryStateReasonCodeDeleteFailed CanaryStateReasonCode = "DELETE_FAILED" + CanaryStateReasonCodeSyncDeleteInProgress CanaryStateReasonCode = "SYNC_DELETE_IN_PROGRESS" ) // Values returns all known values for CanaryStateReasonCode. Note that this can be @@ -85,6 +96,17 @@ const ( func (CanaryStateReasonCode) Values() []CanaryStateReasonCode { return []CanaryStateReasonCode{ "INVALID_PERMISSIONS", + "CREATE_PENDING", + "CREATE_IN_PROGRESS", + "CREATE_FAILED", + "UPDATE_PENDING", + "UPDATE_IN_PROGRESS", + "UPDATE_COMPLETE", + "ROLLBACK_COMPLETE", + "ROLLBACK_FAILED", + "DELETE_IN_PROGRESS", + "DELETE_FAILED", + "SYNC_DELETE_IN_PROGRESS", } }