diff --git a/.changelog/3aabe388aee747c1967f12a8661216f4.json b/.changelog/3aabe388aee747c1967f12a8661216f4.json new file mode 100644 index 00000000000..df6fbeb4f0b --- /dev/null +++ b/.changelog/3aabe388aee747c1967f12a8661216f4.json @@ -0,0 +1,8 @@ +{ + "id": "3aabe388-aee7-47c1-967f-12a8661216f4", + "type": "feature", + "description": "Add support for customizing time zone for backup window in backup plan rules.", + "modules": [ + "service/backup" + ] +} \ No newline at end of file diff --git a/.changelog/6769be65b7c54288b67b2b5037ad36cc.json b/.changelog/6769be65b7c54288b67b2b5037ad36cc.json new file mode 100644 index 00000000000..f7a6e78b4ee --- /dev/null +++ b/.changelog/6769be65b7c54288b67b2b5037ad36cc.json @@ -0,0 +1,8 @@ +{ + "id": "6769be65-b7c5-4288-b67b-2b5037ad36cc", + "type": "feature", + "description": "This release enables AWS Compute Optimizer to analyze and generate licensing optimization recommendations for sql server running on EC2 instances.", + "modules": [ + "service/computeoptimizer" + ] +} \ No newline at end of file diff --git a/.changelog/7d7d45794fe944ceb04e9b822531a5a9.json b/.changelog/7d7d45794fe944ceb04e9b822531a5a9.json new file mode 100644 index 00000000000..7dad1b950d9 --- /dev/null +++ b/.changelog/7d7d45794fe944ceb04e9b822531a5a9.json @@ -0,0 +1,8 @@ +{ + "id": "7d7d4579-4fe9-44ce-b04e-9b822531a5a9", + "type": "documentation", + "description": "Documentation updates for permissions and links.", + "modules": [ + "service/organizations" + ] +} \ No newline at end of file diff --git a/.changelog/872a1cad6c9344c1892d83dff75bb940.json b/.changelog/872a1cad6c9344c1892d83dff75bb940.json new file mode 100644 index 00000000000..ab4781cc94f --- /dev/null +++ b/.changelog/872a1cad6c9344c1892d83dff75bb940.json @@ -0,0 +1,8 @@ +{ + "id": "872a1cad-6c93-44c1-892d-83dff75bb940", + "type": "feature", + "description": "Service Quotas now supports viewing the applied quota value and requesting a quota increase for a specific resource in an AWS account.", + "modules": [ + "service/servicequotas" + ] +} \ No newline at end of file diff --git a/.changelog/d618e4098cb64fd98ff782f691f9069f.json b/.changelog/d618e4098cb64fd98ff782f691f9069f.json new file mode 100644 index 00000000000..1cebcb7a635 --- /dev/null +++ b/.changelog/d618e4098cb64fd98ff782f691f9069f.json @@ -0,0 +1,8 @@ +{ + "id": "d618e409-8cb6-4fd9-8ff7-82f691f9069f", + "type": "feature", + "description": "Remove incorrect regex enforcement on pagination tokens.", + "modules": [ + "service/securitylake" + ] +} \ No newline at end of file diff --git a/.changelog/ecc9d0f047fb4850b9e77941b131c5e5.json b/.changelog/ecc9d0f047fb4850b9e77941b131c5e5.json new file mode 100644 index 00000000000..4a304039acf --- /dev/null +++ b/.changelog/ecc9d0f047fb4850b9e77941b131c5e5.json @@ -0,0 +1,8 @@ +{ + "id": "ecc9d0f0-47fb-4850-b9e7-7941b131c5e5", + "type": "feature", + "description": "WorkSpaces Web now enables Admins to configure which cookies are synchronized from an end-user's local browser to the in-session browser. In conjunction with a browser extension, this feature enables enhanced Single-Sign On capability by reducing the number of times an end-user has to authenticate.", + "modules": [ + "service/workspacesweb" + ] +} \ No newline at end of file diff --git a/service/appmesh/internal/endpoints/endpoints.go b/service/appmesh/internal/endpoints/endpoints.go index 30e23b2a178..feba3f9ece6 100644 --- a/service/appmesh/internal/endpoints/endpoints.go +++ b/service/appmesh/internal/endpoints/endpoints.go @@ -304,6 +304,15 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "appmesh.eu-west-3.api.aws", }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "appmesh.il-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/backup/api_op_CreateLogicallyAirGappedBackupVault.go b/service/backup/api_op_CreateLogicallyAirGappedBackupVault.go index ca36bc2b9af..cab817447e2 100644 --- a/service/backup/api_op_CreateLogicallyAirGappedBackupVault.go +++ b/service/backup/api_op_CreateLogicallyAirGappedBackupVault.go @@ -17,8 +17,9 @@ import ( "time" ) -// This request creates a logical container where backups are stored. This request -// includes a name, optionally one or more resource tags, an encryption key, and a +// This request creates a logical container to where backups may be copied. This +// request includes a name, the Region, the maximum number of retention days, the +// minimum number of retention days, and optionally can include tags and a creator // request ID. Do not include sensitive data, such as passport numbers, in the name // of a backup vault. func (c *Client) CreateLogicallyAirGappedBackupVault(ctx context.Context, params *CreateLogicallyAirGappedBackupVaultInput, optFns ...func(*Options)) (*CreateLogicallyAirGappedBackupVaultOutput, error) { diff --git a/service/backup/deserializers.go b/service/backup/deserializers.go index 909f88c3d6f..441ee5b9f01 100644 --- a/service/backup/deserializers.go +++ b/service/backup/deserializers.go @@ -13591,6 +13591,15 @@ func awsRestjson1_deserializeDocumentBackupRule(v **types.BackupRule, value inte sv.ScheduleExpression = ptr.String(jtv) } + case "ScheduleExpressionTimezone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timezone to be of type string, got %T instead", value) + } + sv.ScheduleExpressionTimezone = ptr.String(jtv) + } + case "StartWindowMinutes": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/backup/serializers.go b/service/backup/serializers.go index 7dbd299aad7..7f61e71fe76 100644 --- a/service/backup/serializers.go +++ b/service/backup/serializers.go @@ -5900,6 +5900,11 @@ func awsRestjson1_serializeDocumentBackupRuleInput(v *types.BackupRuleInput, val ok.String(*v.ScheduleExpression) } + if v.ScheduleExpressionTimezone != nil { + ok := object.Key("ScheduleExpressionTimezone") + ok.String(*v.ScheduleExpressionTimezone) + } + if v.StartWindowMinutes != nil { ok := object.Key("StartWindowMinutes") ok.Long(*v.StartWindowMinutes) diff --git a/service/backup/types/types.go b/service/backup/types/types.go index 8a9d48027f1..f1b7ef36f61 100644 --- a/service/backup/types/types.go +++ b/service/backup/types/types.go @@ -311,6 +311,10 @@ type BackupRule struct { // table of examples, click the preceding link and scroll down the page. ScheduleExpression *string + // This is the timezone in which the schedule expression is set. By default, + // ScheduleExpressions are in UTC. You can modify this to a specified timezone. + ScheduleExpressionTimezone *string + // A value in minutes after a backup is scheduled before a job will be canceled if // it doesn't start successfully. This value is optional. If this value is // included, it must be at least 60 minutes to avoid errors. During the start @@ -376,6 +380,10 @@ type BackupRuleInput struct { // A CRON expression in UTC specifying when Backup initiates a backup job. ScheduleExpression *string + // This is the timezone in which the schedule expression is set. By default, + // ScheduleExpressions are in UTC. You can modify this to a specified timezone. + ScheduleExpressionTimezone *string + // A value in minutes after a backup is scheduled before a job will be canceled if // it doesn't start successfully. This value is optional. If this value is // included, it must be at least 60 minutes to avoid errors. This parameter has a @@ -873,8 +881,7 @@ type FrameworkControl struct { // The scope of a control. The control scope defines what the control will // evaluate. Three examples of control scopes are: a specific backup plan, all - // backup plans with a specific tag, or all backup plans. For more information, see - // ControlScope . + // backup plans with a specific tag, or all backup plans. ControlScope *ControlScope noSmithyDocumentSerde diff --git a/service/computeoptimizer/api_op_ExportLicenseRecommendations.go b/service/computeoptimizer/api_op_ExportLicenseRecommendations.go new file mode 100644 index 00000000000..8cb2c5f5053 --- /dev/null +++ b/service/computeoptimizer/api_op_ExportLicenseRecommendations.go @@ -0,0 +1,316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package computeoptimizer + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/computeoptimizer/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Export optimization recommendations for your licenses. Recommendations are +// exported in a comma-separated values (CSV) file, and its metadata in a +// JavaScript Object Notation (JSON) file, to an existing Amazon Simple Storage +// Service (Amazon S3) bucket that you specify. For more information, see +// Exporting Recommendations (https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html) +// in the Compute Optimizer User Guide. You can have only one license export job in +// progress per Amazon Web Services Region. +func (c *Client) ExportLicenseRecommendations(ctx context.Context, params *ExportLicenseRecommendationsInput, optFns ...func(*Options)) (*ExportLicenseRecommendationsOutput, error) { + if params == nil { + params = &ExportLicenseRecommendationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ExportLicenseRecommendations", params, optFns, c.addOperationExportLicenseRecommendationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ExportLicenseRecommendationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ExportLicenseRecommendationsInput struct { + + // Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name + // and key prefix for a recommendations export job. You must create the destination + // Amazon S3 bucket for your recommendations export before you create the export + // job. Compute Optimizer does not create the S3 bucket for you. After you create + // the S3 bucket, ensure that it has the required permission policy to allow + // Compute Optimizer to write the export file to it. If you plan to specify an + // object prefix when you create the export job, you must include the object prefix + // in the policy that you add to the S3 bucket. For more information, see Amazon + // S3 Bucket Policy for Compute Optimizer (https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html) + // in the Compute Optimizer User Guide. + // + // This member is required. + S3DestinationConfig *types.S3DestinationConfig + + // The IDs of the Amazon Web Services accounts for which to export license + // recommendations. If your account is the management account of an organization, + // use this parameter to specify the member account for which you want to export + // recommendations. This parameter can't be specified together with the include + // member accounts parameter. The parameters are mutually exclusive. If this + // parameter is omitted, recommendations for member accounts aren't included in the + // export. You can specify multiple account IDs per request. + AccountIds []string + + // The recommendations data to include in the export file. For more information + // about the fields that can be exported, see Exported files (https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html#exported-files) + // in the Compute Optimizer User Guide. + FieldsToExport []types.ExportableLicenseField + + // The format of the export file. A CSV file is the only export format currently + // supported. + FileFormat types.FileFormat + + // An array of objects to specify a filter that exports a more specific set of + // license recommendations. + Filters []types.LicenseRecommendationFilter + + // Indicates whether to include recommendations for resources in all member + // accounts of the organization if your account is the management account of an + // organization. The member accounts must also be opted in to Compute Optimizer, + // and trusted access for Compute Optimizer must be enabled in the organization + // account. For more information, see Compute Optimizer and Amazon Web Services + // Organizations trusted access (https://docs.aws.amazon.com/compute-optimizer/latest/ug/security-iam.html#trusted-service-access) + // in the Compute Optimizer User Guide. If this parameter is omitted, + // recommendations for member accounts of the organization aren't included in the + // export file . This parameter cannot be specified together with the account IDs + // parameter. The parameters are mutually exclusive. + IncludeMemberAccounts bool + + noSmithyDocumentSerde +} + +type ExportLicenseRecommendationsOutput struct { + + // The identification number of the export job. To view the status of an export + // job, use the DescribeRecommendationExportJobs action and specify the job ID. + JobId *string + + // Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name + // and object keys of a recommendations export file, and its associated metadata + // file. + S3Destination *types.S3Destination + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationExportLicenseRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpExportLicenseRecommendations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpExportLicenseRecommendations{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addExportLicenseRecommendationsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpExportLicenseRecommendationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportLicenseRecommendations(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opExportLicenseRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "compute-optimizer", + OperationName: "ExportLicenseRecommendations", + } +} + +type opExportLicenseRecommendationsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opExportLicenseRecommendationsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opExportLicenseRecommendationsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "compute-optimizer" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "compute-optimizer" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("compute-optimizer") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addExportLicenseRecommendationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opExportLicenseRecommendationsResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/computeoptimizer/api_op_GetLicenseRecommendations.go b/service/computeoptimizer/api_op_GetLicenseRecommendations.go new file mode 100644 index 00000000000..3aab581d4e0 --- /dev/null +++ b/service/computeoptimizer/api_op_GetLicenseRecommendations.go @@ -0,0 +1,285 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package computeoptimizer + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/computeoptimizer/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns license recommendations for Amazon EC2 instances that run on a specific +// license. Compute Optimizer generates recommendations for licenses that meet a +// specific set of requirements. For more information, see the Supported resources +// and requirements (https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html) +// in the Compute Optimizer User Guide. +func (c *Client) GetLicenseRecommendations(ctx context.Context, params *GetLicenseRecommendationsInput, optFns ...func(*Options)) (*GetLicenseRecommendationsOutput, error) { + if params == nil { + params = &GetLicenseRecommendationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLicenseRecommendations", params, optFns, c.addOperationGetLicenseRecommendationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLicenseRecommendationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetLicenseRecommendationsInput struct { + + // The ID of the Amazon Web Services account for which to return license + // recommendations. If your account is the management account of an organization, + // use this parameter to specify the member account for which you want to return + // license recommendations. Only one account ID can be specified per request. + AccountIds []string + + // An array of objects to specify a filter that returns a more specific list of + // license recommendations. + Filters []types.LicenseRecommendationFilter + + // The maximum number of license recommendations to return with a single request. + // To retrieve the remaining results, make another request with the returned + // nextToken value. + MaxResults *int32 + + // The token to advance to the next page of license recommendations. + NextToken *string + + // The ARN that identifies the Amazon EC2 instance. The following is the format of + // the ARN: arn:aws:ec2:region:aws_account_id:instance/instance-id + ResourceArns []string + + noSmithyDocumentSerde +} + +type GetLicenseRecommendationsOutput struct { + + // An array of objects that describe errors of the request. + Errors []types.GetRecommendationError + + // An array of objects that describe license recommendations. + LicenseRecommendations []types.LicenseRecommendation + + // The token to use to advance to the next page of license recommendations. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetLicenseRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetLicenseRecommendations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetLicenseRecommendations{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addGetLicenseRecommendationsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLicenseRecommendations(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetLicenseRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "compute-optimizer", + OperationName: "GetLicenseRecommendations", + } +} + +type opGetLicenseRecommendationsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetLicenseRecommendationsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetLicenseRecommendationsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "compute-optimizer" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "compute-optimizer" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("compute-optimizer") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetLicenseRecommendationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetLicenseRecommendationsResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/computeoptimizer/deserializers.go b/service/computeoptimizer/deserializers.go index 56496366a68..9c439f38fdf 100644 --- a/service/computeoptimizer/deserializers.go +++ b/service/computeoptimizer/deserializers.go @@ -945,6 +945,138 @@ func awsAwsjson10_deserializeOpErrorExportLambdaFunctionRecommendations(response } } +type awsAwsjson10_deserializeOpExportLicenseRecommendations struct { +} + +func (*awsAwsjson10_deserializeOpExportLicenseRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpExportLicenseRecommendations) 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, awsAwsjson10_deserializeOpErrorExportLicenseRecommendations(response, &metadata) + } + output := &ExportLicenseRecommendationsOutput{} + 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 = awsAwsjson10_deserializeOpDocumentExportLicenseRecommendationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorExportLicenseRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsAwsjson10_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("MissingAuthenticationToken", errorCode): + return awsAwsjson10_deserializeErrorMissingAuthenticationToken(response, errorBody) + + case strings.EqualFold("OptInRequiredException", errorCode): + return awsAwsjson10_deserializeErrorOptInRequiredException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson10_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpGetAutoScalingGroupRecommendations struct { } @@ -2253,6 +2385,138 @@ func awsAwsjson10_deserializeOpErrorGetLambdaFunctionRecommendations(response *s } } +type awsAwsjson10_deserializeOpGetLicenseRecommendations struct { +} + +func (*awsAwsjson10_deserializeOpGetLicenseRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetLicenseRecommendations) 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, awsAwsjson10_deserializeOpErrorGetLicenseRecommendations(response, &metadata) + } + output := &GetLicenseRecommendationsOutput{} + 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 = awsAwsjson10_deserializeOpDocumentGetLicenseRecommendationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorGetLicenseRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsAwsjson10_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("MissingAuthenticationToken", errorCode): + return awsAwsjson10_deserializeErrorMissingAuthenticationToken(response, errorBody) + + case strings.EqualFold("OptInRequiredException", errorCode): + return awsAwsjson10_deserializeErrorOptInRequiredException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson10_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpGetRecommendationPreferences struct { } @@ -6318,7 +6582,7 @@ func awsAwsjson10_deserializeDocumentLambdaFunctionUtilizationMetrics(v *[]types return nil } -func awsAwsjson10_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { +func awsAwsjson10_deserializeDocumentLicenseConfiguration(v **types.LicenseConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6331,20 +6595,431 @@ func awsAwsjson10_deserializeDocumentLimitExceededException(v **types.LimitExcee return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LimitExceededException + var sv *types.LicenseConfiguration if *v == nil { - sv = &types.LimitExceededException{} + sv = &types.LicenseConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "instanceType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "licenseEdition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseEdition to be of type string, got %T instead", value) + } + sv.LicenseEdition = types.LicenseEdition(jtv) + } + + case "licenseModel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseModel to be of type string, got %T instead", value) + } + sv.LicenseModel = types.LicenseModel(jtv) + } + + case "licenseName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseName to be of type string, got %T instead", value) + } + sv.LicenseName = types.LicenseName(jtv) + } + + case "licenseVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseVersion to be of type string, got %T instead", value) + } + sv.LicenseVersion = ptr.String(jtv) + } + + case "metricsSource": + if err := awsAwsjson10_deserializeDocumentMetricsSource(&sv.MetricsSource, value); err != nil { + return err + } + + case "numberOfCores": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NumberOfCores to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfCores = int32(i64) + } + + case "operatingSystem": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperatingSystem to be of type string, got %T instead", value) + } + sv.OperatingSystem = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentLicenseFindingReasonCodes(v *[]types.LicenseFindingReasonCode, 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.LicenseFindingReasonCode + if *v == nil { + cv = []types.LicenseFindingReasonCode{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LicenseFindingReasonCode + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseFindingReasonCode to be of type string, got %T instead", value) + } + col = types.LicenseFindingReasonCode(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentLicenseRecommendation(v **types.LicenseRecommendation, 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.LicenseRecommendation + if *v == nil { + sv = &types.LicenseRecommendation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "currentLicenseConfiguration": + if err := awsAwsjson10_deserializeDocumentLicenseConfiguration(&sv.CurrentLicenseConfiguration, value); err != nil { + return err + } + + case "finding": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseFinding to be of type string, got %T instead", value) + } + sv.Finding = types.LicenseFinding(jtv) + } + + case "findingReasonCodes": + if err := awsAwsjson10_deserializeDocumentLicenseFindingReasonCodes(&sv.FindingReasonCodes, value); err != nil { + return err + } + + case "lastRefreshTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastRefreshTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastRefreshTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "licenseRecommendationOptions": + if err := awsAwsjson10_deserializeDocumentLicenseRecommendationOptions(&sv.LicenseRecommendationOptions, value); err != nil { + return err + } + + case "lookbackPeriodInDays": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LookbackPeriodInDays = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.LookbackPeriodInDays = f64 + + default: + return fmt.Errorf("expected LookBackPeriodInDays to be a JSON Number, got %T instead", value) + + } + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "tags": + if err := awsAwsjson10_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentLicenseRecommendationOption(v **types.LicenseRecommendationOption, 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.LicenseRecommendationOption + if *v == nil { + sv = &types.LicenseRecommendationOption{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "licenseEdition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseEdition to be of type string, got %T instead", value) + } + sv.LicenseEdition = types.LicenseEdition(jtv) + } + + case "licenseModel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseModel to be of type string, got %T instead", value) + } + sv.LicenseModel = types.LicenseModel(jtv) + } + + case "operatingSystem": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperatingSystem to be of type string, got %T instead", value) + } + sv.OperatingSystem = ptr.String(jtv) + } + + case "rank": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Rank to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Rank = int32(i64) + } + + case "savingsOpportunity": + if err := awsAwsjson10_deserializeDocumentSavingsOpportunity(&sv.SavingsOpportunity, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentLicenseRecommendationOptions(v *[]types.LicenseRecommendationOption, 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.LicenseRecommendationOption + if *v == nil { + cv = []types.LicenseRecommendationOption{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LicenseRecommendationOption + destAddr := &col + if err := awsAwsjson10_deserializeDocumentLicenseRecommendationOption(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentLicenseRecommendations(v *[]types.LicenseRecommendation, 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.LicenseRecommendation + if *v == nil { + cv = []types.LicenseRecommendation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LicenseRecommendation + destAddr := &col + if err := awsAwsjson10_deserializeDocumentLicenseRecommendation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentLimitExceededException(v **types.LimitExceededException, 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.LimitExceededException + if *v == nil { + sv = &types.LimitExceededException{} + } 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) } @@ -6415,6 +7090,89 @@ func awsAwsjson10_deserializeDocumentMemorySizeConfiguration(v **types.MemorySiz return nil } +func awsAwsjson10_deserializeDocumentMetricSource(v **types.MetricSource, 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.MetricSource + if *v == nil { + sv = &types.MetricSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "provider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricSourceProvider to be of type string, got %T instead", value) + } + sv.Provider = types.MetricSourceProvider(jtv) + } + + case "providerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricProviderArn to be of type string, got %T instead", value) + } + sv.ProviderArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentMetricsSource(v *[]types.MetricSource, 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.MetricSource + if *v == nil { + cv = []types.MetricSource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MetricSource + destAddr := &col + if err := awsAwsjson10_deserializeDocumentMetricSource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentMetricValues(v *[]float64, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8811,6 +9569,51 @@ func awsAwsjson10_deserializeOpDocumentExportLambdaFunctionRecommendationsOutput return nil } +func awsAwsjson10_deserializeOpDocumentExportLicenseRecommendationsOutput(v **ExportLicenseRecommendationsOutput, 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 *ExportLicenseRecommendationsOutput + if *v == nil { + sv = &ExportLicenseRecommendationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "jobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobId to be of type string, got %T instead", value) + } + sv.JobId = ptr.String(jtv) + } + + case "s3Destination": + if err := awsAwsjson10_deserializeDocumentS3Destination(&sv.S3Destination, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentGetAutoScalingGroupRecommendationsOutput(v **GetAutoScalingGroupRecommendationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9305,6 +10108,56 @@ func awsAwsjson10_deserializeOpDocumentGetLambdaFunctionRecommendationsOutput(v return nil } +func awsAwsjson10_deserializeOpDocumentGetLicenseRecommendationsOutput(v **GetLicenseRecommendationsOutput, 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 *GetLicenseRecommendationsOutput + if *v == nil { + sv = &GetLicenseRecommendationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsAwsjson10_deserializeDocumentGetRecommendationErrors(&sv.Errors, value); err != nil { + return err + } + + case "licenseRecommendations": + if err := awsAwsjson10_deserializeDocumentLicenseRecommendations(&sv.LicenseRecommendations, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentGetRecommendationPreferencesOutput(v **GetRecommendationPreferencesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/computeoptimizer/generated.json b/service/computeoptimizer/generated.json index d35606c2d73..d5d8bb639af 100644 --- a/service/computeoptimizer/generated.json +++ b/service/computeoptimizer/generated.json @@ -16,6 +16,7 @@ "api_op_ExportEC2InstanceRecommendations.go", "api_op_ExportECSServiceRecommendations.go", "api_op_ExportLambdaFunctionRecommendations.go", + "api_op_ExportLicenseRecommendations.go", "api_op_GetAutoScalingGroupRecommendations.go", "api_op_GetEBSVolumeRecommendations.go", "api_op_GetEC2InstanceRecommendations.go", @@ -26,6 +27,7 @@ "api_op_GetEnrollmentStatus.go", "api_op_GetEnrollmentStatusesForOrganization.go", "api_op_GetLambdaFunctionRecommendations.go", + "api_op_GetLicenseRecommendations.go", "api_op_GetRecommendationPreferences.go", "api_op_GetRecommendationSummaries.go", "api_op_PutRecommendationPreferences.go", diff --git a/service/computeoptimizer/serializers.go b/service/computeoptimizer/serializers.go index deee2618165..008960aa6a3 100644 --- a/service/computeoptimizer/serializers.go +++ b/service/computeoptimizer/serializers.go @@ -401,6 +401,61 @@ func (m *awsAwsjson10_serializeOpExportLambdaFunctionRecommendations) HandleSeri return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpExportLicenseRecommendations struct { +} + +func (*awsAwsjson10_serializeOpExportLicenseRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpExportLicenseRecommendations) 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.(*ExportLicenseRecommendationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ComputeOptimizerService.ExportLicenseRecommendations") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentExportLicenseRecommendationsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpGetAutoScalingGroupRecommendations struct { } @@ -951,6 +1006,61 @@ func (m *awsAwsjson10_serializeOpGetLambdaFunctionRecommendations) HandleSeriali return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpGetLicenseRecommendations struct { +} + +func (*awsAwsjson10_serializeOpGetLicenseRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetLicenseRecommendations) 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.(*GetLicenseRecommendationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ComputeOptimizerService.GetLicenseRecommendations") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetLicenseRecommendationsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpGetRecommendationPreferences struct { } @@ -1343,6 +1453,17 @@ func awsAwsjson10_serializeDocumentExportableLambdaFunctionFields(v []types.Expo return nil } +func awsAwsjson10_serializeDocumentExportableLicenseFields(v []types.ExportableLicenseField, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsAwsjson10_serializeDocumentExportableVolumeFields(v []types.ExportableVolumeField, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1506,6 +1627,38 @@ func awsAwsjson10_serializeDocumentLambdaFunctionRecommendationFilters(v []types return nil } +func awsAwsjson10_serializeDocumentLicenseRecommendationFilter(v *types.LicenseRecommendationFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Name) > 0 { + ok := object.Key("name") + ok.String(string(v.Name)) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsAwsjson10_serializeDocumentFilterValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentLicenseRecommendationFilters(v []types.LicenseRecommendationFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentLicenseRecommendationFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson10_serializeDocumentRecommendationPreferenceNames(v []types.RecommendationPreferenceName, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1531,6 +1684,17 @@ func awsAwsjson10_serializeDocumentRecommendationPreferences(v *types.Recommenda return nil } +func awsAwsjson10_serializeDocumentResourceArns(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 awsAwsjson10_serializeDocumentS3DestinationConfig(v *types.S3DestinationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1883,6 +2047,51 @@ func awsAwsjson10_serializeOpDocumentExportLambdaFunctionRecommendationsInput(v return nil } +func awsAwsjson10_serializeOpDocumentExportLicenseRecommendationsInput(v *ExportLicenseRecommendationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("accountIds") + if err := awsAwsjson10_serializeDocumentAccountIds(v.AccountIds, ok); err != nil { + return err + } + } + + if v.FieldsToExport != nil { + ok := object.Key("fieldsToExport") + if err := awsAwsjson10_serializeDocumentExportableLicenseFields(v.FieldsToExport, ok); err != nil { + return err + } + } + + if len(v.FileFormat) > 0 { + ok := object.Key("fileFormat") + ok.String(string(v.FileFormat)) + } + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsAwsjson10_serializeDocumentLicenseRecommendationFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.IncludeMemberAccounts { + ok := object.Key("includeMemberAccounts") + ok.Boolean(v.IncludeMemberAccounts) + } + + if v.S3DestinationConfig != nil { + ok := object.Key("s3DestinationConfig") + if err := awsAwsjson10_serializeDocumentS3DestinationConfig(v.S3DestinationConfig, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentGetAutoScalingGroupRecommendationsInput(v *GetAutoScalingGroupRecommendationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2201,6 +2410,44 @@ func awsAwsjson10_serializeOpDocumentGetLambdaFunctionRecommendationsInput(v *Ge return nil } +func awsAwsjson10_serializeOpDocumentGetLicenseRecommendationsInput(v *GetLicenseRecommendationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("accountIds") + if err := awsAwsjson10_serializeDocumentAccountIds(v.AccountIds, ok); err != nil { + return err + } + } + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsAwsjson10_serializeDocumentLicenseRecommendationFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.ResourceArns != nil { + ok := object.Key("resourceArns") + if err := awsAwsjson10_serializeDocumentResourceArns(v.ResourceArns, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentGetRecommendationPreferencesInput(v *GetRecommendationPreferencesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/computeoptimizer/types/enums.go b/service/computeoptimizer/types/enums.go index fbd476f85b5..4f0d6f7a3f0 100644 --- a/service/computeoptimizer/types/enums.go +++ b/service/computeoptimizer/types/enums.go @@ -668,6 +668,62 @@ func (ExportableLambdaFunctionField) Values() []ExportableLambdaFunctionField { } } +type ExportableLicenseField string + +// Enum values for ExportableLicenseField +const ( + ExportableLicenseFieldAccountId ExportableLicenseField = "AccountId" + ExportableLicenseFieldResourceArn ExportableLicenseField = "ResourceArn" + ExportableLicenseFieldLookbackPeriodInDays ExportableLicenseField = "LookbackPeriodInDays" + ExportableLicenseFieldLastRefreshTimestamp ExportableLicenseField = "LastRefreshTimestamp" + ExportableLicenseFieldLicenseFinding ExportableLicenseField = "Finding" + ExportableLicenseFieldLicenseFindingReasonCodes ExportableLicenseField = "FindingReasonCodes" + ExportableLicenseFieldCurrentLicenseConfigurationNumberOfCores ExportableLicenseField = "CurrentLicenseConfigurationNumberOfCores" + ExportableLicenseFieldCurrentLicenseConfigurationInstanceType ExportableLicenseField = "CurrentLicenseConfigurationInstanceType" + ExportableLicenseFieldCurrentLicenseConfigurationOperatingSystem ExportableLicenseField = "CurrentLicenseConfigurationOperatingSystem" + ExportableLicenseFieldCurrentLicenseConfigurationLicenseName ExportableLicenseField = "CurrentLicenseConfigurationLicenseName" + ExportableLicenseFieldCurrentLicenseConfigurationLicenseEdition ExportableLicenseField = "CurrentLicenseConfigurationLicenseEdition" + ExportableLicenseFieldCurrentLicenseConfigurationLicenseModel ExportableLicenseField = "CurrentLicenseConfigurationLicenseModel" + ExportableLicenseFieldCurrentLicenseConfigurationLicenseVersion ExportableLicenseField = "CurrentLicenseConfigurationLicenseVersion" + ExportableLicenseFieldCurrentLicenseConfigurationMetricsSource ExportableLicenseField = "CurrentLicenseConfigurationMetricsSource" + ExportableLicenseFieldRecommendationOptionsOperatingSystem ExportableLicenseField = "RecommendationOptionsOperatingSystem" + ExportableLicenseFieldRecommendationOptionsLicenseEdition ExportableLicenseField = "RecommendationOptionsLicenseEdition" + ExportableLicenseFieldRecommendationOptionsLicenseModel ExportableLicenseField = "RecommendationOptionsLicenseModel" + ExportableLicenseFieldRecommendationOptionsSavingsOpportunityPercentage ExportableLicenseField = "RecommendationOptionsSavingsOpportunityPercentage" + ExportableLicenseFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableLicenseField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" + ExportableLicenseFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableLicenseField = "RecommendationOptionsEstimatedMonthlySavingsValue" + ExportableLicenseFieldTags ExportableLicenseField = "Tags" +) + +// Values returns all known values for ExportableLicenseField. 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 (ExportableLicenseField) Values() []ExportableLicenseField { + return []ExportableLicenseField{ + "AccountId", + "ResourceArn", + "LookbackPeriodInDays", + "LastRefreshTimestamp", + "Finding", + "FindingReasonCodes", + "CurrentLicenseConfigurationNumberOfCores", + "CurrentLicenseConfigurationInstanceType", + "CurrentLicenseConfigurationOperatingSystem", + "CurrentLicenseConfigurationLicenseName", + "CurrentLicenseConfigurationLicenseEdition", + "CurrentLicenseConfigurationLicenseModel", + "CurrentLicenseConfigurationLicenseVersion", + "CurrentLicenseConfigurationMetricsSource", + "RecommendationOptionsOperatingSystem", + "RecommendationOptionsLicenseEdition", + "RecommendationOptionsLicenseModel", + "RecommendationOptionsSavingsOpportunityPercentage", + "RecommendationOptionsEstimatedMonthlySavingsCurrency", + "RecommendationOptionsEstimatedMonthlySavingsValue", + "Tags", + } +} + type ExportableVolumeField string // Enum values for ExportableVolumeField @@ -1178,6 +1234,125 @@ func (LambdaFunctionRecommendationFindingReasonCode) Values() []LambdaFunctionRe } } +type LicenseEdition string + +// Enum values for LicenseEdition +const ( + LicenseEditionEnterprise LicenseEdition = "Enterprise" + LicenseEditionStandard LicenseEdition = "Standard" + LicenseEditionFree LicenseEdition = "Free" + LicenseEditionNoLicenseEditionFound LicenseEdition = "NoLicenseEditionFound" +) + +// Values returns all known values for LicenseEdition. 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 (LicenseEdition) Values() []LicenseEdition { + return []LicenseEdition{ + "Enterprise", + "Standard", + "Free", + "NoLicenseEditionFound", + } +} + +type LicenseFinding string + +// Enum values for LicenseFinding +const ( + LicenseFindingInsufficientMetrics LicenseFinding = "InsufficientMetrics" + LicenseFindingOptimized LicenseFinding = "Optimized" + LicenseFindingNotOptimized LicenseFinding = "NotOptimized" +) + +// Values returns all known values for LicenseFinding. 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 (LicenseFinding) Values() []LicenseFinding { + return []LicenseFinding{ + "InsufficientMetrics", + "Optimized", + "NotOptimized", + } +} + +type LicenseFindingReasonCode string + +// Enum values for LicenseFindingReasonCode +const ( + LicenseFindingReasonCodeCwAppInsightsDisabled LicenseFindingReasonCode = "InvalidCloudWatchApplicationInsightsSetup" + LicenseFindingReasonCodeCwAppInsightsError LicenseFindingReasonCode = "CloudWatchApplicationInsightsError" + LicenseFindingReasonCodeLicenseOverProvisioned LicenseFindingReasonCode = "LicenseOverprovisioned" + LicenseFindingReasonCodeOptimized LicenseFindingReasonCode = "Optimized" +) + +// Values returns all known values for LicenseFindingReasonCode. 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 (LicenseFindingReasonCode) Values() []LicenseFindingReasonCode { + return []LicenseFindingReasonCode{ + "InvalidCloudWatchApplicationInsightsSetup", + "CloudWatchApplicationInsightsError", + "LicenseOverprovisioned", + "Optimized", + } +} + +type LicenseModel string + +// Enum values for LicenseModel +const ( + LicenseModelLicenseIncluded LicenseModel = "LicenseIncluded" + LicenseModelBringYourOwnLicense LicenseModel = "BringYourOwnLicense" +) + +// Values returns all known values for LicenseModel. 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 (LicenseModel) Values() []LicenseModel { + return []LicenseModel{ + "LicenseIncluded", + "BringYourOwnLicense", + } +} + +type LicenseName string + +// Enum values for LicenseName +const ( + LicenseNameSqlserver LicenseName = "SQLServer" +) + +// Values returns all known values for LicenseName. 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 (LicenseName) Values() []LicenseName { + return []LicenseName{ + "SQLServer", + } +} + +type LicenseRecommendationFilterName string + +// Enum values for LicenseRecommendationFilterName +const ( + LicenseRecommendationFilterNameLicenseFinding LicenseRecommendationFilterName = "Finding" + LicenseRecommendationFilterNameLicenseFindingReasonCode LicenseRecommendationFilterName = "FindingReasonCode" + LicenseRecommendationFilterNameLicenseName LicenseRecommendationFilterName = "LicenseName" +) + +// Values returns all known values for LicenseRecommendationFilterName. 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 (LicenseRecommendationFilterName) Values() []LicenseRecommendationFilterName { + return []LicenseRecommendationFilterName{ + "Finding", + "FindingReasonCode", + "LicenseName", + } +} + type MetricName string // Enum values for MetricName @@ -1220,6 +1395,22 @@ func (MetricName) Values() []MetricName { } } +type MetricSourceProvider string + +// Enum values for MetricSourceProvider +const ( + MetricSourceProviderCloudWatchAppInsights MetricSourceProvider = "CloudWatchApplicationInsights" +) + +// Values returns all known values for MetricSourceProvider. 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 (MetricSourceProvider) Values() []MetricSourceProvider { + return []MetricSourceProvider{ + "CloudWatchApplicationInsights", + } +} + type MetricStatistic string // Enum values for MetricStatistic @@ -1316,6 +1507,7 @@ const ( RecommendationSourceTypeEbsVolume RecommendationSourceType = "EbsVolume" RecommendationSourceTypeLambdaFunction RecommendationSourceType = "LambdaFunction" RecommendationSourceTypeEcsService RecommendationSourceType = "EcsService" + RecommendationSourceTypeLicense RecommendationSourceType = "License" ) // Values returns all known values for RecommendationSourceType. Note that this @@ -1328,6 +1520,7 @@ func (RecommendationSourceType) Values() []RecommendationSourceType { "EbsVolume", "LambdaFunction", "EcsService", + "License", } } @@ -1341,6 +1534,7 @@ const ( ResourceTypeLambdaFunction ResourceType = "LambdaFunction" ResourceTypeNotApplicable ResourceType = "NotApplicable" ResourceTypeEcsService ResourceType = "EcsService" + ResourceTypeLicense ResourceType = "License" ) // Values returns all known values for ResourceType. Note that this can be @@ -1354,6 +1548,7 @@ func (ResourceType) Values() []ResourceType { "LambdaFunction", "NotApplicable", "EcsService", + "License", } } diff --git a/service/computeoptimizer/types/types.go b/service/computeoptimizer/types/types.go index d86adb7bb13..e72a7d75d2c 100644 --- a/service/computeoptimizer/types/types.go +++ b/service/computeoptimizer/types/types.go @@ -1272,6 +1272,156 @@ type LambdaFunctionUtilizationMetric struct { noSmithyDocumentSerde } +// Describes the configuration of a license for an Amazon EC2 instance. +type LicenseConfiguration struct { + + // The instance type used in the license. + InstanceType *string + + // The edition of the license for the application that runs on the instance. + LicenseEdition LicenseEdition + + // The license type associated with the instance. + LicenseModel LicenseModel + + // The name of the license for the application that runs on the instance. + LicenseName LicenseName + + // The version of the license for the application that runs on the instance. + LicenseVersion *string + + // The list of metric sources required to generate recommendations for commercial + // software licenses. + MetricsSource []MetricSource + + // The current number of cores associated with the instance. + NumberOfCores int32 + + // The operating system of the instance. + OperatingSystem *string + + noSmithyDocumentSerde +} + +// Describes a license recommendation for an EC2 instance. +type LicenseRecommendation struct { + + // The Amazon Web Services account ID of the license. + AccountId *string + + // An object that describes the current configuration of an instance that runs on + // a license. + CurrentLicenseConfiguration *LicenseConfiguration + + // The finding classification for an instance that runs on a license. Findings + // include: + // - InsufficentMetrics — When Compute Optimizer detects that your CloudWatch + // Application Insights isn't enabled or is enabled with insufficient permissions. + // - NotOptimized — When Compute Optimizer detects that your EC2 infrastructure + // isn't using any of the SQL server license features you're paying for, a license + // is considered not optimized. + // - Optimized — When Compute Optimizer detects that all specifications of your + // license meet the performance requirements of your workload. + Finding LicenseFinding + + // The reason for the finding classification for an instance that runs on a + // license. Finding reason codes include: + // - Optimized — All specifications of your license meet the performance + // requirements of your workload. + // - LicenseOverprovisioned — A license is considered over-provisioned when your + // license can be downgraded while still meeting the performance requirements of + // your workload. + // - InvalidCloudwatchApplicationInsights — CloudWatch Application Insights isn't + // configured properly. + // - CloudwatchApplicationInsightsError — There is a CloudWatch Application + // Insights error. + FindingReasonCodes []LicenseFindingReasonCode + + // The timestamp of when the license recommendation was last generated. + LastRefreshTimestamp *time.Time + + // An array of objects that describe the license recommendation options. + LicenseRecommendationOptions []LicenseRecommendationOption + + // The number of days for which utilization metrics were analyzed for an instance + // that runs on a license. + LookbackPeriodInDays float64 + + // The ARN that identifies the Amazon EC2 instance. + ResourceArn *string + + // A list of tags assigned to an EC2 instance. + Tags []Tag + + noSmithyDocumentSerde +} + +// Describes a filter that returns a more specific list of license +// recommendations. Use this filter with the GetLicenseRecommendation action. +type LicenseRecommendationFilter struct { + + // The name of the filter. Specify Finding to return recommendations with a + // specific finding classification. Specify FindingReasonCode to return + // recommendations with a specific finding reason code. You can filter your license + // recommendations by tag:key and tag-key tags. A tag:key is a key and value + // combination of a tag assigned to your license recommendations. Use the tag key + // in the filter name and the tag value as the filter value. For example, to find + // all license recommendations that have a tag with the key of Owner and the value + // of TeamA , specify tag:Owner for the filter name and TeamA for the filter + // value. A tag-key is the key of a tag assigned to your license recommendations. + // Use this filter to find all of your license recommendations that have a tag with + // a specific key. This doesn’t consider the tag value. For example, you can find + // your license recommendations with a tag key value of Owner or without any tag + // keys assigned. + Name LicenseRecommendationFilterName + + // The value of the filter. The valid values for this parameter are as follows, + // depending on what you specify for the name parameter: + // - If you specify the name parameter as Finding , then specify Optimized , + // NotOptimized , or InsufficentMetrics . + // - If you specify the name parameter as FindingReasonCode , then specify + // Optimized , LicenseOverprovisioned , InvalidCloudwatchApplicationInsights , or + // CloudwatchApplicationInsightsError . + Values []string + + noSmithyDocumentSerde +} + +// Describes the recommendation options for licenses. +type LicenseRecommendationOption struct { + + // The recommended edition of the license for the application that runs on the + // instance. + LicenseEdition LicenseEdition + + // The recommended license type associated with the instance. + LicenseModel LicenseModel + + // The operating system of a license recommendation option. + OperatingSystem *string + + // The rank of the license recommendation option. The top recommendation option is + // ranked as 1 . + Rank int32 + + // Describes the savings opportunity for recommendations of a given resource type + // or for the recommendation option of an individual resource. Savings opportunity + // represents the estimated monthly savings you can achieve by implementing a given + // Compute Optimizer recommendation. Savings opportunity data requires that you opt + // in to Cost Explorer, as well as activate Receive Amazon EC2 resource + // recommendations in the Cost Explorer preferences page. That creates a connection + // between Cost Explorer and Compute Optimizer. With this connection, Cost Explorer + // generates savings estimates considering the price of existing resources, the + // price of recommended resources, and historical usage data. Estimated monthly + // savings reflects the projected dollar savings associated with each of the + // recommendations generated. For more information, see Enabling Cost Explorer (https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html) + // and Optimizing your cost with Rightsizing Recommendations (https://docs.aws.amazon.com/cost-management/latest/userguide/ce-rightsizing.html) + // in the Cost Management User Guide. + SavingsOpportunity *SavingsOpportunity + + noSmithyDocumentSerde +} + // The memory size configurations of a container. type MemorySizeConfiguration struct { @@ -1284,6 +1434,19 @@ type MemorySizeConfiguration struct { noSmithyDocumentSerde } +// The list of metric sources required to generate recommendations for commercial +// software licenses. +type MetricSource struct { + + // The name of the metric source provider. + Provider MetricSourceProvider + + // The ARN of the metric source provider. + ProviderArn *string + + noSmithyDocumentSerde +} + // Describes a projected utilization metric of a recommendation option, such as an // Amazon EC2 instance. This represents the projected utilization of a // recommendation option had you used that resource during the analyzed period. diff --git a/service/computeoptimizer/validators.go b/service/computeoptimizer/validators.go index 4d5d5f73cee..5a514c0815d 100644 --- a/service/computeoptimizer/validators.go +++ b/service/computeoptimizer/validators.go @@ -129,6 +129,26 @@ func (m *validateOpExportLambdaFunctionRecommendations) HandleInitialize(ctx con return next.HandleInitialize(ctx, in) } +type validateOpExportLicenseRecommendations struct { +} + +func (*validateOpExportLicenseRecommendations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpExportLicenseRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ExportLicenseRecommendationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpExportLicenseRecommendationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetEC2RecommendationProjectedMetrics struct { } @@ -273,6 +293,10 @@ func addOpExportLambdaFunctionRecommendationsValidationMiddleware(stack *middlew return stack.Initialize.Add(&validateOpExportLambdaFunctionRecommendations{}, middleware.After) } +func addOpExportLicenseRecommendationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpExportLicenseRecommendations{}, middleware.After) +} + func addOpGetEC2RecommendationProjectedMetricsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEC2RecommendationProjectedMetrics{}, middleware.After) } @@ -390,6 +414,21 @@ func validateOpExportLambdaFunctionRecommendationsInput(v *ExportLambdaFunctionR } } +func validateOpExportLicenseRecommendationsInput(v *ExportLicenseRecommendationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExportLicenseRecommendationsInput"} + if v.S3DestinationConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3DestinationConfig")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetEC2RecommendationProjectedMetricsInput(v *GetEC2RecommendationProjectedMetricsInput) error { if v == nil { return nil diff --git a/service/detective/internal/endpoints/endpoints.go b/service/detective/internal/endpoints/endpoints.go index a378862cc8a..df5be0ed53f 100644 --- a/service/detective/internal/endpoints/endpoints.go +++ b/service/detective/internal/endpoints/endpoints.go @@ -181,6 +181,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/organizations/api_op_AcceptHandshake.go b/service/organizations/api_op_AcceptHandshake.go index 9a4dee62d81..65b09ff51b3 100644 --- a/service/organizations/api_op_AcceptHandshake.go +++ b/service/organizations/api_op_AcceptHandshake.go @@ -25,7 +25,7 @@ import ( // all features in the organization, the user must also have the // iam:CreateServiceLinkedRole permission so that Organizations can create the // required service-linked role named AWSServiceRoleForOrganizations . For more -// information, see Organizations and Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integration_services.html#orgs_integration_service-linked-roles) +// information, see Organizations and service-linked roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integration_services.html#orgs_integrate_services-using_slrs) // in the Organizations User Guide. // - Enable all features final confirmation handshake: only a principal from the // management account. For more information about invitations, see Inviting an diff --git a/service/organizations/api_op_AttachPolicy.go b/service/organizations/api_op_AttachPolicy.go index 851914d21b5..d664eaa7f9a 100644 --- a/service/organizations/api_op_AttachPolicy.go +++ b/service/organizations/api_op_AttachPolicy.go @@ -23,7 +23,9 @@ import ( // - SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) // - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) // -// This operation can be called only from the organization's management account. +// This operation can be called only from the organization's management account or +// by a member account that is a delegated administrator for an Amazon Web Services +// service. func (c *Client) AttachPolicy(ctx context.Context, params *AttachPolicyInput, optFns ...func(*Options)) (*AttachPolicyOutput, error) { if params == nil { params = &AttachPolicyInput{} diff --git a/service/organizations/api_op_CloseAccount.go b/service/organizations/api_op_CloseAccount.go index c2414b07c12..19b6e3e36d0 100644 --- a/service/organizations/api_op_CloseAccount.go +++ b/service/organizations/api_op_CloseAccount.go @@ -37,8 +37,9 @@ import ( // - You can close only 10% of member accounts, between 10 and 200, within a // rolling 30 day period. This quota is not bound by a calendar month, but starts // when you close an account. After you reach this limit, you can close additional -// accounts in the Billing console. For more information, see Closing an account (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/close-account.html) -// in the Amazon Web Services Billing and Cost Management User Guide. +// accounts. For more information, see Closing a member account in your +// organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) +// in the Organizations User Guide. // // - To reinstate a closed account, contact Amazon Web Services Support within // the 90-day grace period while the account is in SUSPENDED status. @@ -48,10 +49,6 @@ import ( // 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_CreateAccount.go b/service/organizations/api_op_CreateAccount.go index e48f5bc9a25..f8dd451770d 100644 --- a/service/organizations/api_op_CreateAccount.go +++ b/service/organizations/api_op_CreateAccount.go @@ -35,7 +35,7 @@ import ( // organizations:CreateAccount permission. If you enabled all features in the // organization, Organizations creates the required service-linked role named // AWSServiceRoleForOrganizations . For more information, see Organizations and -// Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs) +// service-linked roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs) // in the Organizations User Guide. If the request includes tags, then the // requester must have the organizations:TagResource permission. Organizations // preconfigures the new member account with a role (named @@ -44,16 +44,16 @@ import ( // management account can assume the role. Organizations clones the company name // and address information for the new account from the organization's management // account. This operation can be called only from the organization's management -// account. For more information about creating accounts, see Creating an Amazon -// Web Services account in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) +// account. For more information about creating accounts, see Creating a member +// account in your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) // in the Organizations User Guide. // - When you create an account in an organization using the Organizations // console, API, or CLI commands, the information required for the account to // operate as a standalone account, such as a payment method and signing the end // user license agreement (EULA) is not automatically collected. If you must remove // an account from your organization later, you can do so only after you provide -// the missing information. Follow the steps at To leave an organization as a -// member account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// the missing information. For more information, see Considerations before +// removing an account from an organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html) // in the Organizations User Guide. // - If you get an exception that indicates that you exceeded your account // limits for the organization, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) @@ -65,7 +65,8 @@ import ( // - Using CreateAccount to create multiple temporary accounts isn't recommended. // You can only close an account from the Billing and Cost Management console, and // you must be signed in as the root user. For information on the requirements and -// process for closing an account, see Closing an Amazon Web Services account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) +// process for closing an account, see Closing a member account in your +// organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) // in the Organizations User Guide. // // When you create a member account with this operation, you can choose whether to @@ -73,8 +74,8 @@ import ( // switch enabled. If you enable it, IAM users and roles that have appropriate // permissions can view billing information for the account. If you disable it, // only the account root user can access billing information. For information about -// how to disable this switch for an account, see Granting Access to Your Billing -// Information and Tools (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html) +// how to disable this switch for an account, see Granting access to your billing +// information and tools (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/control-access-billing.html#grantaccess) // . func (c *Client) CreateAccount(ctx context.Context, params *CreateAccountInput, optFns ...func(*Options)) (*CreateAccountOutput, error) { if params == nil { @@ -122,7 +123,7 @@ type CreateAccountInput struct { // If set to ALLOW , the new account enables IAM users to access account billing // information if they have the required permissions. If set to DENY , only the // root user of the new account can access account billing information. For more - // information, see Activating Access to the Billing and Cost Management Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) + // information, see About IAM access to the Billing and Cost Management console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) // in the Amazon Web Services Billing and Cost Management User Guide. If you don't // specify this parameter, the value defaults to ALLOW , and IAM users and roles // with the required permissions can access billing information for the new @@ -136,10 +137,10 @@ type CreateAccountInput struct { // account. If you don't specify this parameter, the role name defaults to // OrganizationAccountAccessRole . For more information about how to use this role // to access the member account, see the following links: - // - Accessing and Administering the Member Accounts in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) + // - Creating the OrganizationAccountAccessRole in an invited member account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) // in the Organizations User Guide - // - Steps 2 and 3 in Tutorial: Delegate Access Across Amazon Web Services - // accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) + // - Steps 2 and 3 in IAM Tutorial: Delegate access across Amazon Web Services + // accounts using IAM roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) // in the IAM User Guide // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate // this parameter. The pattern can include uppercase letters, lowercase letters, @@ -166,7 +167,7 @@ type CreateAccountOutput struct { // CreateAccountStatus ID as a parameter to DescribeCreateAccountStatus to get // status about the progress of the request at later times. You can also check the // CloudTrail log for the CreateAccountResult event. For more information, see - // Monitoring the Activity in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_monitoring.html) + // Logging and monitoring in Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html) // in the Organizations User Guide. CreateAccountStatus *types.CreateAccountStatus diff --git a/service/organizations/api_op_CreateGovCloudAccount.go b/service/organizations/api_op_CreateGovCloudAccount.go index ceff1c3efd7..3dd68769d2e 100644 --- a/service/organizations/api_op_CreateGovCloudAccount.go +++ b/service/organizations/api_op_CreateGovCloudAccount.go @@ -29,7 +29,7 @@ import ( // // Organizations automatically creates the required service-linked role named // AWSServiceRoleForOrganizations . For more information, see Organizations and -// Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs) +// service-linked roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs) // in the Organizations User Guide. Amazon Web Services automatically enables // CloudTrail for Amazon Web Services GovCloud (US) accounts, but you should also // do the following: @@ -59,8 +59,8 @@ import ( // - Use the OperationId response element from this operation to provide as a // parameter to the DescribeCreateAccountStatus operation. // - Check the CloudTrail log for the CreateAccountResult event. For information -// on using CloudTrail with Organizations, see Monitoring the Activity in Your -// Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_monitoring.html) +// on using CloudTrail with Organizations, see Logging and monitoring in +// Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html) // in the Organizations User Guide. // // When you call the CreateGovCloudAccount action, you create two accounts: a @@ -78,16 +78,15 @@ import ( // information and to view a diagram that explains how account access works, see // Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) // in the Amazon Web Services GovCloud User Guide. For more information about -// creating accounts, see Creating an Amazon Web Services account in Your -// Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) +// creating accounts, see Creating a member account in your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) // in the Organizations User Guide. // - When you create an account in an organization using the Organizations // console, API, or CLI commands, the information required for the account to // operate as a standalone account is not automatically collected. This includes a // payment method and signing the end user license agreement (EULA). If you must // remove an account from your organization later, you can do so only after you -// provide the missing information. Follow the steps at To leave an organization -// as a member account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// provide the missing information. For more information, see Considerations +// before removing an account from an organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html) // in the Organizations User Guide. // - If you get an exception that indicates that you exceeded your account // limits for the organization, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) @@ -100,7 +99,7 @@ import ( // recommended. You can only close an account from the Amazon Web Services Billing // and Cost Management console, and you must be signed in as the root user. For // information on the requirements and process for closing an account, see -// Closing an Amazon Web Services account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) +// Closing a member account in your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) // in the Organizations User Guide. // // When you create a member account with this operation, you can choose whether to @@ -108,8 +107,8 @@ import ( // switch enabled. If you enable it, IAM users and roles that have appropriate // permissions can view billing information for the account. If you disable it, // only the account root user can access billing information. For information about -// how to disable this switch for an account, see Granting Access to Your Billing -// Information and Tools (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html) +// how to disable this switch for an account, see Granting access to your billing +// information and tools (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html) // . func (c *Client) CreateGovCloudAccount(ctx context.Context, params *CreateGovCloudAccountInput, optFns ...func(*Options)) (*CreateGovCloudAccountOutput, error) { if params == nil { @@ -162,8 +161,8 @@ type CreateGovCloudAccountInput struct { // If set to ALLOW , the new linked account in the commercial Region enables IAM // users to access account billing information if they have the required // permissions. If set to DENY , only the root user of the new account can access - // account billing information. For more information, see Activating Access to the - // Billing and Cost Management Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) + // account billing information. For more information, see About IAM access to the + // Billing and Cost Management console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) // in the Amazon Web Services Billing and Cost Management User Guide. If you don't // specify this parameter, the value defaults to ALLOW , and IAM users and roles // with the required permissions can access billing information for the new @@ -177,14 +176,15 @@ type CreateGovCloudAccountInput struct { // as permitted by the management account administrator. The role has administrator // permissions in the new member account. If you don't specify this parameter, the // role name defaults to OrganizationAccountAccessRole . For more information about - // how to use this role to access the member account, see Accessing and - // Administering the Member Accounts in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) - // in the Organizations User Guide and steps 2 and 3 in Tutorial: Delegate Access - // Across Amazon Web Services accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) - // in the IAM User Guide. The regex pattern (http://wikipedia.org/wiki/regex) that - // is used to validate this parameter. The pattern can include uppercase letters, - // lowercase letters, digits with no spaces, and any of the following characters: - // =,.@- + // how to use this role to access the member account, see the following links: + // - Creating the OrganizationAccountAccessRole in an invited member account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) + // in the Organizations User Guide + // - Steps 2 and 3 in IAM Tutorial: Delegate access across Amazon Web Services + // accounts using IAM roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) + // in the IAM User Guide + // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate + // this parameter. The pattern can include uppercase letters, lowercase letters, + // digits with no spaces, and any of the following characters: =,.@- RoleName *string // A list of tags that you want to attach to the newly created account. These tags diff --git a/service/organizations/api_op_CreateOrganization.go b/service/organizations/api_op_CreateOrganization.go index d0b5c1715e0..832a0c495ca 100644 --- a/service/organizations/api_op_CreateOrganization.go +++ b/service/organizations/api_op_CreateOrganization.go @@ -25,8 +25,8 @@ import ( // features enabled and service control policies automatically enabled in the root. // If you instead choose to create the organization supporting only the // consolidated billing features by setting the FeatureSet parameter to -// CONSOLIDATED_BILLING" , no policy types are enabled by default, and you can't -// use organization policies +// CONSOLIDATED_BILLING , no policy types are enabled by default and you can't use +// organization policies. func (c *Client) CreateOrganization(ctx context.Context, params *CreateOrganizationInput, optFns ...func(*Options)) (*CreateOrganizationOutput, error) { if params == nil { params = &CreateOrganizationInput{} diff --git a/service/organizations/api_op_CreateOrganizationalUnit.go b/service/organizations/api_op_CreateOrganizationalUnit.go index dd1518c2d7b..c296d119952 100644 --- a/service/organizations/api_op_CreateOrganizationalUnit.go +++ b/service/organizations/api_op_CreateOrganizationalUnit.go @@ -21,7 +21,7 @@ import ( // policies according to your business requirements. The number of levels deep that // you can nest OUs is dependent upon the policy types enabled for that root. For // service control policies, the limit is five. For more information about OUs, see -// Managing Organizational Units (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ous.html) +// Managing organizational units (OUs) (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ous.html) // in the Organizations User Guide. If the request includes tags, then the // requester must have the organizations:TagResource permission. This operation // can be called only from the organization's management account. diff --git a/service/organizations/api_op_CreatePolicy.go b/service/organizations/api_op_CreatePolicy.go index 6de89a90a2f..df6a2d58b6f 100644 --- a/service/organizations/api_op_CreatePolicy.go +++ b/service/organizations/api_op_CreatePolicy.go @@ -18,10 +18,11 @@ import ( // Creates a policy of a specified type that you can attach to a root, an // organizational unit (OU), or an individual Amazon Web Services account. For more -// information about policies and their use, see Managing Organization Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html) +// information about policies and their use, see Managing Organizations policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html) // . If the request includes tags, then the requester must have the // organizations:TagResource permission. This operation can be called only from the -// organization's management account. +// organization's management account or by a member account that is a delegated +// administrator for an Amazon Web Services service. func (c *Client) CreatePolicy(ctx context.Context, params *CreatePolicyInput, optFns ...func(*Options)) (*CreatePolicyOutput, error) { if params == nil { params = &CreatePolicyInput{} diff --git a/service/organizations/api_op_DeletePolicy.go b/service/organizations/api_op_DeletePolicy.go index 9b04ac5bff6..33e3d8f7206 100644 --- a/service/organizations/api_op_DeletePolicy.go +++ b/service/organizations/api_op_DeletePolicy.go @@ -18,7 +18,8 @@ import ( // Deletes the specified policy from your organization. Before you perform this // operation, you must first detach the policy from all organizational units (OUs), // roots, and accounts. This operation can be called only from the organization's -// management account. +// management account or by a member account that is a delegated administrator for +// an Amazon Web Services service. func (c *Client) DeletePolicy(ctx context.Context, params *DeletePolicyInput, optFns ...func(*Options)) (*DeletePolicyOutput, error) { if params == nil { params = &DeletePolicyInput{} diff --git a/service/organizations/api_op_DescribeEffectivePolicy.go b/service/organizations/api_op_DescribeEffectivePolicy.go index 9436e3c046d..a8e8b0fee49 100644 --- a/service/organizations/api_op_DescribeEffectivePolicy.go +++ b/service/organizations/api_op_DescribeEffectivePolicy.go @@ -21,10 +21,9 @@ import ( // specified type that the account inherits, plus any policy of that type that is // directly attached to the account. This operation applies only to policy types // other than service control policies (SCPs). For more information about policy -// inheritance, see How Policy Inheritance Works (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies-inheritance.html) -// in the Organizations User Guide. This operation can be called only from the -// organization's management account or by a member account that is a delegated -// administrator for an Amazon Web Services service. +// inheritance, see Understanding management policy inheritance (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inheritance_mgmt.html) +// in the Organizations User Guide. This operation can be called from any account +// in the organization. func (c *Client) DescribeEffectivePolicy(ctx context.Context, params *DescribeEffectivePolicyInput, optFns ...func(*Options)) (*DescribeEffectivePolicyOutput, error) { if params == nil { params = &DescribeEffectivePolicyInput{} diff --git a/service/organizations/api_op_DescribeResourcePolicy.go b/service/organizations/api_op_DescribeResourcePolicy.go index 9664120ad1d..23c7dd7d228 100644 --- a/service/organizations/api_op_DescribeResourcePolicy.go +++ b/service/organizations/api_op_DescribeResourcePolicy.go @@ -16,8 +16,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves information about a resource policy. You can only call this operation -// from the organization's management account or by a member account that is a +// Retrieves information about a resource policy. This operation can be called +// only from the organization's management account or by a member account that is a // delegated administrator for an Amazon Web Services service. func (c *Client) DescribeResourcePolicy(ctx context.Context, params *DescribeResourcePolicyInput, optFns ...func(*Options)) (*DescribeResourcePolicyOutput, error) { if params == nil { diff --git a/service/organizations/api_op_DetachPolicy.go b/service/organizations/api_op_DetachPolicy.go index bc759940b39..f3882a44114 100644 --- a/service/organizations/api_op_DetachPolicy.go +++ b/service/organizations/api_op_DetachPolicy.go @@ -27,7 +27,9 @@ import ( // attached, and specify "Effect": "Deny" in the second SCP to override the // "Effect": "Allow" in the FullAWSAccess policy (or any other attached SCP), // you're using the authorization strategy of a " deny list (https://docs.aws.amazon.com/organizations/latest/userguide/SCP_strategies.html#orgs_policies_denylist) -// ". This operation can be called only from the organization's management account. +// ". This operation can be called only from the organization's management account +// or by a member account that is a delegated administrator for an Amazon Web +// Services service. func (c *Client) DetachPolicy(ctx context.Context, params *DetachPolicyInput, optFns ...func(*Options)) (*DetachPolicyOutput, error) { if params == nil { params = &DetachPolicyInput{} diff --git a/service/organizations/api_op_DisableAWSServiceAccess.go b/service/organizations/api_op_DisableAWSServiceAccess.go index ac8a2d45741..bc0993e5675 100644 --- a/service/organizations/api_op_DisableAWSServiceAccess.go +++ b/service/organizations/api_op_DisableAWSServiceAccess.go @@ -56,8 +56,8 @@ import ( // perform the DisableAWSServiceAccess operation, the specified service can no // longer perform operations in your organization's accounts For more information // about integrating other services with Organizations, including the list of -// services that work with Organizations, see Integrating Organizations with Other -// Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) +// services that work with Organizations, see Using Organizations with other +// Amazon Web Services services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) // in the Organizations User Guide. This operation can be called only from the // organization's management account. func (c *Client) DisableAWSServiceAccess(ctx context.Context, params *DisableAWSServiceAccessInput, optFns ...func(*Options)) (*DisableAWSServiceAccessOutput, error) { diff --git a/service/organizations/api_op_DisablePolicyType.go b/service/organizations/api_op_DisablePolicyType.go index 5c30e608e0b..ff7ed96c392 100644 --- a/service/organizations/api_op_DisablePolicyType.go +++ b/service/organizations/api_op_DisablePolicyType.go @@ -27,8 +27,9 @@ import ( // are enabled for the organization. Amazon Web Services recommends that you first // use ListRoots to see the status of policy types for a specified root, and then // use this operation. This operation can be called only from the organization's -// management account. To view the status of available policy types in the -// organization, use DescribeOrganization . +// management account or by a member account that is a delegated administrator for +// an Amazon Web Services service. To view the status of available policy types in +// the organization, use DescribeOrganization . func (c *Client) DisablePolicyType(ctx context.Context, params *DisablePolicyTypeInput, optFns ...func(*Options)) (*DisablePolicyTypeOutput, error) { if params == nil { params = &DisablePolicyTypeInput{} diff --git a/service/organizations/api_op_EnableAWSServiceAccess.go b/service/organizations/api_op_EnableAWSServiceAccess.go index 5602a819e20..0427d5ead81 100644 --- a/service/organizations/api_op_EnableAWSServiceAccess.go +++ b/service/organizations/api_op_EnableAWSServiceAccess.go @@ -27,7 +27,7 @@ import ( // those resources in the organization's accounts depends on that service. For more // information, see the documentation for the other Amazon Web Services service. // For more information about enabling services to integrate with Organizations, -// see Integrating Organizations with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) +// see Using Organizations with other Amazon Web Services services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) // in the Organizations User Guide. You can only call this operation from the // organization's management account and only if the organization has enabled all // features (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) diff --git a/service/organizations/api_op_EnableAllFeatures.go b/service/organizations/api_op_EnableAllFeatures.go index 6bd8e4a47bf..5caf8a144a4 100644 --- a/service/organizations/api_op_EnableAllFeatures.go +++ b/service/organizations/api_op_EnableAllFeatures.go @@ -20,8 +20,8 @@ import ( // policies that can restrict the services and actions that can be called in each // account. Until you enable all features, you have access only to consolidated // billing, and you can't use any of the advanced account administration features -// that Organizations supports. For more information, see Enabling All Features in -// Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) +// that Organizations supports. For more information, see Enabling all features in +// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the Organizations User Guide. This operation is required only for // organizations that were created explicitly with only the consolidated billing // features enabled. Calling this operation sends a handshake to every invited diff --git a/service/organizations/api_op_EnablePolicyType.go b/service/organizations/api_op_EnablePolicyType.go index 5dda69e91ab..6bd8c25acf3 100644 --- a/service/organizations/api_op_EnablePolicyType.go +++ b/service/organizations/api_op_EnablePolicyType.go @@ -23,9 +23,10 @@ import ( // the background. Amazon Web Services recommends that you first use ListRoots to // see the status of policy types for a specified root, and then use this // operation. This operation can be called only from the organization's management -// account. You can enable a policy type in a root only if that policy type is -// available in the organization. To view the status of available policy types in -// the organization, use DescribeOrganization . +// account or by a member account that is a delegated administrator for an Amazon +// Web Services service. You can enable a policy type in a root only if that policy +// type is available in the organization. To view the status of available policy +// types in the organization, use DescribeOrganization . func (c *Client) EnablePolicyType(ctx context.Context, params *EnablePolicyTypeInput, optFns ...func(*Options)) (*EnablePolicyTypeOutput, error) { if params == nil { params = &EnablePolicyTypeInput{} diff --git a/service/organizations/api_op_InviteAccountToOrganization.go b/service/organizations/api_op_InviteAccountToOrganization.go index 5b3e7dfa1db..ede6efcf5c0 100644 --- a/service/organizations/api_op_InviteAccountToOrganization.go +++ b/service/organizations/api_op_InviteAccountToOrganization.go @@ -25,8 +25,8 @@ import ( // was created by Amazon Internet Services Pvt. Ltd (AISPL), an Amazon Web Services // seller in India, you can invite only other AISPL accounts to your organization. // You can't combine accounts from AISPL and Amazon Web Services or from any other -// Amazon Web Services seller. For more information, see Consolidated Billing in -// India (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/useconsolidatedbilliing-India.html) +// Amazon Web Services seller. For more information, see Consolidated billing in +// India (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/useconsolidatedbilling-India.html) // . // - If you receive an exception that indicates that you exceeded your account // limits for the organization or that the operation failed because your diff --git a/service/organizations/api_op_LeaveOrganization.go b/service/organizations/api_op_LeaveOrganization.go index 0730acaa40c..452bf03cb49 100644 --- a/service/organizations/api_op_LeaveOrganization.go +++ b/service/organizations/api_op_LeaveOrganization.go @@ -35,17 +35,17 @@ import ( // - Provide and verify the required contact information // - Provide a current payment method Amazon Web Services uses the payment // method to charge for any billable (not free tier) Amazon Web Services activity -// that occurs while the account isn't attached to an organization. Follow the -// steps at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// that occurs while the account isn't attached to an organization. For more +// information, see Considerations before removing an account from an +// organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html) // in the Organizations User Guide. // - The account that you want to leave must not be a delegated administrator // account for any Amazon Web Services service enabled for your organization. If // the account is a delegated administrator, you must first change the delegated // administrator account to another account that is remaining in the organization. // - You can leave an organization only after you enable IAM user access to -// billing in your account. For more information, see Activating Access to the -// Billing and Cost Management Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) +// billing in your account. For more information, see About IAM access to the +// Billing and Cost Management console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) // in the Amazon Web Services Billing and Cost Management User Guide. // - After the account leaves the organization, all tags that were attached to // the account object in the organization are deleted. Amazon Web Services accounts @@ -53,6 +53,9 @@ import ( // - A newly created account has a waiting period before it can be removed from // its organization. If you get an error that indicates that a wait period is // required, then try again in a few days. +// - If you are using an organization principal to call LeaveOrganization across +// multiple accounts, you can only do this up to 5 accounts per second in a single +// organization. func (c *Client) LeaveOrganization(ctx context.Context, params *LeaveOrganizationInput, optFns ...func(*Options)) (*LeaveOrganizationOutput, error) { if params == nil { params = &LeaveOrganizationInput{} diff --git a/service/organizations/api_op_ListAWSServiceAccessForOrganization.go b/service/organizations/api_op_ListAWSServiceAccessForOrganization.go index b418a3fc682..09d63d35031 100644 --- a/service/organizations/api_op_ListAWSServiceAccessForOrganization.go +++ b/service/organizations/api_op_ListAWSServiceAccessForOrganization.go @@ -21,8 +21,8 @@ import ( // resources that it requires for the integration, it can perform operations on // your organization and its accounts. For more information about integrating other // services with Organizations, including the list of services that currently work -// with Organizations, see Integrating Organizations with Other Amazon Web -// Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) +// with Organizations, see Using Organizations with other Amazon Web Services +// services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) // in the Organizations User Guide. This operation can be called only from the // organization's management account or by a member account that is a delegated // administrator for an Amazon Web Services service. diff --git a/service/organizations/api_op_PutResourcePolicy.go b/service/organizations/api_op_PutResourcePolicy.go index 0619c60ef23..66399b51691 100644 --- a/service/organizations/api_op_PutResourcePolicy.go +++ b/service/organizations/api_op_PutResourcePolicy.go @@ -37,7 +37,7 @@ type PutResourcePolicyInput struct { // If provided, the new content for the resource policy. The text must be // correctly formatted JSON that complies with the syntax for the resource policy's - // type. For more information, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) + // type. For more information, see SCP syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_syntax.html) // in the Organizations User Guide. // // This member is required. diff --git a/service/organizations/api_op_RemoveAccountFromOrganization.go b/service/organizations/api_op_RemoveAccountFromOrganization.go index c3c2b8157b0..f14d68df597 100644 --- a/service/organizations/api_op_RemoveAccountFromOrganization.go +++ b/service/organizations/api_op_RemoveAccountFromOrganization.go @@ -26,14 +26,8 @@ import ( // configured with the information required to operate as a standalone account. // When you create an account in an organization using the Organizations console, // API, or CLI commands, the information required of standalone accounts is not -// automatically collected. For an account that you want to make standalone, you -// must choose a support plan, provide and verify the required contact information, -// and provide a current payment method. Amazon Web Services uses the payment -// method to charge for any billable (not free tier) Amazon Web Services activity -// that occurs while the account isn't attached to an organization. To remove an -// account that doesn't yet have this information, you must sign in as the member -// account and follow the steps at To leave an organization when all required -// account information has not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// automatically collected. For more information, see Considerations before +// removing an account from an organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html) // in the Organizations User Guide. // - The account that you want to leave must not be a delegated administrator // account for any Amazon Web Services service enabled for your organization. If diff --git a/service/organizations/api_op_TagResource.go b/service/organizations/api_op_TagResource.go index 8ac6059624e..9a1fecc7b44 100644 --- a/service/organizations/api_op_TagResource.go +++ b/service/organizations/api_op_TagResource.go @@ -23,7 +23,9 @@ import ( // - Organizational unit (OU) // - Policy (any type) // -// This operation can be called only from the organization's management account. +// This operation can be called only from the organization's management account or +// by a member account that is a delegated administrator for an Amazon Web Services +// service. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} diff --git a/service/organizations/api_op_UntagResource.go b/service/organizations/api_op_UntagResource.go index 46e619a40e3..a8f173f462b 100644 --- a/service/organizations/api_op_UntagResource.go +++ b/service/organizations/api_op_UntagResource.go @@ -22,7 +22,9 @@ import ( // - Organizational unit (OU) // - Policy (any type) // -// This operation can be called only from the organization's management account. +// This operation can be called only from the organization's management account or +// by a member account that is a delegated administrator for an Amazon Web Services +// service. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} diff --git a/service/organizations/api_op_UpdatePolicy.go b/service/organizations/api_op_UpdatePolicy.go index 50333bf3a95..404934cbc24 100644 --- a/service/organizations/api_op_UpdatePolicy.go +++ b/service/organizations/api_op_UpdatePolicy.go @@ -19,7 +19,8 @@ import ( // Updates an existing policy with a new name, description, or content. If you // don't supply any parameter, that value remains unchanged. You can't change a // policy's type. This operation can be called only from the organization's -// management account. +// management account or by a member account that is a delegated administrator for +// an Amazon Web Services service. func (c *Client) UpdatePolicy(ctx context.Context, params *UpdatePolicyInput, optFns ...func(*Options)) (*UpdatePolicyOutput, error) { if params == nil { params = &UpdatePolicyInput{} @@ -47,7 +48,7 @@ type UpdatePolicyInput struct { // If provided, the new content for the policy. The text must be correctly // formatted JSON that complies with the syntax for the policy's type. For more - // information, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) + // information, see SCP syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_syntax.html) // in the Organizations User Guide. Content *string diff --git a/service/organizations/doc.go b/service/organizations/doc.go index f4a65d2c648..59bedab8822 100644 --- a/service/organizations/doc.go +++ b/service/organizations/doc.go @@ -37,7 +37,7 @@ // delivers log files to an Amazon S3 bucket. By using information collected by // CloudTrail, you can determine which requests the Organizations service received, // who made the request and when, and so on. For more about Organizations and its -// support for CloudTrail, see Logging Organizations Events with CloudTrail (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_incident-response.html#orgs_cloudtrail-integration) +// support for CloudTrail, see Logging Organizations API calls with CloudTrail (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_incident-response.html#orgs_cloudtrail-integration) // in the Organizations User Guide. To learn more about CloudTrail, including how // to turn it on and find your log files, see the CloudTrail User Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html) // . diff --git a/service/organizations/endpoints.go b/service/organizations/endpoints.go index b84e36a7e0a..ae6431159df 100644 --- a/service/organizations/endpoints.go +++ b/service/organizations/endpoints.go @@ -384,35 +384,9 @@ func (r *resolver) ResolveEndpoint( _PartitionResult := *exprVal _ = _PartitionResult if _PartitionResult.Name == "aws" { - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations-fips.") - out.WriteString(_Region) - out.WriteString(".api.aws") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - uriString := "https://organizations-fips.us-east-1.amazonaws.com" + if _UseFIPS == false { + if _UseDualStack == false { + uriString := "https://organizations.us-east-1.amazonaws.com" uri, err := url.Parse(uriString) if err != nil { @@ -435,17 +409,12 @@ func (r *resolver) ResolveEndpoint( }(), }, nil } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations.") - out.WriteString(_Region) - out.WriteString(".api.aws") - return out.String() - }() + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _UseDualStack == false { + uriString := "https://organizations-fips.us-east-1.amazonaws.com" uri, err := url.Parse(uriString) if err != nil { @@ -455,69 +424,25 @@ func (r *resolver) ResolveEndpoint( return smithyendpoints.Endpoint{ URI: *uri, Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("authSchemes", []interface{}{ + map[string]interface{}{ + "name": "sigv4", + "signingName": "organizations", + "signingRegion": "us-east-1", + }, + }) + return out + }(), }, nil } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := "https://organizations.us-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "name": "sigv4", - "signingName": "organizations", - "signingRegion": "us-east-1", - }, - }) - return out - }(), - }, nil } if _PartitionResult.Name == "aws-cn" { - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations-fips.") - out.WriteString(_Region) - out.WriteString(".api.amazonwebservices.com.cn") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations-fips.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com.cn") - return out.String() - }() + if _UseFIPS == false { + if _UseDualStack == false { + uriString := "https://organizations.cn-northwest-1.amazonaws.com.cn" uri, err := url.Parse(uriString) if err != nil { @@ -527,19 +452,25 @@ func (r *resolver) ResolveEndpoint( return smithyendpoints.Endpoint{ URI: *uri, Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("authSchemes", []interface{}{ + map[string]interface{}{ + "name": "sigv4", + "signingName": "organizations", + "signingRegion": "cn-northwest-1", + }, + }) + return out + }(), }, nil } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations.") - out.WriteString(_Region) - out.WriteString(".api.amazonwebservices.com.cn") - return out.String() - }() + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := "https://organizations.us-gov-west-1.amazonaws.com" uri, err := url.Parse(uriString) if err != nil { @@ -549,62 +480,24 @@ func (r *resolver) ResolveEndpoint( return smithyendpoints.Endpoint{ URI: *uri, Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("authSchemes", []interface{}{ + map[string]interface{}{ + "name": "sigv4", + "signingName": "organizations", + "signingRegion": "us-gov-west-1", + }, + }) + return out + }(), }, nil } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") } - uriString := "https://organizations.cn-northwest-1.amazonaws.com.cn" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "name": "sigv4", - "signingName": "organizations", - "signingRegion": "cn-northwest-1", - }, - }) - return out - }(), - }, nil } if _PartitionResult.Name == "aws-us-gov" { if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations-fips.") - out.WriteString(_Region) - out.WriteString(".api.aws") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _UseDualStack == false { uriString := "https://organizations.us-gov-west-1.amazonaws.com" uri, err := url.Parse(uriString) @@ -628,52 +521,7 @@ func (r *resolver) ResolveEndpoint( }(), }, nil } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations.") - out.WriteString(_Region) - out.WriteString(".api.aws") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := "https://organizations.us-gov-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "name": "sigv4", - "signingName": "organizations", - "signingRegion": "us-gov-west-1", - }, - }) - return out - }(), - }, nil } if _UseFIPS == true { if _UseDualStack == true { @@ -704,54 +552,6 @@ func (r *resolver) ResolveEndpoint( } if _UseFIPS == true { if true == _PartitionResult.SupportsFIPS { - if _Region == "aws-global" { - uriString := "https://organizations-fips.us-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "name": "sigv4", - "signingName": "organizations", - "signingRegion": "us-east-1", - }, - }) - return out - }(), - }, nil - } - if _Region == "aws-us-gov-global" { - uriString := "https://organizations.us-gov-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "name": "sigv4", - "signingName": "organizations", - "signingRegion": "us-gov-west-1", - }, - }) - return out - }(), - }, nil - } uriString := func() string { var out strings.Builder out.WriteString("https://organizations-fips.") @@ -796,78 +596,6 @@ func (r *resolver) ResolveEndpoint( } return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") } - if _Region == "aws-global" { - uriString := "https://organizations.us-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "name": "sigv4", - "signingName": "organizations", - "signingRegion": "us-east-1", - }, - }) - return out - }(), - }, nil - } - if _Region == "aws-cn-global" { - uriString := "https://organizations.cn-northwest-1.amazonaws.com.cn" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "name": "sigv4", - "signingName": "organizations", - "signingRegion": "cn-northwest-1", - }, - }) - return out - }(), - }, nil - } - if _Region == "aws-us-gov-global" { - uriString := "https://organizations.us-gov-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "name": "sigv4", - "signingName": "organizations", - "signingRegion": "us-gov-west-1", - }, - }) - return out - }(), - }, nil - } uriString := func() string { var out strings.Builder out.WriteString("https://organizations.") diff --git a/service/organizations/endpoints_test.go b/service/organizations/endpoints_test.go index 67bd16875a9..d8ec89d96f3 100644 --- a/service/organizations/endpoints_test.go +++ b/service/organizations/endpoints_test.go @@ -17,9 +17,9 @@ import ( // For region aws-global with FIPS disabled and DualStack disabled func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("aws-global"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -66,9 +66,9 @@ func TestEndpointCase0(t *testing.T) { // For region aws-global with FIPS enabled and DualStack disabled func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), Region: ptr.String("aws-global"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -115,9 +115,9 @@ func TestEndpointCase1(t *testing.T) { // For region us-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -154,9 +154,9 @@ func TestEndpointCase2(t *testing.T) { // For region us-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -203,9 +203,9 @@ func TestEndpointCase3(t *testing.T) { // For region us-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -242,9 +242,9 @@ func TestEndpointCase4(t *testing.T) { // For region us-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -291,9 +291,9 @@ func TestEndpointCase5(t *testing.T) { // For region aws-cn-global with FIPS disabled and DualStack disabled func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("aws-cn-global"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -340,9 +340,9 @@ func TestEndpointCase6(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack enabled func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -379,9 +379,9 @@ func TestEndpointCase7(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack disabled func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -418,9 +418,9 @@ func TestEndpointCase8(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack enabled func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -457,9 +457,9 @@ func TestEndpointCase9(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack disabled func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -506,9 +506,9 @@ func TestEndpointCase10(t *testing.T) { // For region aws-us-gov-global with FIPS disabled and DualStack disabled func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("aws-us-gov-global"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -555,9 +555,9 @@ func TestEndpointCase11(t *testing.T) { // For region aws-us-gov-global with FIPS enabled and DualStack disabled func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), Region: ptr.String("aws-us-gov-global"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -604,9 +604,9 @@ func TestEndpointCase12(t *testing.T) { // For region us-gov-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -643,9 +643,9 @@ func TestEndpointCase13(t *testing.T) { // For region us-gov-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -692,9 +692,9 @@ func TestEndpointCase14(t *testing.T) { // For region us-gov-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -731,9 +731,9 @@ func TestEndpointCase15(t *testing.T) { // For region us-gov-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -777,12 +777,32 @@ func TestEndpointCase16(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack disabled +// For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -816,12 +836,32 @@ func TestEndpointCase17(t *testing.T) { } } -// For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase18(t *testing.T) { +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -855,12 +895,32 @@ func TestEndpointCase18(t *testing.T) { } } -// For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase19(t *testing.T) { +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -894,12 +954,32 @@ func TestEndpointCase19(t *testing.T) { } } -// For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase20(t *testing.T) { +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -934,11 +1014,11 @@ func TestEndpointCase20(t *testing.T) { } // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase21(t *testing.T) { +func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -974,10 +1054,10 @@ func TestEndpointCase21(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase22(t *testing.T) { +func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1013,11 +1093,11 @@ func TestEndpointCase22(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase23(t *testing.T) { +func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1034,11 +1114,11 @@ func TestEndpointCase23(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase24(t *testing.T) { +func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -1053,3 +1133,19 @@ func TestEndpointCase24(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase29(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/organizations/types/errors.go b/service/organizations/types/errors.go index 2e4f484ad83..8098c6c0edc 100644 --- a/service/organizations/types/errors.go +++ b/service/organizations/types/errors.go @@ -180,7 +180,7 @@ func (e *AccountNotRegisteredException) ErrorFault() smithy.ErrorFault { return // You can't invite an existing account to your organization until you verify that // you own the email address associated with the management account. For more -// information, see Email Address Verification (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification) +// information, see Email address verification (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification) // in the Organizations User Guide. type AccountOwnerNotVerifiedException struct { Message *string @@ -365,7 +365,7 @@ func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.Fault // create an organization. // - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on the // number of accounts in an organization. If you need more accounts, contact -// Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) to +// Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) to // request an increase in your limit. Or the number of invitations that you tried // to send would cause you to exceed the limit of accounts in your organization. // Send fewer invitations or contact Amazon Web Services Support to request an @@ -373,7 +373,9 @@ func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.Fault // toward your limit. If you get this exception when running a command immediately // after creating the organization, wait one hour and try again. After an hour, if // the command continues to fail with this error, contact Amazon Web Services -// Support (https://docs.aws.amazon.com/support/home#/) . +// Support (https://console.aws.amazon.com/support/home#/) . +// - CANNOT_REGISTER_SUSPENDED_ACCOUNT_AS_DELEGATED_ADMINISTRATOR: You cannot +// register a suspended account as a delegated administrator. // - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to // register the management account of the organization as a delegated administrator // for an Amazon Web Services service integrated with Organizations. You can @@ -425,8 +427,8 @@ func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.Fault // in the Amazon Web Services GovCloud User Guide. // - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization with // this management account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave an -// organization when all required account information has not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// such as a credit card, with the account. For more information, see +// Considerations before removing an account from an organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html) // in the Organizations User Guide. // - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted to // register more delegated administrators than allowed for the service principal. @@ -437,8 +439,8 @@ func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.Fault // this resource. // - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation with // this member account, you first must associate a valid payment instrument, such -// as a credit card, with the account. Follow the steps at To leave an -// organization when all required account information has not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// as a credit card, with the account. For more information, see Considerations +// before removing an account from an organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html) // in the Organizations User Guide. // - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a policy // from an entity that would cause the entity to have fewer than the minimum number @@ -778,7 +780,7 @@ func (e *HandshakeAlreadyInStateException) ErrorFault() smithy.ErrorFault { retu // number of accounts in an organization. Note that deleted and closed accounts // still count toward your limit. If you get this exception immediately after // creating the organization, wait one hour and try again. If after an hour it -// continues to fail with this error, contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) +// continues to fail with this error, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) // . // - ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because the // invited account is already a member of an organization. @@ -967,7 +969,7 @@ func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.F // The provided policy document doesn't meet the requirements of the specified // policy type. For example, the syntax might be incorrect. For details about -// service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) +// service control policy syntax, see SCP syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_syntax.html) // in the Organizations User Guide. type MalformedPolicyDocumentException struct { Message *string @@ -1082,8 +1084,7 @@ func (e *OrganizationalUnitNotFoundException) ErrorFault() smithy.ErrorFault { } // The organization isn't empty. To delete an organization, you must first remove -// all accounts except the management account, delete all OUs, and delete all -// policies. +// all accounts except the management account. type OrganizationNotEmptyException struct { Message *string @@ -1270,7 +1271,7 @@ func (e *PolicyTypeAlreadyEnabledException) ErrorFault() smithy.ErrorFault { ret // You can't use the specified policy type with the feature set currently enabled // for this organization. For example, you can enable SCPs only after you enable // all features in the organization. For more information, see Managing -// Organizations Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root) +// Organizations policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root) // in the Organizations User Guide. type PolicyTypeNotAvailableForOrganizationException struct { Message *string @@ -1301,8 +1302,8 @@ func (e *PolicyTypeNotAvailableForOrganizationException) ErrorFault() smithy.Err // The specified policy type isn't currently enabled in this root. You can't // attach policies of the specified type to entities in a root until you enable -// that type in the root. For more information, see Enabling All Features in Your -// Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) +// that type in the root. For more information, see Enabling all features in your +// organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the Organizations User Guide. type PolicyTypeNotEnabledException struct { Message *string diff --git a/service/organizations/types/types.go b/service/organizations/types/types.go index 0a74c0a4c66..cab36bb4324 100644 --- a/service/organizations/types/types.go +++ b/service/organizations/types/types.go @@ -372,7 +372,7 @@ type Organization struct { // set to "ALL", then all features are enabled and policies can be applied to // accounts in the organization. If set to "CONSOLIDATED_BILLING", then only // consolidated billing functionality is available. For more information, see - // Enabling All Features in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) + // Enabling all features in your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the Organizations User Guide. FeatureSet OrganizationFeatureSet diff --git a/service/securitylake/endpoints_test.go b/service/securitylake/endpoints_test.go index 756b11838cb..387584add72 100644 --- a/service/securitylake/endpoints_test.go +++ b/service/securitylake/endpoints_test.go @@ -14,12 +14,12 @@ import ( "testing" ) -// For region us-gov-east-1 with FIPS enabled and DualStack enabled +// For region us-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), - Region: ptr.String("us-gov-east-1"), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -30,7 +30,7 @@ func TestEndpointCase0(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake-fips.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://securitylake-fips.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -53,12 +53,12 @@ func TestEndpointCase0(t *testing.T) { } } -// For region us-gov-east-1 with FIPS enabled and DualStack disabled +// For region us-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), - Region: ptr.String("us-gov-east-1"), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -69,7 +69,7 @@ func TestEndpointCase1(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake-fips.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://securitylake-fips.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -92,12 +92,12 @@ func TestEndpointCase1(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack enabled +// For region us-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), - Region: ptr.String("us-gov-east-1"), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -108,7 +108,7 @@ func TestEndpointCase2(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://securitylake.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -131,12 +131,12 @@ func TestEndpointCase2(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack disabled +// For region us-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), - Region: ptr.String("us-gov-east-1"), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -147,7 +147,7 @@ func TestEndpointCase3(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://securitylake.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -173,9 +173,9 @@ func TestEndpointCase3(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack enabled func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -212,9 +212,9 @@ func TestEndpointCase4(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack disabled func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -251,9 +251,9 @@ func TestEndpointCase5(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack enabled func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -290,9 +290,9 @@ func TestEndpointCase6(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack disabled func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -326,32 +326,12 @@ func TestEndpointCase7(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack enabled +// For region us-gov-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), - Region: ptr.String("us-iso-east-1"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase9(t *testing.T) { - var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), - Region: ptr.String("us-iso-east-1"), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -362,7 +342,7 @@ func TestEndpointCase9(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake-fips.us-iso-east-1.c2s.ic.gov") + uri, _ := url.Parse("https://securitylake-fips.us-gov-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -385,32 +365,12 @@ func TestEndpointCase9(t *testing.T) { } } -// For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase10(t *testing.T) { - var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), - Region: ptr.String("us-iso-east-1"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase11(t *testing.T) { +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), - Region: ptr.String("us-iso-east-1"), } resolver := NewDefaultEndpointResolverV2() @@ -421,7 +381,7 @@ func TestEndpointCase11(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake.us-iso-east-1.c2s.ic.gov") + uri, _ := url.Parse("https://securitylake-fips.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -444,12 +404,12 @@ func TestEndpointCase11(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase12(t *testing.T) { +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), - Region: ptr.String("us-east-1"), } resolver := NewDefaultEndpointResolverV2() @@ -460,7 +420,7 @@ func TestEndpointCase12(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake-fips.us-east-1.api.aws") + uri, _ := url.Parse("https://securitylake.us-gov-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -483,12 +443,12 @@ func TestEndpointCase12(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase13(t *testing.T) { +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), - Region: ptr.String("us-east-1"), } resolver := NewDefaultEndpointResolverV2() @@ -499,7 +459,7 @@ func TestEndpointCase13(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake-fips.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://securitylake.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -522,12 +482,32 @@ func TestEndpointCase13(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase14(t *testing.T) { +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), - Region: ptr.String("us-east-1"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -538,7 +518,7 @@ func TestEndpointCase14(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake.us-east-1.api.aws") + uri, _ := url.Parse("https://securitylake-fips.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -561,12 +541,32 @@ func TestEndpointCase14(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack disabled +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), - Region: ptr.String("us-east-1"), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -577,7 +577,7 @@ func TestEndpointCase15(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://securitylake.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://securitylake.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -603,9 +603,9 @@ func TestEndpointCase15(t *testing.T) { // For region us-isob-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -623,9 +623,9 @@ func TestEndpointCase16(t *testing.T) { // For region us-isob-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -662,9 +662,9 @@ func TestEndpointCase17(t *testing.T) { // For region us-isob-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -682,9 +682,9 @@ func TestEndpointCase18(t *testing.T) { // For region us-isob-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -718,12 +718,12 @@ func TestEndpointCase19(t *testing.T) { } } -// For custom endpoint with fips disabled and dualstack disabled +// For custom endpoint with region set and fips disabled and dualstack disabled func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -758,12 +758,51 @@ func TestEndpointCase20(t *testing.T) { } } -// For custom endpoint with fips enabled and dualstack disabled +// For custom endpoint with region not set and fips disabled and dualstack disabled func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with fips enabled and dualstack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -780,11 +819,11 @@ func TestEndpointCase21(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase22(t *testing.T) { +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -799,3 +838,19 @@ func TestEndpointCase22(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/servicequotas/api_op_AssociateServiceQuotaTemplate.go b/service/servicequotas/api_op_AssociateServiceQuotaTemplate.go index a7b24ce6b90..1f5cf259bf9 100644 --- a/service/servicequotas/api_op_AssociateServiceQuotaTemplate.go +++ b/service/servicequotas/api_op_AssociateServiceQuotaTemplate.go @@ -16,9 +16,9 @@ import ( ) // Associates your quota request template with your organization. When a new -// account is created in your organization, the quota increase requests in the -// template are automatically applied to the account. You can add a quota increase -// request for any adjustable quota to your template. +// Amazon Web Services account is created in your organization, the quota increase +// requests in the template are automatically applied to the account. You can add a +// quota increase request for any adjustable quota to your template. func (c *Client) AssociateServiceQuotaTemplate(ctx context.Context, params *AssociateServiceQuotaTemplateInput, optFns ...func(*Options)) (*AssociateServiceQuotaTemplateOutput, error) { if params == nil { params = &AssociateServiceQuotaTemplateInput{} diff --git a/service/servicequotas/api_op_DeleteServiceQuotaIncreaseRequestFromTemplate.go b/service/servicequotas/api_op_DeleteServiceQuotaIncreaseRequestFromTemplate.go index a4c78c82457..3c18365aca7 100644 --- a/service/servicequotas/api_op_DeleteServiceQuotaIncreaseRequestFromTemplate.go +++ b/service/servicequotas/api_op_DeleteServiceQuotaIncreaseRequestFromTemplate.go @@ -34,17 +34,20 @@ func (c *Client) DeleteServiceQuotaIncreaseRequestFromTemplate(ctx context.Conte type DeleteServiceQuotaIncreaseRequestFromTemplateInput struct { - // The AWS Region. + // Specifies the Amazon Web Services Region for which the request was made. // // This member is required. AwsRegion *string - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. // // This member is required. QuotaCode *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string diff --git a/service/servicequotas/api_op_DisassociateServiceQuotaTemplate.go b/service/servicequotas/api_op_DisassociateServiceQuotaTemplate.go index e50aecf6b57..74332d72a60 100644 --- a/service/servicequotas/api_op_DisassociateServiceQuotaTemplate.go +++ b/service/servicequotas/api_op_DisassociateServiceQuotaTemplate.go @@ -16,9 +16,9 @@ import ( ) // Disables your quota request template. After a template is disabled, the quota -// increase requests in the template are not applied to new accounts in your -// organization. Disabling a quota request template does not apply its quota -// increase requests. +// increase requests in the template are not applied to new Amazon Web Services +// accounts in your organization. Disabling a quota request template does not apply +// its quota increase requests. func (c *Client) DisassociateServiceQuotaTemplate(ctx context.Context, params *DisassociateServiceQuotaTemplateInput, optFns ...func(*Options)) (*DisassociateServiceQuotaTemplateOutput, error) { if params == nil { params = &DisassociateServiceQuotaTemplateInput{} diff --git a/service/servicequotas/api_op_GetAWSDefaultServiceQuota.go b/service/servicequotas/api_op_GetAWSDefaultServiceQuota.go index 3bb6ffd20ae..480f3a2f336 100644 --- a/service/servicequotas/api_op_GetAWSDefaultServiceQuota.go +++ b/service/servicequotas/api_op_GetAWSDefaultServiceQuota.go @@ -35,12 +35,15 @@ func (c *Client) GetAWSDefaultServiceQuota(ctx context.Context, params *GetAWSDe type GetAWSDefaultServiceQuotaInput struct { - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. // // This member is required. QuotaCode *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string diff --git a/service/servicequotas/api_op_GetAssociationForServiceQuotaTemplate.go b/service/servicequotas/api_op_GetAssociationForServiceQuotaTemplate.go index a89e492501c..90f9768f042 100644 --- a/service/servicequotas/api_op_GetAssociationForServiceQuotaTemplate.go +++ b/service/servicequotas/api_op_GetAssociationForServiceQuotaTemplate.go @@ -39,8 +39,8 @@ type GetAssociationForServiceQuotaTemplateInput struct { type GetAssociationForServiceQuotaTemplateOutput struct { // The association status. If the status is ASSOCIATED , the quota increase - // requests in the template are automatically applied to new accounts in your - // organization. + // requests in the template are automatically applied to new Amazon Web Services + // accounts in your organization. ServiceQuotaTemplateAssociationStatus types.ServiceQuotaTemplateAssociationStatus // Metadata pertaining to the operation's result. diff --git a/service/servicequotas/api_op_GetRequestedServiceQuotaChange.go b/service/servicequotas/api_op_GetRequestedServiceQuotaChange.go index 55884992a0a..d7092eae673 100644 --- a/service/servicequotas/api_op_GetRequestedServiceQuotaChange.go +++ b/service/servicequotas/api_op_GetRequestedServiceQuotaChange.go @@ -34,7 +34,7 @@ func (c *Client) GetRequestedServiceQuotaChange(ctx context.Context, params *Get type GetRequestedServiceQuotaChangeInput struct { - // The ID of the quota increase request. + // Specifies the ID of the quota increase request. // // This member is required. RequestId *string diff --git a/service/servicequotas/api_op_GetServiceQuota.go b/service/servicequotas/api_op_GetServiceQuota.go index 9edebfe4a74..c430e0d87f0 100644 --- a/service/servicequotas/api_op_GetServiceQuota.go +++ b/service/servicequotas/api_op_GetServiceQuota.go @@ -36,16 +36,24 @@ func (c *Client) GetServiceQuota(ctx context.Context, params *GetServiceQuotaInp type GetServiceQuotaInput struct { - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. // // This member is required. QuotaCode *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string + // Specifies the Amazon Web Services account or resource to which the quota + // applies. The value in this field depends on the context scope associated with + // the specified service quota. + ContextId *string + noSmithyDocumentSerde } diff --git a/service/servicequotas/api_op_GetServiceQuotaIncreaseRequestFromTemplate.go b/service/servicequotas/api_op_GetServiceQuotaIncreaseRequestFromTemplate.go index 470b688d753..3e0da72557b 100644 --- a/service/servicequotas/api_op_GetServiceQuotaIncreaseRequestFromTemplate.go +++ b/service/servicequotas/api_op_GetServiceQuotaIncreaseRequestFromTemplate.go @@ -35,17 +35,20 @@ func (c *Client) GetServiceQuotaIncreaseRequestFromTemplate(ctx context.Context, type GetServiceQuotaIncreaseRequestFromTemplateInput struct { - // The AWS Region. + // Specifies the Amazon Web Services Region for which you made the request. // // This member is required. AwsRegion *string - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. // // This member is required. QuotaCode *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string diff --git a/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go b/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go index 16b33f941d1..17ea00ff8fb 100644 --- a/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go +++ b/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go @@ -16,7 +16,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the default values for the quotas for the specified AWS service. A +// Lists the default values for the quotas for the specified Amazon Web Service. A // default value does not reflect any quota increases. func (c *Client) ListAWSDefaultServiceQuotas(ctx context.Context, params *ListAWSDefaultServiceQuotasInput, optFns ...func(*Options)) (*ListAWSDefaultServiceQuotasOutput, error) { if params == nil { @@ -35,17 +35,27 @@ func (c *Client) ListAWSDefaultServiceQuotas(ctx context.Context, params *ListAW type ListAWSDefaultServiceQuotasInput struct { - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. MaxResults *int32 - // The token for the next page of results. + // Specifies a value for receiving additional results after you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde @@ -53,8 +63,10 @@ type ListAWSDefaultServiceQuotasInput struct { type ListAWSDefaultServiceQuotasOutput struct { - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null . NextToken *string // Information about the quotas. @@ -152,9 +164,15 @@ var _ ListAWSDefaultServiceQuotasAPIClient = (*Client)(nil) // ListAWSDefaultServiceQuotasPaginatorOptions is the paginator options for // ListAWSDefaultServiceQuotas type ListAWSDefaultServiceQuotasPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go index 47355159ee4..cb681495f7b 100644 --- a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go +++ b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go @@ -16,7 +16,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the quota increase requests for the specified service. +// Retrieves the quota increase requests for the specified Amazon Web Service. func (c *Client) ListRequestedServiceQuotaChangeHistory(ctx context.Context, params *ListRequestedServiceQuotaChangeHistoryInput, optFns ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryOutput, error) { if params == nil { params = &ListRequestedServiceQuotaChangeHistoryInput{} @@ -34,18 +34,33 @@ func (c *Client) ListRequestedServiceQuotaChangeHistory(ctx context.Context, par type ListRequestedServiceQuotaChangeHistoryInput struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. MaxResults *int32 - // The token for the next page of results. + // Specifies a value for receiving additional results after you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. NextToken *string - // The service identifier. + // Specifies at which level within the Amazon Web Services account the quota + // request applies to. + QuotaRequestedAtLevel types.AppliedLevelEnum + + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. ServiceCode *string - // The status of the quota increase request. + // Specifies that you want to filter the results to only the requests with the + // matching status. Status types.RequestStatus noSmithyDocumentSerde @@ -53,8 +68,10 @@ type ListRequestedServiceQuotaChangeHistoryInput struct { type ListRequestedServiceQuotaChangeHistoryOutput struct { - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null . NextToken *string // Information about the quota increase requests. @@ -149,9 +166,15 @@ var _ ListRequestedServiceQuotaChangeHistoryAPIClient = (*Client)(nil) // ListRequestedServiceQuotaChangeHistoryPaginatorOptions is the paginator options // for ListRequestedServiceQuotaChangeHistory type ListRequestedServiceQuotaChangeHistoryPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go index 07696accc52..02367508ca3 100644 --- a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go +++ b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go @@ -34,25 +34,42 @@ func (c *Client) ListRequestedServiceQuotaChangeHistoryByQuota(ctx context.Conte type ListRequestedServiceQuotaChangeHistoryByQuotaInput struct { - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. // // This member is required. QuotaCode *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. MaxResults *int32 - // The token for the next page of results. + // Specifies a value for receiving additional results after you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. NextToken *string - // The status value of the quota increase request. + // Specifies at which level within the Amazon Web Services account the quota + // request applies to. + QuotaRequestedAtLevel types.AppliedLevelEnum + + // Specifies that you want to filter the results to only the requests with the + // matching status. Status types.RequestStatus noSmithyDocumentSerde @@ -60,8 +77,10 @@ type ListRequestedServiceQuotaChangeHistoryByQuotaInput struct { type ListRequestedServiceQuotaChangeHistoryByQuotaOutput struct { - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null . NextToken *string // Information about the quota increase requests. @@ -159,9 +178,15 @@ var _ ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient = (*Client)(nil) // ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions is the paginator // options for ListRequestedServiceQuotaChangeHistoryByQuota type ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go b/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go index ef991ca4419..88adff1f229 100644 --- a/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go +++ b/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go @@ -34,18 +34,28 @@ func (c *Client) ListServiceQuotaIncreaseRequestsInTemplate(ctx context.Context, type ListServiceQuotaIncreaseRequestsInTemplateInput struct { - // The AWS Region. + // Specifies the Amazon Web Services Region for which you made the request. AwsRegion *string - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. MaxResults *int32 - // The token for the next page of results. + // Specifies a value for receiving additional results after you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. NextToken *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. ServiceCode *string noSmithyDocumentSerde @@ -53,8 +63,10 @@ type ListServiceQuotaIncreaseRequestsInTemplateInput struct { type ListServiceQuotaIncreaseRequestsInTemplateOutput struct { - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null . NextToken *string // Information about the quota increase requests. @@ -149,9 +161,15 @@ var _ ListServiceQuotaIncreaseRequestsInTemplateAPIClient = (*Client)(nil) // ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions is the paginator // options for ListServiceQuotaIncreaseRequestsInTemplate type ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListServiceQuotas.go b/service/servicequotas/api_op_ListServiceQuotas.go index 21ea226ed6a..1c6240dc1d3 100644 --- a/service/servicequotas/api_op_ListServiceQuotas.go +++ b/service/servicequotas/api_op_ListServiceQuotas.go @@ -16,8 +16,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the applied quota values for the specified AWS service. For some quotas, -// only the default values are available. If the applied quota value is not +// Lists the applied quota values for the specified Amazon Web Service. For some +// quotas, only the default values are available. If the applied quota value is not // available for a quota, the quota is not retrieved. func (c *Client) ListServiceQuotas(ctx context.Context, params *ListServiceQuotasInput, optFns ...func(*Options)) (*ListServiceQuotasOutput, error) { if params == nil { @@ -36,26 +36,46 @@ func (c *Client) ListServiceQuotas(ctx context.Context, params *ListServiceQuota type ListServiceQuotasInput struct { - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. MaxResults *int32 - // The token for the next page of results. + // Specifies a value for receiving additional results after you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. NextToken *string + // Specifies at which level of granularity that the quota value is applied. + QuotaAppliedAtLevel types.AppliedLevelEnum + + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. + QuotaCode *string + noSmithyDocumentSerde } type ListServiceQuotasOutput struct { - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null . NextToken *string // Information about the quotas. @@ -152,9 +172,15 @@ var _ ListServiceQuotasAPIClient = (*Client)(nil) // ListServiceQuotasPaginatorOptions is the paginator options for ListServiceQuotas type ListServiceQuotasPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListServices.go b/service/servicequotas/api_op_ListServices.go index 1e7762d53a9..a60e21c5a0c 100644 --- a/service/servicequotas/api_op_ListServices.go +++ b/service/servicequotas/api_op_ListServices.go @@ -16,7 +16,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the names and codes for the services integrated with Service Quotas. +// Lists the names and codes for the Amazon Web Services integrated with Service +// Quotas. func (c *Client) ListServices(ctx context.Context, params *ListServicesInput, optFns ...func(*Options)) (*ListServicesOutput, error) { if params == nil { params = &ListServicesInput{} @@ -34,12 +35,21 @@ func (c *Client) ListServices(ctx context.Context, params *ListServicesInput, op type ListServicesInput struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. MaxResults *int32 - // The token for the next page of results. + // Specifies a value for receiving additional results after you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde @@ -47,11 +57,13 @@ type ListServicesInput struct { type ListServicesOutput struct { - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null . NextToken *string - // Information about the services. + // The list of the Amazon Web Service names and service codes. Services []types.ServiceInfo // Metadata pertaining to the operation's result. @@ -141,9 +153,15 @@ var _ ListServicesAPIClient = (*Client)(nil) // ListServicesPaginatorOptions is the paginator options for ListServices type ListServicesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, if any, make another call with the token returned from this - // call. + // Specifies the maximum number of results that you want included on each page of + // the response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the + // next call to the operation to get the next part of the results. An API operation + // can return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListTagsForResource.go b/service/servicequotas/api_op_ListTagsForResource.go index 884344ffd1d..17b4ea4f94f 100644 --- a/service/servicequotas/api_op_ListTagsForResource.go +++ b/service/servicequotas/api_op_ListTagsForResource.go @@ -37,8 +37,8 @@ type ListTagsForResourceInput struct { // The Amazon Resource Name (ARN) for the applied quota for which you want to list // tags. You can get this information by using the Service Quotas console, or by // listing the quotas using the list-service-quotas (https://docs.aws.amazon.com/cli/latest/reference/service-quotas/list-service-quotas.html) - // AWS CLI command or the ListServiceQuotas (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) - // AWS API operation. + // CLI command or the ListServiceQuotas (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) + // Amazon Web Services API operation. // // This member is required. ResourceARN *string diff --git a/service/servicequotas/api_op_PutServiceQuotaIncreaseRequestIntoTemplate.go b/service/servicequotas/api_op_PutServiceQuotaIncreaseRequestIntoTemplate.go index ffd315b240a..344e38fca94 100644 --- a/service/servicequotas/api_op_PutServiceQuotaIncreaseRequestIntoTemplate.go +++ b/service/servicequotas/api_op_PutServiceQuotaIncreaseRequestIntoTemplate.go @@ -34,22 +34,25 @@ func (c *Client) PutServiceQuotaIncreaseRequestIntoTemplate(ctx context.Context, type PutServiceQuotaIncreaseRequestIntoTemplateInput struct { - // The AWS Region. + // Specifies the Amazon Web Services Region to which the template applies. // // This member is required. AwsRegion *string - // The new, increased value for the quota. + // Specifies the new, increased value for the quota. // // This member is required. DesiredValue *float64 - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. // // This member is required. QuotaCode *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string diff --git a/service/servicequotas/api_op_RequestServiceQuotaIncrease.go b/service/servicequotas/api_op_RequestServiceQuotaIncrease.go index 5502b0b85fd..83331bfbe81 100644 --- a/service/servicequotas/api_op_RequestServiceQuotaIncrease.go +++ b/service/servicequotas/api_op_RequestServiceQuotaIncrease.go @@ -34,21 +34,29 @@ func (c *Client) RequestServiceQuotaIncrease(ctx context.Context, params *Reques type RequestServiceQuotaIncreaseInput struct { - // The new, increased value for the quota. + // Specifies the new, increased value for the quota. // // This member is required. DesiredValue *float64 - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. // // This member is required. QuotaCode *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. // // This member is required. ServiceCode *string + // Specifies the Amazon Web Services account or resource to which the quota + // applies. The value in this field depends on the context scope associated with + // the specified service quota. + ContextId *string + noSmithyDocumentSerde } diff --git a/service/servicequotas/api_op_TagResource.go b/service/servicequotas/api_op_TagResource.go index 5e31fdb3c90..2b754984222 100644 --- a/service/servicequotas/api_op_TagResource.go +++ b/service/servicequotas/api_op_TagResource.go @@ -38,8 +38,8 @@ type TagResourceInput struct { // The Amazon Resource Name (ARN) for the applied quota. You can get this // information by using the Service Quotas console, or by listing the quotas using // the list-service-quotas (https://docs.aws.amazon.com/cli/latest/reference/service-quotas/list-service-quotas.html) - // AWS CLI command or the ListServiceQuotas (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) - // AWS API operation. + // CLI command or the ListServiceQuotas (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) + // Amazon Web Services API operation. // // This member is required. ResourceARN *string diff --git a/service/servicequotas/api_op_UntagResource.go b/service/servicequotas/api_op_UntagResource.go index 460d16ea67a..085916f3191 100644 --- a/service/servicequotas/api_op_UntagResource.go +++ b/service/servicequotas/api_op_UntagResource.go @@ -37,8 +37,8 @@ type UntagResourceInput struct { // The Amazon Resource Name (ARN) for the applied quota that you want to untag. // You can get this information by using the Service Quotas console, or by listing // the quotas using the list-service-quotas (https://docs.aws.amazon.com/cli/latest/reference/service-quotas/list-service-quotas.html) - // AWS CLI command or the ListServiceQuotas (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) - // AWS API operation. + // CLI command or the ListServiceQuotas (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) + // Amazon Web Services API operation. // // This member is required. ResourceARN *string diff --git a/service/servicequotas/deserializers.go b/service/servicequotas/deserializers.go index a0381b51fd1..b077715eca5 100644 --- a/service/servicequotas/deserializers.go +++ b/service/servicequotas/deserializers.go @@ -3599,6 +3599,64 @@ func awsAwsjson11_deserializeDocumentOutputTags(v *[]types.Tag, value interface{ return nil } +func awsAwsjson11_deserializeDocumentQuotaContextInfo(v **types.QuotaContextInfo, 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.QuotaContextInfo + if *v == nil { + sv = &types.QuotaContextInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ContextId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaContextId to be of type string, got %T instead", value) + } + sv.ContextId = ptr.String(jtv) + } + + case "ContextScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaContextScope to be of type string, got %T instead", value) + } + sv.ContextScope = types.QuotaContextScope(jtv) + } + + case "ContextScopeType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaContextScopeType to be of type string, got %T instead", value) + } + sv.ContextScopeType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentQuotaExceededException(v **types.QuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3825,6 +3883,11 @@ func awsAwsjson11_deserializeDocumentRequestedServiceQuotaChange(v **types.Reque sv.QuotaCode = ptr.String(jtv) } + case "QuotaContext": + if err := awsAwsjson11_deserializeDocumentQuotaContextInfo(&sv.QuotaContext, value); err != nil { + return err + } + case "QuotaName": if value != nil { jtv, ok := value.(string) @@ -3834,6 +3897,15 @@ func awsAwsjson11_deserializeDocumentRequestedServiceQuotaChange(v **types.Reque sv.QuotaName = ptr.String(jtv) } + case "QuotaRequestedAtLevel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppliedLevelEnum to be of type string, got %T instead", value) + } + sv.QuotaRequestedAtLevel = types.AppliedLevelEnum(jtv) + } + case "Requester": if value != nil { jtv, ok := value.(string) @@ -4135,6 +4207,15 @@ func awsAwsjson11_deserializeDocumentServiceQuota(v **types.ServiceQuota, value return err } + case "QuotaAppliedAtLevel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppliedLevelEnum to be of type string, got %T instead", value) + } + sv.QuotaAppliedAtLevel = types.AppliedLevelEnum(jtv) + } + case "QuotaArn": if value != nil { jtv, ok := value.(string) @@ -4153,6 +4234,11 @@ func awsAwsjson11_deserializeDocumentServiceQuota(v **types.ServiceQuota, value sv.QuotaCode = ptr.String(jtv) } + case "QuotaContext": + if err := awsAwsjson11_deserializeDocumentQuotaContextInfo(&sv.QuotaContext, value); err != nil { + return err + } + case "QuotaName": if value != nil { jtv, ok := value.(string) diff --git a/service/servicequotas/doc.go b/service/servicequotas/doc.go index 215fe7c3a4a..c9eab45a7c2 100644 --- a/service/servicequotas/doc.go +++ b/service/servicequotas/doc.go @@ -3,9 +3,9 @@ // Package servicequotas provides the API client, operations, and parameter types // for Service Quotas. // -// With Service Quotas, you can view and manage your quotas easily as your AWS -// workloads grow. Quotas, also referred to as limits, are the maximum number of -// resources that you can create in your AWS account. For more information, see the -// Service Quotas User Guide (https://docs.aws.amazon.com/servicequotas/latest/userguide/) +// With Service Quotas, you can view and manage your quotas easily as your Amazon +// Web Services workloads grow. Quotas, also referred to as limits, are the maximum +// number of resources that you can create in your Amazon Web Services account. For +// more information, see the Service Quotas User Guide (https://docs.aws.amazon.com/servicequotas/latest/userguide/) // . package servicequotas diff --git a/service/servicequotas/endpoints_test.go b/service/servicequotas/endpoints_test.go index 497c61a79c9..35b69f9eb0c 100644 --- a/service/servicequotas/endpoints_test.go +++ b/service/servicequotas/endpoints_test.go @@ -18,8 +18,8 @@ import ( func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("af-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -57,8 +57,8 @@ func TestEndpointCase0(t *testing.T) { func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -96,8 +96,8 @@ func TestEndpointCase1(t *testing.T) { func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -135,8 +135,8 @@ func TestEndpointCase2(t *testing.T) { func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -174,8 +174,8 @@ func TestEndpointCase3(t *testing.T) { func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -213,8 +213,8 @@ func TestEndpointCase4(t *testing.T) { func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -252,8 +252,8 @@ func TestEndpointCase5(t *testing.T) { func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -291,8 +291,8 @@ func TestEndpointCase6(t *testing.T) { func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -330,8 +330,8 @@ func TestEndpointCase7(t *testing.T) { func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -369,8 +369,8 @@ func TestEndpointCase8(t *testing.T) { func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ca-central-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -408,8 +408,8 @@ func TestEndpointCase9(t *testing.T) { func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-central-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -447,8 +447,8 @@ func TestEndpointCase10(t *testing.T) { func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -486,8 +486,8 @@ func TestEndpointCase11(t *testing.T) { func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -525,8 +525,8 @@ func TestEndpointCase12(t *testing.T) { func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -564,8 +564,8 @@ func TestEndpointCase13(t *testing.T) { func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -603,8 +603,8 @@ func TestEndpointCase14(t *testing.T) { func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -642,8 +642,8 @@ func TestEndpointCase15(t *testing.T) { func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("me-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -681,8 +681,8 @@ func TestEndpointCase16(t *testing.T) { func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("sa-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -720,8 +720,8 @@ func TestEndpointCase17(t *testing.T) { func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -759,8 +759,8 @@ func TestEndpointCase18(t *testing.T) { func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -798,8 +798,8 @@ func TestEndpointCase19(t *testing.T) { func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -837,8 +837,8 @@ func TestEndpointCase20(t *testing.T) { func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -876,8 +876,8 @@ func TestEndpointCase21(t *testing.T) { func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -915,8 +915,8 @@ func TestEndpointCase22(t *testing.T) { func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -954,8 +954,8 @@ func TestEndpointCase23(t *testing.T) { func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -993,8 +993,8 @@ func TestEndpointCase24(t *testing.T) { func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1032,8 +1032,8 @@ func TestEndpointCase25(t *testing.T) { func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1071,8 +1071,8 @@ func TestEndpointCase26(t *testing.T) { func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1110,8 +1110,8 @@ func TestEndpointCase27(t *testing.T) { func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1149,8 +1149,8 @@ func TestEndpointCase28(t *testing.T) { func TestEndpointCase29(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1188,8 +1188,8 @@ func TestEndpointCase29(t *testing.T) { func TestEndpointCase30(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1227,8 +1227,8 @@ func TestEndpointCase30(t *testing.T) { func TestEndpointCase31(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1266,8 +1266,8 @@ func TestEndpointCase31(t *testing.T) { func TestEndpointCase32(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1305,8 +1305,8 @@ func TestEndpointCase32(t *testing.T) { func TestEndpointCase33(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1344,8 +1344,8 @@ func TestEndpointCase33(t *testing.T) { func TestEndpointCase34(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1379,12 +1379,32 @@ func TestEndpointCase34(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack disabled +// For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase35(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase36(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1418,12 +1438,32 @@ func TestEndpointCase35(t *testing.T) { } } +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase37(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase36(t *testing.T) { +func TestEndpointCase38(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1457,12 +1497,32 @@ func TestEndpointCase36(t *testing.T) { } } +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase39(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase37(t *testing.T) { +func TestEndpointCase40(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1496,12 +1556,32 @@ func TestEndpointCase37(t *testing.T) { } } +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase41(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase38(t *testing.T) { +func TestEndpointCase42(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1536,11 +1616,11 @@ func TestEndpointCase38(t *testing.T) { } // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase39(t *testing.T) { +func TestEndpointCase43(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1576,10 +1656,10 @@ func TestEndpointCase39(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase40(t *testing.T) { +func TestEndpointCase44(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1615,11 +1695,11 @@ func TestEndpointCase40(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase41(t *testing.T) { +func TestEndpointCase45(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1636,11 +1716,11 @@ func TestEndpointCase41(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase42(t *testing.T) { +func TestEndpointCase46(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -1655,3 +1735,19 @@ func TestEndpointCase42(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase47(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/servicequotas/serializers.go b/service/servicequotas/serializers.go index f172205f45e..6a52b4753fc 100644 --- a/service/servicequotas/serializers.go +++ b/service/servicequotas/serializers.go @@ -1199,6 +1199,11 @@ func awsAwsjson11_serializeOpDocumentGetServiceQuotaInput(v *GetServiceQuotaInpu object := value.Object() defer object.Close() + if v.ContextId != nil { + ok := object.Key("ContextId") + ok.String(*v.ContextId) + } + if v.QuotaCode != nil { ok := object.Key("QuotaCode") ok.String(*v.QuotaCode) @@ -1253,6 +1258,11 @@ func awsAwsjson11_serializeOpDocumentListRequestedServiceQuotaChangeHistoryByQuo ok.String(*v.QuotaCode) } + if len(v.QuotaRequestedAtLevel) > 0 { + ok := object.Key("QuotaRequestedAtLevel") + ok.String(string(v.QuotaRequestedAtLevel)) + } + if v.ServiceCode != nil { ok := object.Key("ServiceCode") ok.String(*v.ServiceCode) @@ -1280,6 +1290,11 @@ func awsAwsjson11_serializeOpDocumentListRequestedServiceQuotaChangeHistoryInput ok.String(*v.NextToken) } + if len(v.QuotaRequestedAtLevel) > 0 { + ok := object.Key("QuotaRequestedAtLevel") + ok.String(string(v.QuotaRequestedAtLevel)) + } + if v.ServiceCode != nil { ok := object.Key("ServiceCode") ok.String(*v.ServiceCode) @@ -1334,6 +1349,16 @@ func awsAwsjson11_serializeOpDocumentListServiceQuotasInput(v *ListServiceQuotas ok.String(*v.NextToken) } + if len(v.QuotaAppliedAtLevel) > 0 { + ok := object.Key("QuotaAppliedAtLevel") + ok.String(string(v.QuotaAppliedAtLevel)) + } + + if v.QuotaCode != nil { + ok := object.Key("QuotaCode") + ok.String(*v.QuotaCode) + } + if v.ServiceCode != nil { ok := object.Key("ServiceCode") ok.String(*v.ServiceCode) @@ -1415,6 +1440,11 @@ func awsAwsjson11_serializeOpDocumentRequestServiceQuotaIncreaseInput(v *Request object := value.Object() defer object.Close() + if v.ContextId != nil { + ok := object.Key("ContextId") + ok.String(*v.ContextId) + } + if v.DesiredValue != nil { ok := object.Key("DesiredValue") switch { diff --git a/service/servicequotas/types/enums.go b/service/servicequotas/types/enums.go index 755c7988bcd..08a2e3905ec 100644 --- a/service/servicequotas/types/enums.go +++ b/service/servicequotas/types/enums.go @@ -2,6 +2,26 @@ package types +type AppliedLevelEnum string + +// Enum values for AppliedLevelEnum +const ( + AppliedLevelEnumAccount AppliedLevelEnum = "ACCOUNT" + AppliedLevelEnumResource AppliedLevelEnum = "RESOURCE" + AppliedLevelEnumAll AppliedLevelEnum = "ALL" +) + +// Values returns all known values for AppliedLevelEnum. 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 (AppliedLevelEnum) Values() []AppliedLevelEnum { + return []AppliedLevelEnum{ + "ACCOUNT", + "RESOURCE", + "ALL", + } +} + type ErrorCode string // Enum values for ErrorCode @@ -52,15 +72,35 @@ func (PeriodUnit) Values() []PeriodUnit { } } +type QuotaContextScope string + +// Enum values for QuotaContextScope +const ( + QuotaContextScopeResource QuotaContextScope = "RESOURCE" + QuotaContextScopeAccount QuotaContextScope = "ACCOUNT" +) + +// Values returns all known values for QuotaContextScope. 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 (QuotaContextScope) Values() []QuotaContextScope { + return []QuotaContextScope{ + "RESOURCE", + "ACCOUNT", + } +} + type RequestStatus string // Enum values for RequestStatus const ( - RequestStatusPending RequestStatus = "PENDING" - RequestStatusCaseOpened RequestStatus = "CASE_OPENED" - RequestStatusApproved RequestStatus = "APPROVED" - RequestStatusDenied RequestStatus = "DENIED" - RequestStatusCaseClosed RequestStatus = "CASE_CLOSED" + RequestStatusPending RequestStatus = "PENDING" + RequestStatusCaseOpened RequestStatus = "CASE_OPENED" + RequestStatusApproved RequestStatus = "APPROVED" + RequestStatusDenied RequestStatus = "DENIED" + RequestStatusCaseClosed RequestStatus = "CASE_CLOSED" + RequestStatusNotApproved RequestStatus = "NOT_APPROVED" + RequestStatusInvalidRequest RequestStatus = "INVALID_REQUEST" ) // Values returns all known values for RequestStatus. Note that this can be @@ -73,6 +113,8 @@ func (RequestStatus) Values() []RequestStatus { "APPROVED", "DENIED", "CASE_CLOSED", + "NOT_APPROVED", + "INVALID_REQUEST", } } diff --git a/service/servicequotas/types/errors.go b/service/servicequotas/types/errors.go index 1c3356d1e58..7994122d532 100644 --- a/service/servicequotas/types/errors.go +++ b/service/servicequotas/types/errors.go @@ -166,7 +166,8 @@ func (e *InvalidResourceStateException) ErrorCode() string { } func (e *InvalidResourceStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The account making this call is not a member of an organization. +// The Amazon Web Services account making this call is not a member of an +// organization. type NoAvailableOrganizationException struct { Message *string @@ -218,7 +219,8 @@ func (e *NoSuchResourceException) ErrorCode() string { } func (e *NoSuchResourceException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The organization that your account belongs to is not in All Features mode. +// The organization that your Amazon Web Services account belongs to is not in All +// Features mode. type OrganizationNotInAllFeaturesModeException struct { Message *string @@ -380,7 +382,7 @@ func (e *TagPolicyViolationException) ErrorCode() string { } func (e *TagPolicyViolationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The Service Quotas template is not available in this AWS Region. +// The Service Quotas template is not available in this Amazon Web Services Region. type TemplatesNotAvailableInRegionException struct { Message *string diff --git a/service/servicequotas/types/types.go b/service/servicequotas/types/types.go index 16860aed514..a8ef242f761 100644 --- a/service/servicequotas/types/types.go +++ b/service/servicequotas/types/types.go @@ -13,9 +13,10 @@ type ErrorReason struct { // Service Quotas returns the following error values: // - DEPENDENCY_ACCESS_DENIED_ERROR - The caller does not have the required // permissions to complete the action. To resolve the error, you must have - // permission to access the service or quota. - // - DEPENDENCY_THROTTLING_ERROR - The service is throttling Service Quotas. - // - DEPENDENCY_SERVICE_ERROR - The service is not available. + // permission to access the Amazon Web Service or quota. + // - DEPENDENCY_THROTTLING_ERROR - The Amazon Web Service is throttling Service + // Quotas. + // - DEPENDENCY_SERVICE_ERROR - The Amazon Web Service is not available. // - SERVICE_QUOTA_NOT_AVAILABLE_ERROR - There was an error in Service Quotas. ErrorCode ErrorCode @@ -44,13 +45,33 @@ type MetricInfo struct { noSmithyDocumentSerde } +// A structure that describes the context for a service quota. The context +// identifies what the quota applies to. +type QuotaContextInfo struct { + + // Specifies the Amazon Web Services account or resource to which the quota + // applies. The value in this field depends on the context scope associated with + // the specified service quota. + ContextId *string + + // Specifies whether the quota applies to an Amazon Web Services account, or to a + // resource. + ContextScope QuotaContextScope + + // When the ContextScope is RESOURCE , then this specifies the resource type of the + // specified resource. + ContextScopeType *string + + noSmithyDocumentSerde +} + // Information about the quota period. type QuotaPeriod struct { // The time unit. PeriodUnit PeriodUnit - // The value. + // The value associated with the reported PeriodUnit . PeriodValue *int32 noSmithyDocumentSerde @@ -81,19 +102,29 @@ type RequestedServiceQuotaChange struct { // The Amazon Resource Name (ARN) of the quota. QuotaArn *string - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. QuotaCode *string - // The quota name. + // The context for this service quota. + QuotaContext *QuotaContextInfo + + // Specifies the quota name. QuotaName *string + // Specifies at which level within the Amazon Web Services account the quota + // request applies to. + QuotaRequestedAtLevel AppliedLevelEnum + // The IAM identity of the requester. Requester *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. ServiceCode *string - // The service name. + // Specifies the service name. ServiceName *string // The state of the quota increase request. @@ -105,13 +136,14 @@ type RequestedServiceQuotaChange struct { noSmithyDocumentSerde } -// Information about a service. +// Information about an Amazon Web Service. type ServiceInfo struct { - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. ServiceCode *string - // The service name. + // Specifies the service name. ServiceName *string noSmithyDocumentSerde @@ -132,19 +164,28 @@ type ServiceQuota struct { // The period of time. Period *QuotaPeriod + // Specifies at which level of granularity that the quota value is applied. + QuotaAppliedAtLevel AppliedLevelEnum + // The Amazon Resource Name (ARN) of the quota. QuotaArn *string - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. QuotaCode *string - // The quota name. + // The context for this service quota. + QuotaContext *QuotaContextInfo + + // Specifies the quota name. QuotaName *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. ServiceCode *string - // The service name. + // Specifies the service name. ServiceName *string // The unit of measurement. @@ -162,7 +203,7 @@ type ServiceQuota struct { // Information about a quota increase request. type ServiceQuotaIncreaseRequestInTemplate struct { - // The AWS Region. + // The Amazon Web Services Region. AwsRegion *string // The new, increased value of the quota. @@ -171,16 +212,19 @@ type ServiceQuotaIncreaseRequestInTemplate struct { // Indicates whether the quota is global. GlobalQuota bool - // The quota identifier. + // Specifies the quota identifier. To find the quota code for a specific quota, + // use the ListServiceQuotas operation, and look for the QuotaCode response in the + // output for the quota you want. QuotaCode *string - // The quota name. + // Specifies the quota name. QuotaName *string - // The service identifier. + // Specifies the service identifier. To find the service code value for an Amazon + // Web Services service, use the ListServices operation. ServiceCode *string - // The service name. + // Specifies the service name. ServiceName *string // The unit of measurement. diff --git a/service/workspacesweb/api_op_CreateUserSettings.go b/service/workspacesweb/api_op_CreateUserSettings.go index a47768c3129..76659a0d6e3 100644 --- a/service/workspacesweb/api_op_CreateUserSettings.go +++ b/service/workspacesweb/api_op_CreateUserSettings.go @@ -65,6 +65,9 @@ type CreateUserSettingsInput struct { // This member is required. UploadAllowed types.EnabledType + // The additional encryption context of the user settings. + AdditionalEncryptionContext map[string]string + // A unique, case-sensitive identifier that you provide to ensure the idempotency // of the request. Idempotency ensures that an API request completes only once. // With an idempotent request, if the original request completes successfully, @@ -73,6 +76,14 @@ type CreateUserSettingsInput struct { // automatically generated by the AWS SDK. ClientToken *string + // The configuration that specifies which cookies should be synchronized from the + // end user's local browser to the remote browser. + CookieSynchronizationConfiguration *types.CookieSynchronizationConfiguration + + // The customer managed key used to encrypt sensitive information in the user + // settings. + CustomerManagedKey *string + // The amount of time that a streaming session remains active after users // disconnect. DisconnectTimeoutInMinutes *int32 diff --git a/service/workspacesweb/api_op_GetTrustStoreCertificate.go b/service/workspacesweb/api_op_GetTrustStoreCertificate.go index c58c553373e..421cf215b35 100644 --- a/service/workspacesweb/api_op_GetTrustStoreCertificate.go +++ b/service/workspacesweb/api_op_GetTrustStoreCertificate.go @@ -49,12 +49,14 @@ type GetTrustStoreCertificateInput struct { type GetTrustStoreCertificateOutput struct { - // The certificate of the trust store certificate. - Certificate *types.Certificate - // The ARN of the trust store certificate. + // + // This member is required. TrustStoreArn *string + // The certificate of the trust store certificate. + Certificate *types.Certificate + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/workspacesweb/api_op_ListTrustStoreCertificates.go b/service/workspacesweb/api_op_ListTrustStoreCertificates.go index 8817c1a4bb9..1d525915f59 100644 --- a/service/workspacesweb/api_op_ListTrustStoreCertificates.go +++ b/service/workspacesweb/api_op_ListTrustStoreCertificates.go @@ -51,6 +51,11 @@ type ListTrustStoreCertificatesInput struct { type ListTrustStoreCertificatesOutput struct { + // The ARN of the trust store. + // + // This member is required. + TrustStoreArn *string + // The certificate list. CertificateList []types.CertificateSummary @@ -58,9 +63,6 @@ type ListTrustStoreCertificatesOutput struct { // operation.> NextToken *string - // The ARN of the trust store. - TrustStoreArn *string - // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/workspacesweb/api_op_UpdateUserSettings.go b/service/workspacesweb/api_op_UpdateUserSettings.go index 0641b0b1ccf..91f54705176 100644 --- a/service/workspacesweb/api_op_UpdateUserSettings.go +++ b/service/workspacesweb/api_op_UpdateUserSettings.go @@ -47,6 +47,11 @@ type UpdateUserSettingsInput struct { // automatically generated by the AWS SDK. ClientToken *string + // The configuration that specifies which cookies should be synchronized from the + // end user's local browser to the remote browser. If the allowlist and blocklist + // are empty, the configuration becomes null. + CookieSynchronizationConfiguration *types.CookieSynchronizationConfiguration + // Specifies whether the user can copy text from the streaming session to the // local device. CopyAllowed types.EnabledType diff --git a/service/workspacesweb/deserializers.go b/service/workspacesweb/deserializers.go index 3d3b722ed70..db830147f2c 100644 --- a/service/workspacesweb/deserializers.go +++ b/service/workspacesweb/deserializers.go @@ -1392,7 +1392,7 @@ func awsRestjson1_deserializeOpDocumentCreateIdentityProviderOutput(v **CreateId if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + return fmt.Errorf("expected SubresourceARN to be of type string, got %T instead", value) } sv.IdentityProviderArn = ptr.String(jtv) } @@ -9304,6 +9304,139 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } +func awsRestjson1_deserializeDocumentCookieSpecification(v **types.CookieSpecification, 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.CookieSpecification + if *v == nil { + sv = &types.CookieSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "domain": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CookieDomain to be of type string, got %T instead", value) + } + sv.Domain = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CookieName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "path": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CookiePath to be of type string, got %T instead", value) + } + sv.Path = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCookieSpecifications(v *[]types.CookieSpecification, 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.CookieSpecification + if *v == nil { + cv = []types.CookieSpecification{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CookieSpecification + destAddr := &col + if err := awsRestjson1_deserializeDocumentCookieSpecification(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCookieSynchronizationConfiguration(v **types.CookieSynchronizationConfiguration, 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.CookieSynchronizationConfiguration + if *v == nil { + sv = &types.CookieSynchronizationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "allowlist": + if err := awsRestjson1_deserializeDocumentCookieSpecifications(&sv.Allowlist, value); err != nil { + return err + } + + case "blocklist": + if err := awsRestjson1_deserializeDocumentCookieSpecifications(&sv.Blocklist, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentIdentityProvider(v **types.IdentityProvider, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9330,7 +9463,7 @@ func awsRestjson1_deserializeDocumentIdentityProvider(v **types.IdentityProvider if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + return fmt.Errorf("expected SubresourceARN to be of type string, got %T instead", value) } sv.IdentityProviderArn = ptr.String(jtv) } @@ -9463,7 +9596,7 @@ func awsRestjson1_deserializeDocumentIdentityProviderSummary(v **types.IdentityP if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + return fmt.Errorf("expected SubresourceARN to be of type string, got %T instead", value) } sv.IdentityProviderArn = ptr.String(jtv) } @@ -11033,6 +11166,11 @@ func awsRestjson1_deserializeDocumentUserSettings(v **types.UserSettings, value return err } + case "cookieSynchronizationConfiguration": + if err := awsRestjson1_deserializeDocumentCookieSynchronizationConfiguration(&sv.CookieSynchronizationConfiguration, value); err != nil { + return err + } + case "copyAllowed": if value != nil { jtv, ok := value.(string) @@ -11178,6 +11316,11 @@ func awsRestjson1_deserializeDocumentUserSettingsSummary(v **types.UserSettingsS for key, value := range shape { switch key { + case "cookieSynchronizationConfiguration": + if err := awsRestjson1_deserializeDocumentCookieSynchronizationConfiguration(&sv.CookieSynchronizationConfiguration, value); err != nil { + return err + } + case "copyAllowed": if value != nil { jtv, ok := value.(string) diff --git a/service/workspacesweb/serializers.go b/service/workspacesweb/serializers.go index 87fd8ef5208..abb9ad5f60b 100644 --- a/service/workspacesweb/serializers.go +++ b/service/workspacesweb/serializers.go @@ -1183,16 +1183,35 @@ func awsRestjson1_serializeOpDocumentCreateUserSettingsInput(v *CreateUserSettin object := value.Object() defer object.Close() + if v.AdditionalEncryptionContext != nil { + ok := object.Key("additionalEncryptionContext") + if err := awsRestjson1_serializeDocumentEncryptionContextMap(v.AdditionalEncryptionContext, ok); err != nil { + return err + } + } + if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } + if v.CookieSynchronizationConfiguration != nil { + ok := object.Key("cookieSynchronizationConfiguration") + if err := awsRestjson1_serializeDocumentCookieSynchronizationConfiguration(v.CookieSynchronizationConfiguration, ok); err != nil { + return err + } + } + if len(v.CopyAllowed) > 0 { ok := object.Key("copyAllowed") ok.String(string(v.CopyAllowed)) } + if v.CustomerManagedKey != nil { + ok := object.Key("customerManagedKey") + ok.String(*v.CustomerManagedKey) + } + if v.DisconnectTimeoutInMinutes != nil { ok := object.Key("disconnectTimeoutInMinutes") ok.Integer(*v.DisconnectTimeoutInMinutes) @@ -4405,6 +4424,13 @@ func awsRestjson1_serializeOpDocumentUpdateUserSettingsInput(v *UpdateUserSettin ok.String(*v.ClientToken) } + if v.CookieSynchronizationConfiguration != nil { + ok := object.Key("cookieSynchronizationConfiguration") + if err := awsRestjson1_serializeDocumentCookieSynchronizationConfiguration(v.CookieSynchronizationConfiguration, ok); err != nil { + return err + } + } + if len(v.CopyAllowed) > 0 { ok := object.Key("copyAllowed") ok.String(string(v.CopyAllowed)) @@ -4468,6 +4494,62 @@ func awsRestjson1_serializeDocumentCertificateThumbprintList(v []string, value s return nil } +func awsRestjson1_serializeDocumentCookieSpecification(v *types.CookieSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Domain != nil { + ok := object.Key("domain") + ok.String(*v.Domain) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Path != nil { + ok := object.Key("path") + ok.String(*v.Path) + } + + return nil +} + +func awsRestjson1_serializeDocumentCookieSpecifications(v []types.CookieSpecification, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCookieSpecification(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCookieSynchronizationConfiguration(v *types.CookieSynchronizationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Allowlist != nil { + ok := object.Key("allowlist") + if err := awsRestjson1_serializeDocumentCookieSpecifications(v.Allowlist, ok); err != nil { + return err + } + } + + if v.Blocklist != nil { + ok := object.Key("blocklist") + if err := awsRestjson1_serializeDocumentCookieSpecifications(v.Blocklist, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentEncryptionContextMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/workspacesweb/types/types.go b/service/workspacesweb/types/types.go index fc0919893ab..0d17e9a3b22 100644 --- a/service/workspacesweb/types/types.go +++ b/service/workspacesweb/types/types.go @@ -31,6 +31,8 @@ type BrowserSettings struct { type BrowserSettingsSummary struct { // The ARN of the browser settings. + // + // This member is required. BrowserSettingsArn *string noSmithyDocumentSerde @@ -81,6 +83,40 @@ type CertificateSummary struct { noSmithyDocumentSerde } +// Specifies a single cookie or set of cookies in an end user's browser. +type CookieSpecification struct { + + // The domain of the cookie. + // + // This member is required. + Domain *string + + // The name of the cookie. + Name *string + + // The path of the cookie. + Path *string + + noSmithyDocumentSerde +} + +// The configuration that specifies which cookies should be synchronized from the +// end user's local browser to the remote browser. +type CookieSynchronizationConfiguration struct { + + // The list of cookie specifications that are allowed to be synchronized to the + // remote browser. + // + // This member is required. + Allowlist []CookieSpecification + + // The list of cookie specifications that are blocked from being synchronized to + // the remote browser. + Blocklist []CookieSpecification + + noSmithyDocumentSerde +} + // The identity provider. type IdentityProvider struct { @@ -136,6 +172,8 @@ type IdentityProvider struct { type IdentityProviderSummary struct { // The ARN of the identity provider. + // + // This member is required. IdentityProviderArn *string // The identity provider name. @@ -177,6 +215,11 @@ type IpAccessSettings struct { // The summary of IP access settings. type IpAccessSettingsSummary struct { + // The ARN of IP access settings. + // + // This member is required. + IpAccessSettingsArn *string + // The creation date timestamp of the IP access settings. CreationDate *time.Time @@ -186,9 +229,6 @@ type IpAccessSettingsSummary struct { // The display name of the IP access settings. DisplayName *string - // The ARN of IP access settings. - IpAccessSettingsArn *string - noSmithyDocumentSerde } @@ -238,6 +278,8 @@ type NetworkSettings struct { type NetworkSettingsSummary struct { // The ARN of the network settings. + // + // This member is required. NetworkSettingsArn *string // The VPC ID of the network settings. @@ -249,6 +291,11 @@ type NetworkSettingsSummary struct { // The web portal. type Portal struct { + // The ARN of the web portal. + // + // This member is required. + PortalArn *string + // The type of authentication integration points used when signing into the web // portal. Defaults to Standard . Standard web portals are authenticated directly // through your identity provider. You need to call CreateIdentityProvider to @@ -279,9 +326,6 @@ type Portal struct { // The ARN of the network settings that is associated with the web portal. NetworkSettingsArn *string - // The ARN of the web portal. - PortalArn *string - // The endpoint URL of the web portal that users access in order to start // streaming sessions. PortalEndpoint *string @@ -311,6 +355,11 @@ type Portal struct { // The summary of the portal. type PortalSummary struct { + // The ARN of the web portal. + // + // This member is required. + PortalArn *string + // The type of authentication integration points used when signing into the web // portal. Defaults to Standard . Standard web portals are authenticated directly // through your identity provider. You need to call CreateIdentityProvider to @@ -341,9 +390,6 @@ type PortalSummary struct { // The ARN of the network settings that is associated with the web portal. NetworkSettingsArn *string - // The ARN of the web portal. - PortalArn *string - // The endpoint URL of the web portal that users access in order to start // streaming sessions. PortalEndpoint *string @@ -391,12 +437,14 @@ type Tag struct { // CA certificate to the trust store. type TrustStore struct { - // A list of web portal ARNs that this trust store is associated with. - AssociatedPortalArns []string - // The ARN of the trust store. + // + // This member is required. TrustStoreArn *string + // A list of web portal ARNs that this trust store is associated with. + AssociatedPortalArns []string + noSmithyDocumentSerde } @@ -431,12 +479,14 @@ type UserAccessLoggingSettings struct { // The summary of user access logging settings. type UserAccessLoggingSettingsSummary struct { - // The ARN of the Kinesis stream. - KinesisStreamArn *string - // The ARN of the user access logging settings. + // + // This member is required. UserAccessLoggingSettingsArn *string + // The ARN of the Kinesis stream. + KinesisStreamArn *string + noSmithyDocumentSerde } @@ -453,6 +503,10 @@ type UserSettings struct { // A list of web portal ARNs that this user settings is associated with. AssociatedPortalArns []string + // The configuration that specifies which cookies should be synchronized from the + // end user's local browser to the remote browser. + CookieSynchronizationConfiguration *CookieSynchronizationConfiguration + // Specifies whether the user can copy text from the streaming session to the // local device. CopyAllowed EnabledType @@ -487,6 +541,15 @@ type UserSettings struct { // The summary of user settings. type UserSettingsSummary struct { + // The ARN of the user settings. + // + // This member is required. + UserSettingsArn *string + + // The configuration that specifies which cookies should be synchronized from the + // end user's local browser to the remote browser. + CookieSynchronizationConfiguration *CookieSynchronizationConfiguration + // Specifies whether the user can copy text from the streaming session to the // local device. CopyAllowed EnabledType @@ -515,9 +578,6 @@ type UserSettingsSummary struct { // streaming session. UploadAllowed EnabledType - // The ARN of the user settings. - UserSettingsArn *string - noSmithyDocumentSerde } diff --git a/service/workspacesweb/validators.go b/service/workspacesweb/validators.go index 29acf529123..ea835edc6d8 100644 --- a/service/workspacesweb/validators.go +++ b/service/workspacesweb/validators.go @@ -1234,6 +1234,62 @@ func addOpUpdateUserSettingsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpUpdateUserSettings{}, middleware.After) } +func validateCookieSpecification(v *types.CookieSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CookieSpecification"} + if v.Domain == nil { + invalidParams.Add(smithy.NewErrParamRequired("Domain")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCookieSpecifications(v []types.CookieSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CookieSpecifications"} + for i := range v { + if err := validateCookieSpecification(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCookieSynchronizationConfiguration(v *types.CookieSynchronizationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CookieSynchronizationConfiguration"} + if v.Allowlist == nil { + invalidParams.Add(smithy.NewErrParamRequired("Allowlist")) + } else if v.Allowlist != nil { + if err := validateCookieSpecifications(v.Allowlist); err != nil { + invalidParams.AddNested("Allowlist", err.(smithy.InvalidParamsError)) + } + } + if v.Blocklist != nil { + if err := validateCookieSpecifications(v.Blocklist); err != nil { + invalidParams.AddNested("Blocklist", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateIpRule(v *types.IpRule) error { if v == nil { return nil @@ -1585,6 +1641,11 @@ func validateOpCreateUserSettingsInput(v *CreateUserSettingsInput) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.CookieSynchronizationConfiguration != nil { + if err := validateCookieSynchronizationConfiguration(v.CookieSynchronizationConfiguration); err != nil { + invalidParams.AddNested("CookieSynchronizationConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2158,6 +2219,11 @@ func validateOpUpdateUserSettingsInput(v *UpdateUserSettingsInput) error { if v.UserSettingsArn == nil { invalidParams.Add(smithy.NewErrParamRequired("UserSettingsArn")) } + if v.CookieSynchronizationConfiguration != nil { + if err := validateCookieSynchronizationConfiguration(v.CookieSynchronizationConfiguration); err != nil { + invalidParams.AddNested("CookieSynchronizationConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else {