diff --git a/.changelog/10d6a3d44f1f480a82b18977a7ae4f86.json b/.changelog/10d6a3d44f1f480a82b18977a7ae4f86.json new file mode 100644 index 00000000000..002e76f6917 --- /dev/null +++ b/.changelog/10d6a3d44f1f480a82b18977a7ae4f86.json @@ -0,0 +1,8 @@ +{ + "id": "10d6a3d4-4f1f-480a-82b1-8977a7ae4f86", + "type": "documentation", + "description": "Documentation updates for AWS Transfer Family", + "modules": [ + "service/transfer" + ] +} \ No newline at end of file diff --git a/.changelog/1484066c9a5749b6a506e4a8041a434c.json b/.changelog/1484066c9a5749b6a506e4a8041a434c.json new file mode 100644 index 00000000000..9e174fc3a98 --- /dev/null +++ b/.changelog/1484066c9a5749b6a506e4a8041a434c.json @@ -0,0 +1,8 @@ +{ + "id": "1484066c-9a57-49b6-a506-e4a8041a434c", + "type": "feature", + "description": "Introducing Amazon EC2 R7iz instances with 3.9 GHz sustained all-core turbo frequency and deliver up to 20% better performance than previous generation z1d instances.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/541a71eb336f48a1a00000eee6bb77e9.json b/.changelog/541a71eb336f48a1a00000eee6bb77e9.json new file mode 100644 index 00000000000..36e4bc73873 --- /dev/null +++ b/.changelog/541a71eb336f48a1a00000eee6bb77e9.json @@ -0,0 +1,8 @@ +{ + "id": "541a71eb-336f-48a1-a000-00eee6bb77e9", + "type": "feature", + "description": "Add model timeout exception for InvokeModelWithResponseStream API and update validator for invoke model identifier.", + "modules": [ + "service/bedrockruntime" + ] +} \ No newline at end of file diff --git a/.changelog/6b42f2f36e6e4638a16429ad07ec8fb8.json b/.changelog/6b42f2f36e6e4638a16429ad07ec8fb8.json new file mode 100644 index 00000000000..3b3b0f81d51 --- /dev/null +++ b/.changelog/6b42f2f36e6e4638a16429ad07ec8fb8.json @@ -0,0 +1,8 @@ +{ + "id": "6b42f2f3-6e6e-4638-a164-29ad07ec8fb8", + "type": "feature", + "description": "Adds DefaultCertificateForNewLaunches field in the DescribeCertificates API response.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/.changelog/ba6fbbfd1b6a4b57b47327dc7eb7fc68.json b/.changelog/ba6fbbfd1b6a4b57b47327dc7eb7fc68.json new file mode 100644 index 00000000000..64e55493cc0 --- /dev/null +++ b/.changelog/ba6fbbfd1b6a4b57b47327dc7eb7fc68.json @@ -0,0 +1,8 @@ +{ + "id": "ba6fbbfd-1b6a-4b57-b473-27dc7eb7fc68", + "type": "documentation", + "description": "Remove Rinkeby as option from Ethereum APIs", + "modules": [ + "service/managedblockchain" + ] +} \ No newline at end of file diff --git a/.changelog/ce49a10ff1e346c483e2ff946b4e2b3a.json b/.changelog/ce49a10ff1e346c483e2ff946b4e2b3a.json new file mode 100644 index 00000000000..637f9537416 --- /dev/null +++ b/.changelog/ce49a10ff1e346c483e2ff946b4e2b3a.json @@ -0,0 +1,8 @@ +{ + "id": "ce49a10f-f1e3-46c4-83e2-ff946b4e2b3a", + "type": "feature", + "description": "Fix FIPS Endpoints in aws-us-gov.", + "modules": [ + "service/sso" + ] +} \ No newline at end of file diff --git a/.changelog/d834f6e9eb5142599d7cc235a86c02c8.json b/.changelog/d834f6e9eb5142599d7cc235a86c02c8.json new file mode 100644 index 00000000000..0011e8d15dc --- /dev/null +++ b/.changelog/d834f6e9eb5142599d7cc235a86c02c8.json @@ -0,0 +1,8 @@ +{ + "id": "d834f6e9-eb51-4259-9d7c-c235a86c02c8", + "type": "feature", + "description": "Provisioned throughput feature with Amazon and third-party base models, and update validators for model identifier and taggable resource ARNs.", + "modules": [ + "service/bedrock" + ] +} \ No newline at end of file diff --git a/.changelog/e728ad911e8d4007892192af33f37510.json b/.changelog/e728ad911e8d4007892192af33f37510.json new file mode 100644 index 00000000000..8db74a407d5 --- /dev/null +++ b/.changelog/e728ad911e8d4007892192af33f37510.json @@ -0,0 +1,8 @@ +{ + "id": "e728ad91-1e8d-4007-8921-92af33f37510", + "type": "feature", + "description": "STS API updates for assumeRole", + "modules": [ + "service/sts" + ] +} \ No newline at end of file diff --git a/service/bedrock/api_op_CreateProvisionedModelThroughput.go b/service/bedrock/api_op_CreateProvisionedModelThroughput.go new file mode 100644 index 00000000000..29ea2ffb365 --- /dev/null +++ b/service/bedrock/api_op_CreateProvisionedModelThroughput.go @@ -0,0 +1,321 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +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/bedrock/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a provisioned throughput with dedicated capacity for a foundation model +// or a fine-tuned model. For more information, see Provisioned throughput (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) +// in the Bedrock User Guide. +func (c *Client) CreateProvisionedModelThroughput(ctx context.Context, params *CreateProvisionedModelThroughputInput, optFns ...func(*Options)) (*CreateProvisionedModelThroughputOutput, error) { + if params == nil { + params = &CreateProvisionedModelThroughputInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateProvisionedModelThroughput", params, optFns, c.addOperationCreateProvisionedModelThroughputMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateProvisionedModelThroughputOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateProvisionedModelThroughputInput struct { + + // Name or ARN of the model to associate with this provisioned throughput. + // + // This member is required. + ModelId *string + + // Number of model units to allocate. + // + // This member is required. + ModelUnits *int32 + + // Unique name for this provisioned throughput. + // + // This member is required. + ProvisionedModelName *string + + // Unique token value that you can provide. If this token matches a previous + // request, Bedrock ignores the request, but does not return an error. + ClientRequestToken *string + + // Commitment duration requested for the provisioned throughput. + CommitmentDuration types.CommitmentDuration + + // Tags to associate with this provisioned throughput. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateProvisionedModelThroughputOutput struct { + + // The ARN for this provisioned throughput. + // + // This member is required. + ProvisionedModelArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateProvisionedModelThroughputMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProvisionedModelThroughput{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProvisionedModelThroughput{}, 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 = addCreateProvisionedModelThroughputResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateProvisionedModelThroughputMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateProvisionedModelThroughputValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProvisionedModelThroughput(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 +} + +type idempotencyToken_initializeOpCreateProvisionedModelThroughput struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateProvisionedModelThroughput) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateProvisionedModelThroughput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateProvisionedModelThroughputInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProvisionedModelThroughputInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateProvisionedModelThroughputMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProvisionedModelThroughput{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateProvisionedModelThroughput(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "bedrock", + OperationName: "CreateProvisionedModelThroughput", + } +} + +type opCreateProvisionedModelThroughputResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateProvisionedModelThroughputResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateProvisionedModelThroughputResolveEndpointMiddleware) 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 := "bedrock" + 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 = "bedrock" + } 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("bedrock") + } + 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 addCreateProvisionedModelThroughputResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateProvisionedModelThroughputResolveEndpointMiddleware{ + 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/bedrock/api_op_DeleteProvisionedModelThroughput.go b/service/bedrock/api_op_DeleteProvisionedModelThroughput.go new file mode 100644 index 00000000000..54f7434bc31 --- /dev/null +++ b/service/bedrock/api_op_DeleteProvisionedModelThroughput.go @@ -0,0 +1,258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +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" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a provisioned throughput. For more information, see Provisioned +// throughput (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) +// in the Bedrock User Guide. +func (c *Client) DeleteProvisionedModelThroughput(ctx context.Context, params *DeleteProvisionedModelThroughputInput, optFns ...func(*Options)) (*DeleteProvisionedModelThroughputOutput, error) { + if params == nil { + params = &DeleteProvisionedModelThroughputInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteProvisionedModelThroughput", params, optFns, c.addOperationDeleteProvisionedModelThroughputMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProvisionedModelThroughputOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProvisionedModelThroughputInput struct { + + // The ARN or name of the provisioned throughput. + // + // This member is required. + ProvisionedModelId *string + + noSmithyDocumentSerde +} + +type DeleteProvisionedModelThroughputOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteProvisionedModelThroughputMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProvisionedModelThroughput{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProvisionedModelThroughput{}, 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 = addDeleteProvisionedModelThroughputResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteProvisionedModelThroughputValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProvisionedModelThroughput(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_opDeleteProvisionedModelThroughput(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "bedrock", + OperationName: "DeleteProvisionedModelThroughput", + } +} + +type opDeleteProvisionedModelThroughputResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteProvisionedModelThroughputResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteProvisionedModelThroughputResolveEndpointMiddleware) 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 := "bedrock" + 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 = "bedrock" + } 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("bedrock") + } + 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 addDeleteProvisionedModelThroughputResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteProvisionedModelThroughputResolveEndpointMiddleware{ + 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/bedrock/api_op_GetProvisionedModelThroughput.go b/service/bedrock/api_op_GetProvisionedModelThroughput.go new file mode 100644 index 00000000000..8511e58ed7c --- /dev/null +++ b/service/bedrock/api_op_GetProvisionedModelThroughput.go @@ -0,0 +1,322 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +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/bedrock/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Get details for a provisioned throughput. For more information, see Provisioned +// throughput (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) +// in the Bedrock User Guide. +func (c *Client) GetProvisionedModelThroughput(ctx context.Context, params *GetProvisionedModelThroughputInput, optFns ...func(*Options)) (*GetProvisionedModelThroughputOutput, error) { + if params == nil { + params = &GetProvisionedModelThroughputInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetProvisionedModelThroughput", params, optFns, c.addOperationGetProvisionedModelThroughputMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetProvisionedModelThroughputOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetProvisionedModelThroughputInput struct { + + // The ARN or name of the provisioned throughput. + // + // This member is required. + ProvisionedModelId *string + + noSmithyDocumentSerde +} + +type GetProvisionedModelThroughputOutput struct { + + // The timestamp of the creation time for this provisioned throughput. + // + // This member is required. + CreationTime *time.Time + + // The ARN of the new model to asssociate with this provisioned throughput. + // + // This member is required. + DesiredModelArn *string + + // The desired number of model units that was requested to be available for this + // provisioned throughput. + // + // This member is required. + DesiredModelUnits *int32 + + // ARN of the foundation model. + // + // This member is required. + FoundationModelArn *string + + // The timestamp of the last modified time of this provisioned throughput. + // + // This member is required. + LastModifiedTime *time.Time + + // The ARN or name of the model associated with this provisioned throughput. + // + // This member is required. + ModelArn *string + + // The current number of model units requested to be available for this + // provisioned throughput. + // + // This member is required. + ModelUnits *int32 + + // The ARN of the provisioned throughput. + // + // This member is required. + ProvisionedModelArn *string + + // The name of the provisioned throughput. + // + // This member is required. + ProvisionedModelName *string + + // Status of the provisioned throughput. + // + // This member is required. + Status types.ProvisionedModelStatus + + // Commitment duration of the provisioned throughput. + CommitmentDuration types.CommitmentDuration + + // Commitment expiration time for the provisioned throughput. + CommitmentExpirationTime *time.Time + + // Failure message for any issues that the create operation encounters. + FailureMessage *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetProvisionedModelThroughputMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProvisionedModelThroughput{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProvisionedModelThroughput{}, 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 = addGetProvisionedModelThroughputResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetProvisionedModelThroughputValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProvisionedModelThroughput(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_opGetProvisionedModelThroughput(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "bedrock", + OperationName: "GetProvisionedModelThroughput", + } +} + +type opGetProvisionedModelThroughputResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetProvisionedModelThroughputResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetProvisionedModelThroughputResolveEndpointMiddleware) 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 := "bedrock" + 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 = "bedrock" + } 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("bedrock") + } + 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 addGetProvisionedModelThroughputResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetProvisionedModelThroughputResolveEndpointMiddleware{ + 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/bedrock/api_op_ListProvisionedModelThroughputs.go b/service/bedrock/api_op_ListProvisionedModelThroughputs.go new file mode 100644 index 00000000000..1fb120b79d3 --- /dev/null +++ b/service/bedrock/api_op_ListProvisionedModelThroughputs.go @@ -0,0 +1,382 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +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/bedrock/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// List the provisioned capacities. For more information, see Provisioned +// throughput (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) +// in the Bedrock User Guide. +func (c *Client) ListProvisionedModelThroughputs(ctx context.Context, params *ListProvisionedModelThroughputsInput, optFns ...func(*Options)) (*ListProvisionedModelThroughputsOutput, error) { + if params == nil { + params = &ListProvisionedModelThroughputsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProvisionedModelThroughputs", params, optFns, c.addOperationListProvisionedModelThroughputsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProvisionedModelThroughputsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProvisionedModelThroughputsInput struct { + + // Return provisioned capacities created after the specified time. + CreationTimeAfter *time.Time + + // Return provisioned capacities created before the specified time. + CreationTimeBefore *time.Time + + // THe maximum number of results to return in the response. + MaxResults *int32 + + // Return the list of provisioned capacities where their model ARN is equal to + // this parameter. + ModelArnEquals *string + + // Return the list of provisioned capacities if their name contains these + // characters. + NameContains *string + + // Continuation token from the previous response, for Bedrock to list the next set + // of results. + NextToken *string + + // The field to sort by in the returned list of provisioned capacities. + SortBy types.SortByProvisionedModels + + // The sort order of the results. + SortOrder types.SortOrder + + // Return the list of provisioned capacities that match the specified status. + StatusEquals types.ProvisionedModelStatus + + noSmithyDocumentSerde +} + +type ListProvisionedModelThroughputsOutput struct { + + // Continuation token for the next request to list the next set of results. + NextToken *string + + // List of summaries, one for each provisioned throughput in the response. + ProvisionedModelSummaries []types.ProvisionedModelSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListProvisionedModelThroughputsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProvisionedModelThroughputs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProvisionedModelThroughputs{}, 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 = addListProvisionedModelThroughputsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProvisionedModelThroughputs(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 +} + +// ListProvisionedModelThroughputsAPIClient is a client that implements the +// ListProvisionedModelThroughputs operation. +type ListProvisionedModelThroughputsAPIClient interface { + ListProvisionedModelThroughputs(context.Context, *ListProvisionedModelThroughputsInput, ...func(*Options)) (*ListProvisionedModelThroughputsOutput, error) +} + +var _ ListProvisionedModelThroughputsAPIClient = (*Client)(nil) + +// ListProvisionedModelThroughputsPaginatorOptions is the paginator options for +// ListProvisionedModelThroughputs +type ListProvisionedModelThroughputsPaginatorOptions struct { + // THe maximum number of results to return in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListProvisionedModelThroughputsPaginator is a paginator for +// ListProvisionedModelThroughputs +type ListProvisionedModelThroughputsPaginator struct { + options ListProvisionedModelThroughputsPaginatorOptions + client ListProvisionedModelThroughputsAPIClient + params *ListProvisionedModelThroughputsInput + nextToken *string + firstPage bool +} + +// NewListProvisionedModelThroughputsPaginator returns a new +// ListProvisionedModelThroughputsPaginator +func NewListProvisionedModelThroughputsPaginator(client ListProvisionedModelThroughputsAPIClient, params *ListProvisionedModelThroughputsInput, optFns ...func(*ListProvisionedModelThroughputsPaginatorOptions)) *ListProvisionedModelThroughputsPaginator { + if params == nil { + params = &ListProvisionedModelThroughputsInput{} + } + + options := ListProvisionedModelThroughputsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListProvisionedModelThroughputsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisionedModelThroughputsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListProvisionedModelThroughputs page. +func (p *ListProvisionedModelThroughputsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisionedModelThroughputsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListProvisionedModelThroughputs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListProvisionedModelThroughputs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "bedrock", + OperationName: "ListProvisionedModelThroughputs", + } +} + +type opListProvisionedModelThroughputsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListProvisionedModelThroughputsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListProvisionedModelThroughputsResolveEndpointMiddleware) 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 := "bedrock" + 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 = "bedrock" + } 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("bedrock") + } + 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 addListProvisionedModelThroughputsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListProvisionedModelThroughputsResolveEndpointMiddleware{ + 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/bedrock/api_op_UpdateProvisionedModelThroughput.go b/service/bedrock/api_op_UpdateProvisionedModelThroughput.go new file mode 100644 index 00000000000..b33cf360e80 --- /dev/null +++ b/service/bedrock/api_op_UpdateProvisionedModelThroughput.go @@ -0,0 +1,264 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +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" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a provisioned throughput. For more information, see Provisioned +// throughput (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) +// in the Bedrock User Guide. +func (c *Client) UpdateProvisionedModelThroughput(ctx context.Context, params *UpdateProvisionedModelThroughputInput, optFns ...func(*Options)) (*UpdateProvisionedModelThroughputOutput, error) { + if params == nil { + params = &UpdateProvisionedModelThroughputInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateProvisionedModelThroughput", params, optFns, c.addOperationUpdateProvisionedModelThroughputMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateProvisionedModelThroughputOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateProvisionedModelThroughputInput struct { + + // The ARN or name of the provisioned throughput to update. + // + // This member is required. + ProvisionedModelId *string + + // The ARN of the new model to associate with this provisioned throughput. + DesiredModelId *string + + // The new name for this provisioned throughput. + DesiredProvisionedModelName *string + + noSmithyDocumentSerde +} + +type UpdateProvisionedModelThroughputOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateProvisionedModelThroughputMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateProvisionedModelThroughput{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateProvisionedModelThroughput{}, 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 = addUpdateProvisionedModelThroughputResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateProvisionedModelThroughputValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProvisionedModelThroughput(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_opUpdateProvisionedModelThroughput(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "bedrock", + OperationName: "UpdateProvisionedModelThroughput", + } +} + +type opUpdateProvisionedModelThroughputResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateProvisionedModelThroughputResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateProvisionedModelThroughputResolveEndpointMiddleware) 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 := "bedrock" + 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 = "bedrock" + } 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("bedrock") + } + 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 addUpdateProvisionedModelThroughputResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateProvisionedModelThroughputResolveEndpointMiddleware{ + 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/bedrock/deserializers.go b/service/bedrock/deserializers.go index e5842a61cbd..932b42020d8 100644 --- a/service/bedrock/deserializers.go +++ b/service/bedrock/deserializers.go @@ -192,6 +192,175 @@ func awsRestjson1_deserializeOpDocumentCreateModelCustomizationJobOutput(v **Cre return nil } +type awsRestjson1_deserializeOpCreateProvisionedModelThroughput struct { +} + +func (*awsRestjson1_deserializeOpCreateProvisionedModelThroughput) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateProvisionedModelThroughput) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateProvisionedModelThroughput(response, &metadata) + } + output := &CreateProvisionedModelThroughputOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateProvisionedModelThroughputOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateProvisionedModelThroughput(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 awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateProvisionedModelThroughputOutput(v **CreateProvisionedModelThroughputOutput, 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 *CreateProvisionedModelThroughputOutput + if *v == nil { + sv = &CreateProvisionedModelThroughputOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "provisionedModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelArn to be of type string, got %T instead", value) + } + sv.ProvisionedModelArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDeleteCustomModel struct { } @@ -379,6 +548,104 @@ func awsRestjson1_deserializeOpErrorDeleteModelInvocationLoggingConfiguration(re } } +type awsRestjson1_deserializeOpDeleteProvisionedModelThroughput struct { +} + +func (*awsRestjson1_deserializeOpDeleteProvisionedModelThroughput) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteProvisionedModelThroughput) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteProvisionedModelThroughput(response, &metadata) + } + output := &DeleteProvisionedModelThroughputOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteProvisionedModelThroughput(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 awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpGetCustomModel struct { } @@ -1260,14 +1527,14 @@ func awsRestjson1_deserializeOpDocumentGetModelInvocationLoggingConfigurationOut return nil } -type awsRestjson1_deserializeOpListCustomModels struct { +type awsRestjson1_deserializeOpGetProvisionedModelThroughput struct { } -func (*awsRestjson1_deserializeOpListCustomModels) ID() string { +func (*awsRestjson1_deserializeOpGetProvisionedModelThroughput) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetProvisionedModelThroughput) 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) @@ -1281,9 +1548,9 @@ func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCustomModels(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetProvisionedModelThroughput(response, &metadata) } - output := &ListCustomModelsOutput{} + output := &GetProvisionedModelThroughputOutput{} out.Result = output var buff [1024]byte @@ -1304,7 +1571,7 @@ func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCustomModelsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetProvisionedModelThroughputOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1317,7 +1584,7 @@ func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCustomModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetProvisionedModelThroughput(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)} @@ -1364,7 +1631,298 @@ func awsRestjson1_deserializeOpErrorListCustomModels(response *smithyhttp.Respon case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetProvisionedModelThroughputOutput(v **GetProvisionedModelThroughputOutput, 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 *GetProvisionedModelThroughputOutput + if *v == nil { + sv = &GetProvisionedModelThroughputOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "commitmentDuration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommitmentDuration to be of type string, got %T instead", value) + } + sv.CommitmentDuration = types.CommitmentDuration(jtv) + } + + case "commitmentExpirationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CommitmentExpirationTime = ptr.Time(t) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "desiredModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.DesiredModelArn = ptr.String(jtv) + } + + case "desiredModelUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DesiredModelUnits = ptr.Int32(int32(i64)) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "foundationModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FoundationModelArn to be of type string, got %T instead", value) + } + sv.FoundationModelArn = ptr.String(jtv) + } + + case "lastModifiedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(t) + } + + case "modelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + case "modelUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ModelUnits = ptr.Int32(int32(i64)) + } + + case "provisionedModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelArn to be of type string, got %T instead", value) + } + sv.ProvisionedModelArn = ptr.String(jtv) + } + + case "provisionedModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelName to be of type string, got %T instead", value) + } + sv.ProvisionedModelName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelStatus to be of type string, got %T instead", value) + } + sv.Status = types.ProvisionedModelStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListCustomModels struct { +} + +func (*awsRestjson1_deserializeOpListCustomModels) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListCustomModels(response, &metadata) + } + output := &ListCustomModelsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListCustomModelsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListCustomModels(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 awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): @@ -1716,18 +2274,178 @@ func awsRestjson1_deserializeOpDocumentListModelCustomizationJobsOutput(v **List var sv *ListModelCustomizationJobsOutput if *v == nil { - sv = &ListModelCustomizationJobsOutput{} + sv = &ListModelCustomizationJobsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "modelCustomizationJobSummaries": + if err := awsRestjson1_deserializeDocumentModelCustomizationJobSummaries(&sv.ModelCustomizationJobSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListProvisionedModelThroughputs struct { +} + +func (*awsRestjson1_deserializeOpListProvisionedModelThroughputs) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListProvisionedModelThroughputs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListProvisionedModelThroughputs(response, &metadata) + } + output := &ListProvisionedModelThroughputsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListProvisionedModelThroughputsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListProvisionedModelThroughputs(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 awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListProvisionedModelThroughputsOutput(v **ListProvisionedModelThroughputsOutput, 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 *ListProvisionedModelThroughputsOutput + if *v == nil { + sv = &ListProvisionedModelThroughputsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "modelCustomizationJobSummaries": - if err := awsRestjson1_deserializeDocumentModelCustomizationJobSummaries(&sv.ModelCustomizationJobSummaries, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -1737,6 +2455,11 @@ func awsRestjson1_deserializeOpDocumentListModelCustomizationJobsOutput(v **List sv.NextToken = ptr.String(jtv) } + case "provisionedModelSummaries": + if err := awsRestjson1_deserializeDocumentProvisionedModelSummaries(&sv.ProvisionedModelSummaries, value); err != nil { + return err + } + default: _, _ = key, value @@ -2288,6 +3011,101 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } +type awsRestjson1_deserializeOpUpdateProvisionedModelThroughput struct { +} + +func (*awsRestjson1_deserializeOpUpdateProvisionedModelThroughput) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateProvisionedModelThroughput) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateProvisionedModelThroughput(response, &metadata) + } + output := &UpdateProvisionedModelThroughputOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateProvisionedModelThroughput(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 awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte @@ -3500,6 +4318,199 @@ func awsRestjson1_deserializeDocumentOutputDataConfig(v **types.OutputDataConfig return nil } +func awsRestjson1_deserializeDocumentProvisionedModelSummaries(v *[]types.ProvisionedModelSummary, 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.ProvisionedModelSummary + if *v == nil { + cv = []types.ProvisionedModelSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProvisionedModelSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentProvisionedModelSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProvisionedModelSummary(v **types.ProvisionedModelSummary, 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.ProvisionedModelSummary + if *v == nil { + sv = &types.ProvisionedModelSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "commitmentDuration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommitmentDuration to be of type string, got %T instead", value) + } + sv.CommitmentDuration = types.CommitmentDuration(jtv) + } + + case "commitmentExpirationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CommitmentExpirationTime = ptr.Time(t) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "desiredModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.DesiredModelArn = ptr.String(jtv) + } + + case "desiredModelUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DesiredModelUnits = ptr.Int32(int32(i64)) + } + + case "foundationModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FoundationModelArn to be of type string, got %T instead", value) + } + sv.FoundationModelArn = ptr.String(jtv) + } + + case "lastModifiedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(t) + } + + case "modelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + case "modelUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ModelUnits = ptr.Int32(int32(i64)) + } + + case "provisionedModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelArn to be of type string, got %T instead", value) + } + sv.ProvisionedModelArn = ptr.String(jtv) + } + + case "provisionedModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelName to be of type string, got %T instead", value) + } + sv.ProvisionedModelName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelStatus to be of type string, got %T instead", value) + } + sv.Status = types.ProvisionedModelStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/bedrock/generated.json b/service/bedrock/generated.json index c634604e45a..1fe7bbc7dec 100644 --- a/service/bedrock/generated.json +++ b/service/bedrock/generated.json @@ -10,20 +10,25 @@ "api_client.go", "api_client_test.go", "api_op_CreateModelCustomizationJob.go", + "api_op_CreateProvisionedModelThroughput.go", "api_op_DeleteCustomModel.go", "api_op_DeleteModelInvocationLoggingConfiguration.go", + "api_op_DeleteProvisionedModelThroughput.go", "api_op_GetCustomModel.go", "api_op_GetFoundationModel.go", "api_op_GetModelCustomizationJob.go", "api_op_GetModelInvocationLoggingConfiguration.go", + "api_op_GetProvisionedModelThroughput.go", "api_op_ListCustomModels.go", "api_op_ListFoundationModels.go", "api_op_ListModelCustomizationJobs.go", + "api_op_ListProvisionedModelThroughputs.go", "api_op_ListTagsForResource.go", "api_op_PutModelInvocationLoggingConfiguration.go", "api_op_StopModelCustomizationJob.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateProvisionedModelThroughput.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/bedrock/internal/endpoints/endpoints.go b/service/bedrock/internal/endpoints/endpoints.go index df17dd99ab1..260c9ee2bd5 100644 --- a/service/bedrock/internal/endpoints/endpoints.go +++ b/service/bedrock/internal/endpoints/endpoints.go @@ -138,6 +138,97 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "bedrock-ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "bedrock.ap-southeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-fips-us-east-1", + }: endpoints.Endpoint{ + Hostname: "bedrock-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-fips-us-west-2", + }: endpoints.Endpoint{ + Hostname: "bedrock-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-runtime-ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "bedrock-runtime.ap-southeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-runtime-fips-us-east-1", + }: endpoints.Endpoint{ + Hostname: "bedrock-runtime-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-runtime-fips-us-west-2", + }: endpoints.Endpoint{ + Hostname: "bedrock-runtime-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-runtime-us-east-1", + }: endpoints.Endpoint{ + Hostname: "bedrock-runtime.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-runtime-us-west-2", + }: endpoints.Endpoint{ + Hostname: "bedrock-runtime.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-us-east-1", + }: endpoints.Endpoint{ + Hostname: "bedrock.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "bedrock-us-west-2", + }: endpoints.Endpoint{ + Hostname: "bedrock.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-cn", diff --git a/service/bedrock/serializers.go b/service/bedrock/serializers.go index 3434a73a6b8..01ec4293377 100644 --- a/service/bedrock/serializers.go +++ b/service/bedrock/serializers.go @@ -164,6 +164,108 @@ func awsRestjson1_serializeOpDocumentCreateModelCustomizationJobInput(v *CreateM return nil } +type awsRestjson1_serializeOpCreateProvisionedModelThroughput struct { +} + +func (*awsRestjson1_serializeOpCreateProvisionedModelThroughput) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateProvisionedModelThroughput) 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.(*CreateProvisionedModelThroughputInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/provisioned-model-throughput") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateProvisionedModelThroughputInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateProvisionedModelThroughputInput(v *CreateProvisionedModelThroughputInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateProvisionedModelThroughputInput(v *CreateProvisionedModelThroughputInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("clientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if len(v.CommitmentDuration) > 0 { + ok := object.Key("commitmentDuration") + ok.String(string(v.CommitmentDuration)) + } + + if v.ModelId != nil { + ok := object.Key("modelId") + ok.String(*v.ModelId) + } + + if v.ModelUnits != nil { + ok := object.Key("modelUnits") + ok.Integer(*v.ModelUnits) + } + + if v.ProvisionedModelName != nil { + ok := object.Key("provisionedModelName") + ok.String(*v.ProvisionedModelName) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteCustomModel struct { } @@ -281,6 +383,71 @@ func awsRestjson1_serializeOpHttpBindingsDeleteModelInvocationLoggingConfigurati return nil } +type awsRestjson1_serializeOpDeleteProvisionedModelThroughput struct { +} + +func (*awsRestjson1_serializeOpDeleteProvisionedModelThroughput) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteProvisionedModelThroughput) 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.(*DeleteProvisionedModelThroughputInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/provisioned-model-throughput/{provisionedModelId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteProvisionedModelThroughputInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteProvisionedModelThroughputInput(v *DeleteProvisionedModelThroughputInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProvisionedModelId == nil || len(*v.ProvisionedModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member provisionedModelId must not be empty")} + } + if v.ProvisionedModelId != nil { + if err := encoder.SetURI("provisionedModelId").String(*v.ProvisionedModelId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetCustomModel struct { } @@ -528,6 +695,71 @@ func awsRestjson1_serializeOpHttpBindingsGetModelInvocationLoggingConfigurationI return nil } +type awsRestjson1_serializeOpGetProvisionedModelThroughput struct { +} + +func (*awsRestjson1_serializeOpGetProvisionedModelThroughput) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetProvisionedModelThroughput) 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.(*GetProvisionedModelThroughputInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/provisioned-model-throughput/{provisionedModelId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetProvisionedModelThroughputInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetProvisionedModelThroughputInput(v *GetProvisionedModelThroughputInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProvisionedModelId == nil || len(*v.ProvisionedModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member provisionedModelId must not be empty")} + } + if v.ProvisionedModelId != nil { + if err := encoder.SetURI("provisionedModelId").String(*v.ProvisionedModelId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListCustomModels struct { } @@ -780,6 +1012,98 @@ func awsRestjson1_serializeOpHttpBindingsListModelCustomizationJobsInput(v *List return nil } +type awsRestjson1_serializeOpListProvisionedModelThroughputs struct { +} + +func (*awsRestjson1_serializeOpListProvisionedModelThroughputs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProvisionedModelThroughputs) 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.(*ListProvisionedModelThroughputsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/provisioned-model-throughputs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListProvisionedModelThroughputsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListProvisionedModelThroughputsInput(v *ListProvisionedModelThroughputsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CreationTimeAfter != nil { + encoder.SetQuery("creationTimeAfter").String(smithytime.FormatDateTime(*v.CreationTimeAfter)) + } + + if v.CreationTimeBefore != nil { + encoder.SetQuery("creationTimeBefore").String(smithytime.FormatDateTime(*v.CreationTimeBefore)) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.ModelArnEquals != nil { + encoder.SetQuery("modelArnEquals").String(*v.ModelArnEquals) + } + + if v.NameContains != nil { + encoder.SetQuery("nameContains").String(*v.NameContains) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.SortBy) > 0 { + encoder.SetQuery("sortBy").String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + encoder.SetQuery("sortOrder").String(string(v.SortOrder)) + } + + if len(v.StatusEquals) > 0 { + encoder.SetQuery("statusEquals").String(string(v.StatusEquals)) + } + + return nil +} + type awsRestjson1_serializeOpListTagsForResource struct { } @@ -1161,6 +1485,99 @@ func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, v return nil } +type awsRestjson1_serializeOpUpdateProvisionedModelThroughput struct { +} + +func (*awsRestjson1_serializeOpUpdateProvisionedModelThroughput) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateProvisionedModelThroughput) 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.(*UpdateProvisionedModelThroughputInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/provisioned-model-throughput/{provisionedModelId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateProvisionedModelThroughputInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateProvisionedModelThroughputInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateProvisionedModelThroughputInput(v *UpdateProvisionedModelThroughputInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProvisionedModelId == nil || len(*v.ProvisionedModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member provisionedModelId must not be empty")} + } + if v.ProvisionedModelId != nil { + if err := encoder.SetURI("provisionedModelId").String(*v.ProvisionedModelId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateProvisionedModelThroughputInput(v *UpdateProvisionedModelThroughputInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DesiredModelId != nil { + ok := object.Key("desiredModelId") + ok.String(*v.DesiredModelId) + } + + if v.DesiredProvisionedModelName != nil { + ok := object.Key("desiredProvisionedModelName") + ok.String(*v.DesiredProvisionedModelName) + } + + return nil +} + func awsRestjson1_serializeDocumentCloudWatchConfig(v *types.CloudWatchConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/bedrock/types/enums.go b/service/bedrock/types/enums.go index eadb41e16ab..f935b1703bd 100644 --- a/service/bedrock/types/enums.go +++ b/service/bedrock/types/enums.go @@ -2,6 +2,24 @@ package types +type CommitmentDuration string + +// Enum values for CommitmentDuration +const ( + CommitmentDurationOneMonth CommitmentDuration = "OneMonth" + CommitmentDurationSixMonths CommitmentDuration = "SixMonths" +) + +// Values returns all known values for CommitmentDuration. 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 (CommitmentDuration) Values() []CommitmentDuration { + return []CommitmentDuration{ + "OneMonth", + "SixMonths", + } +} + type FineTuningJobStatus string // Enum values for FineTuningJobStatus @@ -104,6 +122,44 @@ func (ModelModality) Values() []ModelModality { } } +type ProvisionedModelStatus string + +// Enum values for ProvisionedModelStatus +const ( + ProvisionedModelStatusCreating ProvisionedModelStatus = "Creating" + ProvisionedModelStatusInService ProvisionedModelStatus = "InService" + ProvisionedModelStatusUpdating ProvisionedModelStatus = "Updating" + ProvisionedModelStatusFailed ProvisionedModelStatus = "Failed" +) + +// Values returns all known values for ProvisionedModelStatus. 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 (ProvisionedModelStatus) Values() []ProvisionedModelStatus { + return []ProvisionedModelStatus{ + "Creating", + "InService", + "Updating", + "Failed", + } +} + +type SortByProvisionedModels string + +// Enum values for SortByProvisionedModels +const ( + SortByProvisionedModelsCreationTime SortByProvisionedModels = "CreationTime" +) + +// Values returns all known values for SortByProvisionedModels. 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 (SortByProvisionedModels) Values() []SortByProvisionedModels { + return []SortByProvisionedModels{ + "CreationTime", + } +} + type SortJobsBy string // Enum values for SortJobsBy diff --git a/service/bedrock/types/types.go b/service/bedrock/types/types.go index 0438c8657be..9b69c04f6b5 100644 --- a/service/bedrock/types/types.go +++ b/service/bedrock/types/types.go @@ -206,6 +206,68 @@ type OutputDataConfig struct { noSmithyDocumentSerde } +// Set of fields associated with a provisioned throughput. +type ProvisionedModelSummary struct { + + // The time that this provisioned throughput was created. + // + // This member is required. + CreationTime *time.Time + + // Desired model ARN. + // + // This member is required. + DesiredModelArn *string + + // Desired model units. + // + // This member is required. + DesiredModelUnits *int32 + + // Foundation model ARN. + // + // This member is required. + FoundationModelArn *string + + // The time that this provisioned throughput was last modified. + // + // This member is required. + LastModifiedTime *time.Time + + // The ARN of the model associated with this provisioned throughput. + // + // This member is required. + ModelArn *string + + // The number of model units allocated. + // + // This member is required. + ModelUnits *int32 + + // The ARN of the provisioned throughput. + // + // This member is required. + ProvisionedModelArn *string + + // The name of the provisioned throughput. + // + // This member is required. + ProvisionedModelName *string + + // Status of the provisioned throughput. + // + // This member is required. + Status ProvisionedModelStatus + + // Commitment duration for the provisioned throughput. + CommitmentDuration CommitmentDuration + + // Commitment expiration time for the provisioned throughput. + CommitmentExpirationTime *time.Time + + noSmithyDocumentSerde +} + // S3 configuration for storing log data. type S3Config struct { diff --git a/service/bedrock/validators.go b/service/bedrock/validators.go index 8a67d1a1df4..f266db6c732 100644 --- a/service/bedrock/validators.go +++ b/service/bedrock/validators.go @@ -30,6 +30,26 @@ func (m *validateOpCreateModelCustomizationJob) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpCreateProvisionedModelThroughput struct { +} + +func (*validateOpCreateProvisionedModelThroughput) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateProvisionedModelThroughput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateProvisionedModelThroughputInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateProvisionedModelThroughputInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteCustomModel struct { } @@ -50,6 +70,26 @@ func (m *validateOpDeleteCustomModel) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDeleteProvisionedModelThroughput struct { +} + +func (*validateOpDeleteProvisionedModelThroughput) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteProvisionedModelThroughput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteProvisionedModelThroughputInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteProvisionedModelThroughputInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetCustomModel struct { } @@ -110,6 +150,26 @@ func (m *validateOpGetModelCustomizationJob) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpGetProvisionedModelThroughput struct { +} + +func (*validateOpGetProvisionedModelThroughput) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetProvisionedModelThroughput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetProvisionedModelThroughputInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetProvisionedModelThroughputInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -210,14 +270,42 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateProvisionedModelThroughput struct { +} + +func (*validateOpUpdateProvisionedModelThroughput) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateProvisionedModelThroughput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateProvisionedModelThroughputInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateProvisionedModelThroughputInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpCreateModelCustomizationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateModelCustomizationJob{}, middleware.After) } +func addOpCreateProvisionedModelThroughputValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateProvisionedModelThroughput{}, middleware.After) +} + func addOpDeleteCustomModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCustomModel{}, middleware.After) } +func addOpDeleteProvisionedModelThroughputValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProvisionedModelThroughput{}, middleware.After) +} + func addOpGetCustomModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetCustomModel{}, middleware.After) } @@ -230,6 +318,10 @@ func addOpGetModelCustomizationJobValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpGetModelCustomizationJob{}, middleware.After) } +func addOpGetProvisionedModelThroughputValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetProvisionedModelThroughput{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -250,6 +342,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateProvisionedModelThroughputValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateProvisionedModelThroughput{}, middleware.After) +} + func validateCloudWatchConfig(v *types.CloudWatchConfig) error { if v == nil { return nil @@ -505,6 +601,32 @@ func validateOpCreateModelCustomizationJobInput(v *CreateModelCustomizationJobIn } } +func validateOpCreateProvisionedModelThroughputInput(v *CreateProvisionedModelThroughputInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateProvisionedModelThroughputInput"} + if v.ModelUnits == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelUnits")) + } + if v.ProvisionedModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProvisionedModelName")) + } + if v.ModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelId")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteCustomModelInput(v *DeleteCustomModelInput) error { if v == nil { return nil @@ -520,6 +642,21 @@ func validateOpDeleteCustomModelInput(v *DeleteCustomModelInput) error { } } +func validateOpDeleteProvisionedModelThroughputInput(v *DeleteProvisionedModelThroughputInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteProvisionedModelThroughputInput"} + if v.ProvisionedModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProvisionedModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetCustomModelInput(v *GetCustomModelInput) error { if v == nil { return nil @@ -565,6 +702,21 @@ func validateOpGetModelCustomizationJobInput(v *GetModelCustomizationJobInput) e } } +func validateOpGetProvisionedModelThroughputInput(v *GetProvisionedModelThroughputInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetProvisionedModelThroughputInput"} + if v.ProvisionedModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProvisionedModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -653,3 +805,18 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { return nil } } + +func validateOpUpdateProvisionedModelThroughputInput(v *UpdateProvisionedModelThroughputInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateProvisionedModelThroughputInput"} + if v.ProvisionedModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProvisionedModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/bedrockruntime/api_op_InvokeModel.go b/service/bedrockruntime/api_op_InvokeModel.go index a9a1989c07b..564dd601ef4 100644 --- a/service/bedrockruntime/api_op_InvokeModel.go +++ b/service/bedrockruntime/api_op_InvokeModel.go @@ -17,9 +17,9 @@ import ( // Invokes the specified Bedrock model to run inference using the input provided // in the request body. You use InvokeModel to run inference for text models, image -// models, and embedding models. For more information about invoking models, see -// Using the API in the Bedrock User Guide (https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf) -// . For example requests, see Examples (after the Errors section). +// models, and embedding models. For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) +// in the Bedrock User Guide. For example requests, see Examples (after the Errors +// section). func (c *Client) InvokeModel(ctx context.Context, params *InvokeModelInput, optFns ...func(*Options)) (*InvokeModelOutput, error) { if params == nil { params = &InvokeModelInput{} diff --git a/service/bedrockruntime/api_op_InvokeModelWithResponseStream.go b/service/bedrockruntime/api_op_InvokeModelWithResponseStream.go index 89be927329a..da40eed3821 100644 --- a/service/bedrockruntime/api_op_InvokeModelWithResponseStream.go +++ b/service/bedrockruntime/api_op_InvokeModelWithResponseStream.go @@ -19,9 +19,9 @@ import ( ) // Invoke the specified Bedrock model to run inference using the input provided. -// Return the response in a stream. For more information about invoking models, see -// Using the API in the Bedrock User Guide (https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf) -// . For an example request and response, see Examples (after the Errors section). +// Return the response in a stream. For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) +// in the Bedrock User Guide. For an example request and response, see Examples +// (after the Errors section). func (c *Client) InvokeModelWithResponseStream(ctx context.Context, params *InvokeModelWithResponseStreamInput, optFns ...func(*Options)) (*InvokeModelWithResponseStreamOutput, error) { if params == nil { params = &InvokeModelWithResponseStreamInput{} diff --git a/service/bedrockruntime/deserializers.go b/service/bedrockruntime/deserializers.go index 28390199591..6d3e3531340 100644 --- a/service/bedrockruntime/deserializers.go +++ b/service/bedrockruntime/deserializers.go @@ -343,6 +343,9 @@ func awsRestjson1_deserializeEventStreamExceptionResponseStream(msg *eventstream case strings.EqualFold("modelStreamErrorException", exceptionType.String()): return awsRestjson1_deserializeEventMessageExceptionModelStreamErrorException(msg) + case strings.EqualFold("modelTimeoutException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionModelTimeoutException(msg) + case strings.EqualFold("throttlingException", exceptionType.String()): return awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg) @@ -557,6 +560,41 @@ func awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg *event return v } +func awsRestjson1_deserializeEventMessageExceptionModelTimeoutException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.ModelTimeoutException{} + if err := awsRestjson1_deserializeDocumentModelTimeoutException(&v, shape); err != nil { + 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 + } + + } + return v +} + func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -659,6 +697,46 @@ func awsRestjson1_deserializeDocumentModelStreamErrorException(v **types.ModelSt return nil } +func awsRestjson1_deserializeDocumentModelTimeoutException(v **types.ModelTimeoutException, 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.ModelTimeoutException + if *v == nil { + sv = &types.ModelTimeoutException{} + } 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 NonBlankString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPayloadPart(v **types.PayloadPart, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1285,46 +1363,6 @@ func awsRestjson1_deserializeDocumentModelNotReadyException(v **types.ModelNotRe return nil } -func awsRestjson1_deserializeDocumentModelTimeoutException(v **types.ModelTimeoutException, 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.ModelTimeoutException - if *v == nil { - sv = &types.ModelTimeoutException{} - } 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 NonBlankString to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index fb13d0bd873..d8413390f79 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -3563,6 +3563,14 @@ const ( InstanceTypeC7i24xlarge InstanceType = "c7i.24xlarge" InstanceTypeC7i48xlarge InstanceType = "c7i.48xlarge" InstanceTypeMac2M2proMetal InstanceType = "mac2-m2pro.metal" + InstanceTypeR7izLarge InstanceType = "r7iz.large" + InstanceTypeR7izXlarge InstanceType = "r7iz.xlarge" + InstanceTypeR7iz2xlarge InstanceType = "r7iz.2xlarge" + InstanceTypeR7iz4xlarge InstanceType = "r7iz.4xlarge" + InstanceTypeR7iz8xlarge InstanceType = "r7iz.8xlarge" + InstanceTypeR7iz12xlarge InstanceType = "r7iz.12xlarge" + InstanceTypeR7iz16xlarge InstanceType = "r7iz.16xlarge" + InstanceTypeR7iz32xlarge InstanceType = "r7iz.32xlarge" ) // Values returns all known values for InstanceType. Note that this can be @@ -4311,6 +4319,14 @@ func (InstanceType) Values() []InstanceType { "c7i.24xlarge", "c7i.48xlarge", "mac2-m2pro.metal", + "r7iz.large", + "r7iz.xlarge", + "r7iz.2xlarge", + "r7iz.4xlarge", + "r7iz.8xlarge", + "r7iz.12xlarge", + "r7iz.16xlarge", + "r7iz.32xlarge", } } diff --git a/service/licensemanagerusersubscriptions/internal/endpoints/endpoints.go b/service/licensemanagerusersubscriptions/internal/endpoints/endpoints.go index 2d17e845314..9f449df0bf7 100644 --- a/service/licensemanagerusersubscriptions/internal/endpoints/endpoints.go +++ b/service/licensemanagerusersubscriptions/internal/endpoints/endpoints.go @@ -157,6 +157,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, @@ -166,12 +169,18 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/managedblockchain/api_op_CreateNode.go b/service/managedblockchain/api_op_CreateNode.go index 40c71353547..5613bab3959 100644 --- a/service/managedblockchain/api_op_CreateNode.go +++ b/service/managedblockchain/api_op_CreateNode.go @@ -48,7 +48,6 @@ type CreateNodeInput struct { // have the following NetworkId s: // - n-ethereum-mainnet // - n-ethereum-goerli - // - n-ethereum-rinkeby // // This member is required. NetworkId *string diff --git a/service/managedblockchain/api_op_DeleteNode.go b/service/managedblockchain/api_op_DeleteNode.go index 1f01c0b3eac..d4fe2b4d1d7 100644 --- a/service/managedblockchain/api_op_DeleteNode.go +++ b/service/managedblockchain/api_op_DeleteNode.go @@ -38,7 +38,6 @@ type DeleteNodeInput struct { // networks have the following NetworkId s: // - n-ethereum-mainnet // - n-ethereum-goerli - // - n-ethereum-rinkeby // // This member is required. NetworkId *string diff --git a/service/managedblockchain/types/types.go b/service/managedblockchain/types/types.go index f71b02b92af..1e8eb141d87 100644 --- a/service/managedblockchain/types/types.go +++ b/service/managedblockchain/types/types.go @@ -472,7 +472,6 @@ type NetworkEthereumAttributes struct { // follows: // - mainnet = 1 // - goerli = 5 - // - rinkeby = 4 ChainId *string noSmithyDocumentSerde diff --git a/service/rds/api_op_DescribeCertificates.go b/service/rds/api_op_DescribeCertificates.go index fbd521eba5d..b59883a5f6c 100644 --- a/service/rds/api_op_DescribeCertificates.go +++ b/service/rds/api_op_DescribeCertificates.go @@ -16,9 +16,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the set of CA certificates provided by Amazon RDS for this Amazon Web -// Services account. For more information, see Using SSL/TLS to encrypt a -// connection to a DB instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html) +// Lists the set of certificate authority (CA) certificates provided by Amazon RDS +// for this Amazon Web Services account. For more information, see Using SSL/TLS +// to encrypt a connection to a DB instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html) // in the Amazon RDS User Guide and Using SSL/TLS to encrypt a connection to a DB // cluster (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html) // in the Amazon Aurora User Guide. @@ -68,6 +68,12 @@ type DescribeCertificatesOutput struct { // The list of Certificate objects for the Amazon Web Services account. Certificates []types.Certificate + // The default root CA for new databases created by your Amazon Web Services + // account. This is either the root CA override set on your Amazon Web Services + // account or the system default CA for the Region if no override exists. To + // override the default CA, use the ModifyCertificates operation. + DefaultCertificateForNewLaunches *string + // An optional pagination token provided by a previous DescribeCertificates // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . diff --git a/service/rds/api_op_ModifyDBCluster.go b/service/rds/api_op_ModifyDBCluster.go index d9032b6fc0c..4f3227b86b2 100644 --- a/service/rds/api_op_ModifyDBCluster.go +++ b/service/rds/api_op_ModifyDBCluster.go @@ -60,7 +60,7 @@ type ModifyDBClusterInput struct { AllowEngineModeChange bool // Specifies whether major version upgrades are allowed. Valid for Cluster Type: - // Aurora DB clusters only Constraints: + // Aurora DB clusters and Multi-AZ DB clusters Constraints: // - You must allow major version upgrades when specifying a value for the // EngineVersion parameter that is a different major version than the DB // cluster's current version. diff --git a/service/rds/api_op_ModifyDBInstance.go b/service/rds/api_op_ModifyDBInstance.go index dcdd0259fe2..5bdefcd3e56 100644 --- a/service/rds/api_op_ModifyDBInstance.go +++ b/service/rds/api_op_ModifyDBInstance.go @@ -155,7 +155,12 @@ type ModifyDBInstanceInput struct { // and DB instance class support for RDS Custom for SQL Server (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-reqs-limits-MS.html#custom-reqs-limits.instancesMS) // . If you modify the DB instance class, an outage occurs during the change. The // change is applied during the next maintenance window, unless you specify - // ApplyImmediately in your request. Default: Uses existing setting + // ApplyImmediately in your request. Default: Uses existing setting Constraints: + // - If you are modifying the DB instance class and upgrading the engine version + // at the same time, the currently running engine version must be supported on the + // specified DB instance class. Otherwise, the operation returns an error. In this + // case, first run the operation to modify the DB instance class, and then run it + // again to upgrade the engine version. DBInstanceClass *string // The name of the DB parameter group to apply to the DB instance. Changing this @@ -313,7 +318,12 @@ type ModifyDBInstanceInput struct { // you're modifying is acting as a read replica, the engine version that you // specify must be the same or higher than the version that the source DB instance // or cluster is running. In RDS Custom for Oracle, this parameter is supported for - // read replicas only if they are in the PATCH_DB_FAILURE lifecycle. + // read replicas only if they are in the PATCH_DB_FAILURE lifecycle. Constraints: + // - If you are upgrading the engine version and modifying the DB instance class + // at the same time, the currently running engine version must be supported on the + // specified DB instance class. Otherwise, the operation returns an error. In this + // case, first run the operation to modify the DB instance class, and then run it + // again to upgrade the engine version. EngineVersion *string // The new Provisioned IOPS (I/O operations per second) value for the RDS diff --git a/service/rds/api_op_RestoreDBClusterToPointInTime.go b/service/rds/api_op_RestoreDBClusterToPointInTime.go index 8a15776f548..77260332647 100644 --- a/service/rds/api_op_RestoreDBClusterToPointInTime.go +++ b/service/rds/api_op_RestoreDBClusterToPointInTime.go @@ -78,9 +78,9 @@ type RestoreDBClusterToPointInTimeInput struct { // in the Amazon RDS User Guide. Valid for: Multi-AZ DB clusters only DBClusterInstanceClass *string - // The name of the DB cluster parameter group to associate with this DB cluster. - // If this argument is omitted, the default DB cluster parameter group for the - // specified engine is used. Constraints: + // The name of the custom DB cluster parameter group to associate with this DB + // cluster. If the DBClusterParameterGroupName parameter is omitted, the default + // DB cluster parameter group for the specified engine is used. Constraints: // - If supplied, must match the name of an existing DB cluster parameter group. // - Must be 1 to 255 letters, numbers, or hyphens. // - First character must be a letter. diff --git a/service/rds/api_op_RestoreDBInstanceToPointInTime.go b/service/rds/api_op_RestoreDBInstanceToPointInTime.go index 3ecb8a60255..a2f695606d0 100644 --- a/service/rds/api_op_RestoreDBInstanceToPointInTime.go +++ b/service/rds/api_op_RestoreDBInstanceToPointInTime.go @@ -45,10 +45,10 @@ func (c *Client) RestoreDBInstanceToPointInTime(ctx context.Context, params *Res type RestoreDBInstanceToPointInTimeInput struct { - // The name of the new DB instance to be created. Constraints: - // - Must contain from 1 to 63 letters, numbers, or hyphens - // - First character must be a letter - // - Can't end with a hyphen or contain two consecutive hyphens + // The name of the new DB instance to create. Constraints: + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // - First character must be a letter. + // - Can't end with a hyphen or contain two consecutive hyphens. // // This member is required. TargetDBInstanceIdentifier *string @@ -59,15 +59,16 @@ type RestoreDBInstanceToPointInTimeInput struct { // succeed. You can also allocate additional storage for future growth. AllocatedStorage *int32 - // A value that indicates whether minor version upgrades are applied automatically - // to the DB instance during the maintenance window. This setting doesn't apply to - // RDS Custom. + // Specifies whether minor version upgrades are applied automatically to the DB + // instance during the maintenance window. This setting doesn't apply to RDS + // Custom. AutoMinorVersionUpgrade *bool // The Availability Zone (AZ) where the DB instance will be created. Default: A - // random, system-chosen Availability Zone. Constraint: You can't specify the - // AvailabilityZone parameter if the DB instance is a Multi-AZ deployment. Example: - // us-east-1a + // random, system-chosen Availability Zone. Constraints: + // - You can't specify the AvailabilityZone parameter if the DB instance is a + // Multi-AZ deployment. + // Example: us-east-1a AvailabilityZone *string // Specifies where automated backups and manual snapshots are stored for the @@ -77,8 +78,8 @@ type RestoreDBInstanceToPointInTimeInput struct { // in the Amazon RDS User Guide. BackupTarget *string - // A value that indicates whether to copy all tags from the restored DB instance - // to snapshots of the DB instance. By default, tags are not copied. + // Specifies whether to copy all tags from the restored DB instance to snapshots + // of the DB instance. By default, tags are not copied. CopyTagsToSnapshot *bool // The instance profile associated with the underlying Amazon EC2 instance of an @@ -98,8 +99,8 @@ type RestoreDBInstanceToPointInTimeInput struct { // db.m4.large. Not all DB instance classes are available in all Amazon Web // Services Regions, or for all database engines. For the full list of DB instance // classes, and availability for your engine, see DB Instance Class (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) - // in the Amazon RDS User Guide. Default: The same DBInstanceClass as the original - // DB instance. + // in the Amazon RDS User Guide. Default: The same DB instance class as the + // original DB instance. DBInstanceClass *string // The database name for the restored DB instance. This parameter isn't supported @@ -110,28 +111,28 @@ type RestoreDBInstanceToPointInTimeInput struct { // do not specify a value for DBParameterGroupName , then the default // DBParameterGroup for the specified DB engine is used. This setting doesn't apply // to RDS Custom. Constraints: - // - If supplied, must match the name of an existing DBParameterGroup. + // - If supplied, must match the name of an existing DB parameter group. // - Must be 1 to 255 letters, numbers, or hyphens. // - First character must be a letter. // - Can't end with a hyphen or contain two consecutive hyphens. DBParameterGroupName *string - // The DB subnet group name to use for the new instance. Constraints: If supplied, - // must match the name of an existing DBSubnetGroup. Example: mydbsubnetgroup + // The DB subnet group name to use for the new instance. Constraints: + // - If supplied, must match the name of an existing DB subnet group. + // Example: mydbsubnetgroup DBSubnetGroupName *string - // A value that indicates whether the DB instance has deletion protection enabled. - // The database can't be deleted when deletion protection is enabled. By default, - // deletion protection isn't enabled. For more information, see Deleting a DB - // Instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html) + // Specifies whether the DB instance has deletion protection enabled. The database + // can't be deleted when deletion protection is enabled. By default, deletion + // protection isn't enabled. For more information, see Deleting a DB Instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html) // . DeletionProtection *bool - // Specify the Active Directory directory ID to restore the DB instance in. Create - // the domain before running this command. Currently, you can create only the - // MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances in an Active - // Directory Domain. This setting doesn't apply to RDS Custom. For more - // information, see Kerberos Authentication (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html) + // The Active Directory directory ID to restore the DB instance in. Create the + // domain before running this command. Currently, you can create only the MySQL, + // Microsoft SQL Server, Oracle, and PostgreSQL DB instances in an Active Directory + // Domain. This setting doesn't apply to RDS Custom. For more information, see + // Kerberos Authentication (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html) // in the Amazon RDS User Guide. Domain *string @@ -173,29 +174,28 @@ type RestoreDBInstanceToPointInTimeInput struct { // in the Amazon RDS User Guide. This setting doesn't apply to RDS Custom. EnableCloudwatchLogsExports []string - // A value that indicates whether to enable a customer-owned IP address (CoIP) for - // an RDS on Outposts DB instance. A CoIP provides local or external connectivity - // to resources in your Outpost subnets through your on-premises network. For some - // use cases, a CoIP can provide lower latency for connections to the DB instance - // from outside of its virtual private cloud (VPC) on your local network. This - // setting doesn't apply to RDS Custom. For more information about RDS on Outposts, - // see Working with Amazon RDS on Amazon Web Services Outposts (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html) + // Specifies whether to enable a customer-owned IP address (CoIP) for an RDS on + // Outposts DB instance. A CoIP provides local or external connectivity to + // resources in your Outpost subnets through your on-premises network. For some use + // cases, a CoIP can provide lower latency for connections to the DB instance from + // outside of its virtual private cloud (VPC) on your local network. This setting + // doesn't apply to RDS Custom. For more information about RDS on Outposts, see + // Working with Amazon RDS on Amazon Web Services Outposts (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html) // in the Amazon RDS User Guide. For more information about CoIPs, see // Customer-owned IP addresses (https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing) // in the Amazon Web Services Outposts User Guide. EnableCustomerOwnedIp *bool - // A value that indicates whether to enable mapping of Amazon Web Services - // Identity and Access Management (IAM) accounts to database accounts. By default, - // mapping isn't enabled. This setting doesn't apply to RDS Custom. For more - // information about IAM database authentication, see IAM Database Authentication - // for MySQL and PostgreSQL (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. This setting doesn't apply to RDS Custom. For more information about + // IAM database authentication, see IAM Database Authentication for MySQL and + // PostgreSQL (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) // in the Amazon RDS User Guide. EnableIAMDatabaseAuthentication *bool // The database engine to use for the new instance. This setting doesn't apply to - // RDS Custom. Default: The same as source Constraint: Must be compatible with the - // engine of the source Valid Values: + // RDS Custom. Valid Values: // - mariadb // - mysql // - oracle-ee @@ -207,17 +207,19 @@ type RestoreDBInstanceToPointInTimeInput struct { // - sqlserver-se // - sqlserver-ex // - sqlserver-web + // Default: The same as source Constraints: + // - Must be compatible with the engine of the source. Engine *string - // The amount of Provisioned IOPS (input/output operations per second) to be - // initially allocated for the DB instance. Constraints: Must be an integer greater - // than 1000. SQL Server Setting the IOPS value for the SQL Server database engine - // isn't supported. + // The amount of Provisioned IOPS (input/output operations per second) to + // initially allocate for the DB instance. This setting doesn't apply to SQL + // Server. Constraints: + // - Must be an integer greater than 1000. Iops *int32 - // License model information for the restored DB instance. This setting doesn't - // apply to RDS Custom. Default: Same as source. Valid values: license-included | - // bring-your-own-license | general-public-license + // The license model information for the restored DB instance. This setting + // doesn't apply to RDS Custom. Valid Values: license-included | + // bring-your-own-license | general-public-license Default: Same as the source. LicenseModel *string // The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale @@ -227,57 +229,58 @@ type RestoreDBInstanceToPointInTimeInput struct { // in the Amazon RDS User Guide. This setting doesn't apply to RDS Custom. MaxAllocatedStorage *int32 - // A value that indicates whether the DB instance is a Multi-AZ deployment. This - // setting doesn't apply to RDS Custom. Constraint: You can't specify the - // AvailabilityZone parameter if the DB instance is a Multi-AZ deployment. + // Secifies whether the DB instance is a Multi-AZ deployment. This setting doesn't + // apply to RDS Custom. Constraints: + // - You can't specify the AvailabilityZone parameter if the DB instance is a + // Multi-AZ deployment. MultiAZ *bool - // The network type of the DB instance. Valid values: + // The network type of the DB instance. The network type is determined by the + // DBSubnetGroup specified for the DB instance. A DBSubnetGroup can support only + // the IPv4 protocol or the IPv4 and the IPv6 protocols ( DUAL ). For more + // information, see Working with a DB instance in a VPC (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html) + // in the Amazon RDS User Guide. Valid Values: // - IPV4 // - DUAL - // The network type is determined by the DBSubnetGroup specified for the DB - // instance. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and - // the IPv6 protocols ( DUAL ). For more information, see Working with a DB - // instance in a VPC (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html) - // in the Amazon RDS User Guide. NetworkType *string - // The name of the option group to be used for the restored DB instance. Permanent + // The name of the option group to use for the restored DB instance. Permanent // options, such as the TDE option for Oracle Advanced Security TDE, can't be // removed from an option group, and that option group can't be removed from a DB // instance after it is associated with a DB instance This setting doesn't apply to // RDS Custom. OptionGroupName *string - // The port number on which the database accepts connections. Constraints: Value - // must be 1150-65535 Default: The same port as the original DB instance. + // The port number on which the database accepts connections. Default: The same + // port as the original DB instance. Constraints: + // - The value must be 1150-65535 . Port *int32 // The number of CPU cores and the number of threads per core for the DB instance // class of the DB instance. This setting doesn't apply to RDS Custom. ProcessorFeatures []types.ProcessorFeature - // A value that indicates whether the DB instance is publicly accessible. When the - // DB cluster is publicly accessible, its Domain Name System (DNS) endpoint - // resolves to the private IP address from within the DB cluster's virtual private - // cloud (VPC). It resolves to the public IP address from outside of the DB - // cluster's VPC. Access to the DB cluster is ultimately controlled by the security - // group it uses. That public access isn't permitted if the security group assigned - // to the DB cluster doesn't permit it. When the DB instance isn't publicly - // accessible, it is an internal DB instance with a DNS name that resolves to a - // private IP address. For more information, see CreateDBInstance . + // Specifies whether the DB instance is publicly accessible. When the DB cluster + // is publicly accessible, its Domain Name System (DNS) endpoint resolves to the + // private IP address from within the DB cluster's virtual private cloud (VPC). It + // resolves to the public IP address from outside of the DB cluster's VPC. Access + // to the DB cluster is ultimately controlled by the security group it uses. That + // public access isn't permitted if the security group assigned to the DB cluster + // doesn't permit it. When the DB instance isn't publicly accessible, it is an + // internal DB instance with a DNS name that resolves to a private IP address. For + // more information, see CreateDBInstance . PubliclyAccessible *bool - // The date and time to restore from. Valid Values: Value must be a time in - // Universal Coordinated Time (UTC) format Constraints: - // - Must be before the latest restorable time for the DB instance - // - Can't be specified if the UseLatestRestorableTime parameter is enabled + // The date and time to restore from. Constraints: + // - Must be a time in Universal Coordinated Time (UTC) format. + // - Must be before the latest restorable time for the DB instance. + // - Can't be specified if the UseLatestRestorableTime parameter is enabled. // Example: 2009-09-07T23:45:00Z RestoreTime *time.Time // The Amazon Resource Name (ARN) of the replicated automated backups from which // to restore, for example, - // arn:aws:rds:useast-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE . + // arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE . // This setting doesn't apply to RDS Custom. SourceDBInstanceAutomatedBackupsArn *string @@ -288,14 +291,15 @@ type RestoreDBInstanceToPointInTimeInput struct { // The resource ID of the source DB instance from which to restore. SourceDbiResourceId *string - // Specifies the storage throughput value for the DB instance. This setting - // doesn't apply to RDS Custom or Amazon Aurora. + // The storage throughput value for the DB instance. This setting doesn't apply to + // RDS Custom or Amazon Aurora. StorageThroughput *int32 - // Specifies the storage type to be associated with the DB instance. Valid values: - // gp2 | gp3 | io1 | standard If you specify io1 or gp3 , you must also include a - // value for the Iops parameter. Default: io1 if the Iops parameter is specified, - // otherwise gp2 + // The storage type to associate with the DB instance. Valid Values: gp2 | gp3 | + // io1 | standard Default: io1 , if the Iops parameter is specified. Otherwise, gp2 + // . Constraints: + // - If you specify io1 or gp3 , you must also include a value for the Iops + // parameter. StorageType *string // A list of tags. For more information, see Tagging Amazon RDS Resources (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html) @@ -314,9 +318,10 @@ type RestoreDBInstanceToPointInTimeInput struct { // its default processor features. This setting doesn't apply to RDS Custom. UseDefaultProcessorFeatures *bool - // A value that indicates whether the DB instance is restored from the latest - // backup time. By default, the DB instance isn't restored from the latest backup - // time. Constraints: Can't be specified if the RestoreTime parameter is provided. + // Specifies whether the DB instance is restored from the latest backup time. By + // default, the DB instance isn't restored from the latest backup time. + // Constraints: + // - Can't be specified if the RestoreTime parameter is provided. UseLatestRestorableTime bool // A list of EC2 VPC security groups to associate with this DB instance. Default: diff --git a/service/rds/deserializers.go b/service/rds/deserializers.go index 2fd4cc06a1c..0243c6b714f 100644 --- a/service/rds/deserializers.go +++ b/service/rds/deserializers.go @@ -50787,6 +50787,19 @@ func awsAwsquery_deserializeOpDocumentDescribeCertificatesOutput(v **DescribeCer return err } + case strings.EqualFold("DefaultCertificateForNewLaunches", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DefaultCertificateForNewLaunches = ptr.String(xtv) + } + case strings.EqualFold("Marker", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/resourceexplorer2/internal/endpoints/endpoints.go b/service/resourceexplorer2/internal/endpoints/endpoints.go index f72fdd0d7d7..31d0347532a 100644 --- a/service/resourceexplorer2/internal/endpoints/endpoints.go +++ b/service/resourceexplorer2/internal/endpoints/endpoints.go @@ -174,6 +174,11 @@ var defaultPartitions = endpoints.Partitions{ }: endpoints.Endpoint{ Hostname: "resource-explorer-2.ap-southeast-2.api.aws", }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ap-southeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{ @@ -219,6 +224,11 @@ var defaultPartitions = endpoints.Partitions{ }: endpoints.Endpoint{ Hostname: "resource-explorer-2.il-central-1.api.aws", }, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.me-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{ diff --git a/service/sso/endpoints.go b/service/sso/endpoints.go index 9b11d0007ab..6a2c7eb3e10 100644 --- a/service/sso/endpoints.go +++ b/service/sso/endpoints.go @@ -411,6 +411,25 @@ func (r *resolver) ResolveEndpoint( } if _UseFIPS == true { if true == _PartitionResult.SupportsFIPS { + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + 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 + } uriString := func() string { var out strings.Builder out.WriteString("https://portal.sso-fips.") diff --git a/service/sso/endpoints_test.go b/service/sso/endpoints_test.go index 3cc41b8b1b8..9ffa291ace2 100644 --- a/service/sso/endpoints_test.go +++ b/service/sso/endpoints_test.go @@ -1161,7 +1161,7 @@ func TestEndpointCase29(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://portal.sso-fips.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://portal.sso.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, diff --git a/service/sts/endpoints_test.go b/service/sts/endpoints_test.go index d661de561a1..350460fd99c 100644 --- a/service/sts/endpoints_test.go +++ b/service/sts/endpoints_test.go @@ -1999,10 +1999,10 @@ func TestEndpointCase53(t *testing.T) { // UseGlobalEndpoint with legacy region `ap-northeast-1` func TestEndpointCase54(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("ap-northeast-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2022,9 +2022,9 @@ func TestEndpointCase54(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2049,10 +2049,10 @@ func TestEndpointCase54(t *testing.T) { // UseGlobalEndpoint with legacy region `ap-south-1` func TestEndpointCase55(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("ap-south-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2072,9 +2072,9 @@ func TestEndpointCase55(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2099,10 +2099,10 @@ func TestEndpointCase55(t *testing.T) { // UseGlobalEndpoint with legacy region `ap-southeast-1` func TestEndpointCase56(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("ap-southeast-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2122,9 +2122,9 @@ func TestEndpointCase56(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2149,10 +2149,10 @@ func TestEndpointCase56(t *testing.T) { // UseGlobalEndpoint with legacy region `ap-southeast-2` func TestEndpointCase57(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("ap-southeast-2"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2172,9 +2172,9 @@ func TestEndpointCase57(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2199,10 +2199,10 @@ func TestEndpointCase57(t *testing.T) { // UseGlobalEndpoint with legacy region `aws-global` func TestEndpointCase58(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("aws-global"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2222,9 +2222,9 @@ func TestEndpointCase58(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2249,10 +2249,10 @@ func TestEndpointCase58(t *testing.T) { // UseGlobalEndpoint with legacy region `ca-central-1` func TestEndpointCase59(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("ca-central-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2272,9 +2272,9 @@ func TestEndpointCase59(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2299,10 +2299,10 @@ func TestEndpointCase59(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-central-1` func TestEndpointCase60(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("eu-central-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2322,9 +2322,9 @@ func TestEndpointCase60(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2349,10 +2349,10 @@ func TestEndpointCase60(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-north-1` func TestEndpointCase61(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("eu-north-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2372,9 +2372,9 @@ func TestEndpointCase61(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2399,10 +2399,10 @@ func TestEndpointCase61(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-west-1` func TestEndpointCase62(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2422,9 +2422,9 @@ func TestEndpointCase62(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2449,10 +2449,10 @@ func TestEndpointCase62(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-west-2` func TestEndpointCase63(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-2"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2472,9 +2472,9 @@ func TestEndpointCase63(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2499,10 +2499,10 @@ func TestEndpointCase63(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-west-3` func TestEndpointCase64(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-3"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2522,9 +2522,9 @@ func TestEndpointCase64(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2549,10 +2549,10 @@ func TestEndpointCase64(t *testing.T) { // UseGlobalEndpoint with legacy region `sa-east-1` func TestEndpointCase65(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("sa-east-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2572,9 +2572,9 @@ func TestEndpointCase65(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2599,10 +2599,10 @@ func TestEndpointCase65(t *testing.T) { // UseGlobalEndpoint with legacy region `us-east-1` func TestEndpointCase66(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2622,9 +2622,9 @@ func TestEndpointCase66(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2649,10 +2649,10 @@ func TestEndpointCase66(t *testing.T) { // UseGlobalEndpoint with legacy region `us-east-2` func TestEndpointCase67(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-2"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2672,9 +2672,9 @@ func TestEndpointCase67(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2699,10 +2699,10 @@ func TestEndpointCase67(t *testing.T) { // UseGlobalEndpoint with legacy region `us-west-1` func TestEndpointCase68(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("us-west-1"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2722,9 +2722,9 @@ func TestEndpointCase68(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2749,10 +2749,10 @@ func TestEndpointCase68(t *testing.T) { // UseGlobalEndpoint with legacy region `us-west-2` func TestEndpointCase69(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("us-west-2"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2772,9 +2772,9 @@ func TestEndpointCase69(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-1", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2799,10 +2799,10 @@ func TestEndpointCase69(t *testing.T) { // UseGlobalEndpoint with Non-legacy region `us-east-3` func TestEndpointCase70(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-3"), - UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2822,9 +2822,9 @@ func TestEndpointCase70(t *testing.T) { var properties smithy.Properties properties.Set("authSchemes", []interface{}{ map[string]interface{}{ - "name": "sigv4", "signingRegion": "us-east-3", "signingName": "sts", + "name": "sigv4", }, }) return properties @@ -2849,10 +2849,10 @@ func TestEndpointCase70(t *testing.T) { // UseGlobalEndpoint with legacy region and custom endpoint func TestEndpointCase71(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(true), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Region: ptr.String("us-west-1"), - UseGlobalEndpoint: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -2890,10 +2890,10 @@ func TestEndpointCase71(t *testing.T) { // UseGlobalEndpoint with unset region and custom endpoint func TestEndpointCase72(t *testing.T) { var params = EndpointParameters{ + UseGlobalEndpoint: ptr.Bool(false), UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), - UseGlobalEndpoint: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() diff --git a/service/transfer/api_op_CreateAccess.go b/service/transfer/api_op_CreateAccess.go index 3b09d1f558b..85a594d1352 100644 --- a/service/transfer/api_op_CreateAccess.go +++ b/service/transfer/api_op_CreateAccess.go @@ -71,7 +71,8 @@ type CreateAccessInput struct { ServerId *string // The landing directory (folder) for a user when they log in to the server using - // the client. A HomeDirectory example is /bucket_name/home/mydirectory . + // the client. A HomeDirectory example is /bucket_name/home/mydirectory . The + // HomeDirectory parameter is only used if HomeDirectoryType is set to LOGICAL . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and @@ -92,10 +93,14 @@ type CreateAccessInput struct { // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see - // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol - // clients. If you set it LOGICAL , you need to provide mappings in the + // the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer + // protocol clients. If you set it to LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths - // visible to your users. + // visible to your users. If HomeDirectoryType is LOGICAL , you must provide + // mappings, using the HomeDirectoryMappings parameter. If, on the other hand, + // HomeDirectoryType is PATH , you provide an absolute path using the HomeDirectory + // parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your + // template. HomeDirectoryType types.HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access diff --git a/service/transfer/api_op_CreateUser.go b/service/transfer/api_op_CreateUser.go index 795321e3385..f7f569b1795 100644 --- a/service/transfer/api_op_CreateUser.go +++ b/service/transfer/api_op_CreateUser.go @@ -67,7 +67,8 @@ type CreateUserInput struct { UserName *string // The landing directory (folder) for a user when they log in to the server using - // the client. A HomeDirectory example is /bucket_name/home/mydirectory . + // the client. A HomeDirectory example is /bucket_name/home/mydirectory . The + // HomeDirectory parameter is only used if HomeDirectoryType is set to LOGICAL . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and @@ -88,10 +89,14 @@ type CreateUserInput struct { // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see - // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol - // clients. If you set it LOGICAL , you need to provide mappings in the + // the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer + // protocol clients. If you set it to LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths - // visible to your users. + // visible to your users. If HomeDirectoryType is LOGICAL , you must provide + // mappings, using the HomeDirectoryMappings parameter. If, on the other hand, + // HomeDirectoryType is PATH , you provide an absolute path using the HomeDirectory + // parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your + // template. HomeDirectoryType types.HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access diff --git a/service/transfer/api_op_ListUsers.go b/service/transfer/api_op_ListUsers.go index 37909d4ff7e..28a66e9459d 100644 --- a/service/transfer/api_op_ListUsers.go +++ b/service/transfer/api_op_ListUsers.go @@ -43,9 +43,9 @@ type ListUsersInput struct { // Specifies the number of users to return as a response to the ListUsers request. MaxResults *int32 - // When you can get additional results from the ListUsers call, a NextToken - // parameter is returned in the output. You can then pass in a subsequent command - // to the NextToken parameter to continue listing additional users. + // If there are additional results from the ListUsers call, a NextToken parameter + // is returned in the output. You can then pass the NextToken to a subsequent + // ListUsers command, to continue listing additional users. NextToken *string noSmithyDocumentSerde diff --git a/service/transfer/api_op_TestConnection.go b/service/transfer/api_op_TestConnection.go index 669b75755ce..0b7f251c2c2 100644 --- a/service/transfer/api_op_TestConnection.go +++ b/service/transfer/api_op_TestConnection.go @@ -16,8 +16,8 @@ import ( ) // Tests whether your SFTP connector is set up successfully. We highly recommend -// that you call this operation to test your ability to transfer files between a -// Transfer Family server and a trading partner's SFTP server. +// that you call this operation to test your ability to transfer files between +// local Amazon Web Services storage and a trading partner's SFTP server. func (c *Client) TestConnection(ctx context.Context, params *TestConnectionInput, optFns ...func(*Options)) (*TestConnectionOutput, error) { if params == nil { params = &TestConnectionInput{} @@ -52,17 +52,15 @@ type TestConnectionOutput struct { Status *string // Returns Connection succeeded if the test is successful. Or, returns a - // descriptive error message if the test fails. The following list provides the - // details for some error messages and troubleshooting steps for each. - // - Unable to access secrets manager: Verify that your secret name aligns with - // the one in Transfer Role permissions. - // - Unknown Host/Connection failed: Verify the server URL in the connector - // configuration , and verify that the login credentials work successfully outside - // of the connector. - // - Private key not found: Verify that the secret exists and is formatted - // correctly. - // - Invalid trusted host keys: Verify that the trusted host key in the - // connector configuration matches the ssh-keyscan output. + // descriptive error message if the test fails. The following list provides + // troubleshooting details, depending on the error message that you receive. + // - Verify that your secret name aligns with the one in Transfer Role + // permissions. + // - Verify the server URL in the connector configuration , and verify that the + // login credentials work successfully outside of the connector. + // - Verify that the secret exists and is formatted correctly. + // - Verify that the trusted host key in the connector configuration matches the + // ssh-keyscan output. StatusMessage *string // Metadata pertaining to the operation's result. diff --git a/service/transfer/api_op_UpdateAccess.go b/service/transfer/api_op_UpdateAccess.go index 6aa0385d71a..f54f6093a05 100644 --- a/service/transfer/api_op_UpdateAccess.go +++ b/service/transfer/api_op_UpdateAccess.go @@ -56,7 +56,8 @@ type UpdateAccessInput struct { ServerId *string // The landing directory (folder) for a user when they log in to the server using - // the client. A HomeDirectory example is /bucket_name/home/mydirectory . + // the client. A HomeDirectory example is /bucket_name/home/mydirectory . The + // HomeDirectory parameter is only used if HomeDirectoryType is set to LOGICAL . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and @@ -77,10 +78,14 @@ type UpdateAccessInput struct { // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see - // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol - // clients. If you set it LOGICAL , you need to provide mappings in the + // the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer + // protocol clients. If you set it to LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths - // visible to your users. + // visible to your users. If HomeDirectoryType is LOGICAL , you must provide + // mappings, using the HomeDirectoryMappings parameter. If, on the other hand, + // HomeDirectoryType is PATH , you provide an absolute path using the HomeDirectory + // parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your + // template. HomeDirectoryType types.HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access diff --git a/service/transfer/api_op_UpdateUser.go b/service/transfer/api_op_UpdateUser.go index 75b352e6ef0..39a482a8b94 100644 --- a/service/transfer/api_op_UpdateUser.go +++ b/service/transfer/api_op_UpdateUser.go @@ -53,7 +53,8 @@ type UpdateUserInput struct { UserName *string // The landing directory (folder) for a user when they log in to the server using - // the client. A HomeDirectory example is /bucket_name/home/mydirectory . + // the client. A HomeDirectory example is /bucket_name/home/mydirectory . The + // HomeDirectory parameter is only used if HomeDirectoryType is set to LOGICAL . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and @@ -74,10 +75,14 @@ type UpdateUserInput struct { // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see - // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol - // clients. If you set it LOGICAL , you need to provide mappings in the + // the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer + // protocol clients. If you set it to LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths - // visible to your users. + // visible to your users. If HomeDirectoryType is LOGICAL , you must provide + // mappings, using the HomeDirectoryMappings parameter. If, on the other hand, + // HomeDirectoryType is PATH , you provide an absolute path using the HomeDirectory + // parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your + // template. HomeDirectoryType types.HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access diff --git a/service/transfer/types/errors.go b/service/transfer/types/errors.go index 2395f76a1ca..be00f70142e 100644 --- a/service/transfer/types/errors.go +++ b/service/transfer/types/errors.go @@ -61,8 +61,7 @@ func (e *ConflictException) ErrorCode() string { } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// This exception is thrown when an error occurs in the Amazon Web -// ServicesTransfer Family service. +// This exception is thrown when an error occurs in the Transfer Family service. type InternalServiceError struct { Message *string @@ -140,7 +139,8 @@ func (e *InvalidRequestException) ErrorCode() string { } func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The requested resource does not exist. +// The requested resource does not exist, or exists in a region other than the one +// specified for the command. type ResourceExistsException struct { Message *string diff --git a/service/transfer/types/types.go b/service/transfer/types/types.go index 6be20e48e0f..9c1f6bcf4b0 100644 --- a/service/transfer/types/types.go +++ b/service/transfer/types/types.go @@ -212,7 +212,8 @@ type DescribedAccess struct { ExternalId *string // The landing directory (folder) for a user when they log in to the server using - // the client. A HomeDirectory example is /bucket_name/home/mydirectory . + // the client. A HomeDirectory example is /bucket_name/home/mydirectory . The + // HomeDirectory parameter is only used if HomeDirectoryType is set to LOGICAL . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and @@ -229,10 +230,14 @@ type DescribedAccess struct { // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see - // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol - // clients. If you set it LOGICAL , you need to provide mappings in the + // the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer + // protocol clients. If you set it to LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths - // visible to your users. + // visible to your users. If HomeDirectoryType is LOGICAL , you must provide + // mappings, using the HomeDirectoryMappings parameter. If, on the other hand, + // HomeDirectoryType is PATH , you provide an absolute path using the HomeDirectory + // parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your + // template. HomeDirectoryType HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access @@ -738,7 +743,8 @@ type DescribedUser struct { Arn *string // The landing directory (folder) for a user when they log in to the server using - // the client. A HomeDirectory example is /bucket_name/home/mydirectory . + // the client. A HomeDirectory example is /bucket_name/home/mydirectory . The + // HomeDirectory parameter is only used if HomeDirectoryType is set to LOGICAL . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and @@ -755,10 +761,14 @@ type DescribedUser struct { // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see - // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol - // clients. If you set it LOGICAL , you need to provide mappings in the + // the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer + // protocol clients. If you set it to LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths - // visible to your users. + // visible to your users. If HomeDirectoryType is LOGICAL , you must provide + // mappings, using the HomeDirectoryMappings parameter. If, on the other hand, + // HomeDirectoryType is PATH , you provide an absolute path using the HomeDirectory + // parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your + // template. HomeDirectoryType HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access @@ -1050,15 +1060,20 @@ type ListedAccess struct { ExternalId *string // The landing directory (folder) for a user when they log in to the server using - // the client. A HomeDirectory example is /bucket_name/home/mydirectory . + // the client. A HomeDirectory example is /bucket_name/home/mydirectory . The + // HomeDirectory parameter is only used if HomeDirectoryType is set to LOGICAL . HomeDirectory *string // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see - // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol - // clients. If you set it LOGICAL , you need to provide mappings in the + // the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer + // protocol clients. If you set it to LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths - // visible to your users. + // visible to your users. If HomeDirectoryType is LOGICAL , you must provide + // mappings, using the HomeDirectoryMappings parameter. If, on the other hand, + // HomeDirectoryType is PATH , you provide an absolute path using the HomeDirectory + // parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your + // template. HomeDirectoryType HomeDirectoryType // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role @@ -1297,15 +1312,20 @@ type ListedUser struct { Arn *string // The landing directory (folder) for a user when they log in to the server using - // the client. A HomeDirectory example is /bucket_name/home/mydirectory . + // the client. A HomeDirectory example is /bucket_name/home/mydirectory . The + // HomeDirectory parameter is only used if HomeDirectoryType is set to LOGICAL . HomeDirectory *string // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see - // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol - // clients. If you set it LOGICAL , you need to provide mappings in the + // the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer + // protocol clients. If you set it to LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths - // visible to your users. + // visible to your users. If HomeDirectoryType is LOGICAL , you must provide + // mappings, using the HomeDirectoryMappings parameter. If, on the other hand, + // HomeDirectoryType is PATH , you provide an absolute path using the HomeDirectory + // parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your + // template. HomeDirectoryType HomeDirectoryType // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role @@ -1539,8 +1559,9 @@ type SftpConnectorConfig struct { // user to the external server to which you are connecting. You can use the // ssh-keyscan command against the SFTP server to retrieve the necessary key. The // three standard SSH public key format elements are , , and an optional , with - // spaces between each element. For the trusted host key, Transfer Family accepts - // RSA and ECDSA keys. + // spaces between each element. Specify only the and : do not enter the portion + // of the key. For the trusted host key, Transfer Family accepts RSA and ECDSA + // keys. // - For RSA keys, the key type is ssh-rsa . // - For ECDSA keys, the key type is either ecdsa-sha2-nistp256 , // ecdsa-sha2-nistp384 , or ecdsa-sha2-nistp521 , depending on the size of the