diff --git a/.changelog/24febc2d543045b781ebaa5609933346.json b/.changelog/24febc2d543045b781ebaa5609933346.json new file mode 100644 index 00000000000..78fe3568909 --- /dev/null +++ b/.changelog/24febc2d543045b781ebaa5609933346.json @@ -0,0 +1,8 @@ +{ + "id": "24febc2d-5430-45b7-81eb-aa5609933346", + "type": "feature", + "description": "Amazon DynamoDB now supports Incremental Export as an enhancement to the existing Export Table", + "modules": [ + "service/dynamodb" + ] +} \ No newline at end of file diff --git a/.changelog/3e9f6277ff264b7f80ae26da1f411dad.json b/.changelog/3e9f6277ff264b7f80ae26da1f411dad.json new file mode 100644 index 00000000000..7e0f6f07aa2 --- /dev/null +++ b/.changelog/3e9f6277ff264b7f80ae26da1f411dad.json @@ -0,0 +1,8 @@ +{ + "id": "3e9f6277-ff26-4b7f-80ae-26da1f411dad", + "type": "feature", + "description": "This release updates a set of Amazon Connect APIs that provides the ability to integrate third party applications in the Amazon Connect agent workspace.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/45bec59eb0b84fbd9e47d84c838c8a55.json b/.changelog/45bec59eb0b84fbd9e47d84c838c8a55.json new file mode 100644 index 00000000000..074d74f8ea1 --- /dev/null +++ b/.changelog/45bec59eb0b84fbd9e47d84c838c8a55.json @@ -0,0 +1,8 @@ +{ + "id": "45bec59e-b0b8-4fbd-9e47-d84c838c8a55", + "type": "documentation", + "description": "Update documentation for RemoveAttributes to more accurately reflect its behavior when attributes are deleted.", + "modules": [ + "service/pinpoint" + ] +} \ No newline at end of file diff --git a/.changelog/68947b78444f46028abf92819e43a7db.json b/.changelog/68947b78444f46028abf92819e43a7db.json new file mode 100644 index 00000000000..49d90242452 --- /dev/null +++ b/.changelog/68947b78444f46028abf92819e43a7db.json @@ -0,0 +1,8 @@ +{ + "id": "68947b78-444f-4602-8abf-92819e43a7db", + "type": "feature", + "description": "This release adds three new API support \"CreateLakeFormationOptIn\", \"DeleteLakeFormationOptIn\" and \"ListLakeFormationOptIns\", and also updates the corresponding documentation.", + "modules": [ + "service/lakeformation" + ] +} \ No newline at end of file diff --git a/.changelog/7b13dd91c23c4b48bccb840a625ef510.json b/.changelog/7b13dd91c23c4b48bccb840a625ef510.json new file mode 100644 index 00000000000..c95884c9ccd --- /dev/null +++ b/.changelog/7b13dd91c23c4b48bccb840a625ef510.json @@ -0,0 +1,8 @@ +{ + "id": "7b13dd91-c23c-4b48-bccb-840a625ef510", + "type": "feature", + "description": "The release includes AWS verified access to support FIPs compliance in North America regions", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/9a459f3e29f24cee81f1036d81854f16.json b/.changelog/9a459f3e29f24cee81f1036d81854f16.json new file mode 100644 index 00000000000..af5a87940d6 --- /dev/null +++ b/.changelog/9a459f3e29f24cee81f1036d81854f16.json @@ -0,0 +1,8 @@ +{ + "id": "9a459f3e-29f2-4cee-81f1-036d81854f16", + "type": "feature", + "description": "The Amazon AppIntegrations service adds a set of APIs (in preview) to manage third party applications to be used in Amazon Connect agent workspace.", + "modules": [ + "service/appintegrations" + ] +} \ No newline at end of file diff --git a/.changelog/9eafeba772b74d7eaa54a3c3066a3ed4.json b/.changelog/9eafeba772b74d7eaa54a3c3066a3ed4.json new file mode 100644 index 00000000000..c519f4a1b5c --- /dev/null +++ b/.changelog/9eafeba772b74d7eaa54a3c3066a3ed4.json @@ -0,0 +1,8 @@ +{ + "id": "9eafeba7-72b7-4d7e-aa54-a3c3066a3ed4", + "type": "feature", + "description": "This release adds a new field COMPLETED to the ReplicationStatus Enum. You can now use this field to validate the replication status of S3 objects using the AWS SDK.", + "modules": [ + "service/s3" + ] +} \ No newline at end of file diff --git a/.changelog/d8ef8a226974436b855b33775b5b6fdd.json b/.changelog/d8ef8a226974436b855b33775b5b6fdd.json new file mode 100644 index 00000000000..c42b6821b93 --- /dev/null +++ b/.changelog/d8ef8a226974436b855b33775b5b6fdd.json @@ -0,0 +1,8 @@ +{ + "id": "d8ef8a22-6974-436b-855b-33775b5b6fdd", + "type": "documentation", + "description": "CodeDeploy now supports In-place and Blue/Green EC2 deployments with multiple Classic Load Balancers and multiple Target Groups.", + "modules": [ + "service/codedeploy" + ] +} \ No newline at end of file diff --git a/.changelog/f951680b8f1347f78a6e895f775fdcf8.json b/.changelog/f951680b8f1347f78a6e895f775fdcf8.json new file mode 100644 index 00000000000..d07919e1625 --- /dev/null +++ b/.changelog/f951680b8f1347f78a6e895f775fdcf8.json @@ -0,0 +1,8 @@ +{ + "id": "f951680b-8f13-47f7-8a6e-895f775fdcf8", + "type": "feature", + "description": "This release allows an App Runner customer to specify a custom source directory to run the build \u0026 start command. This change allows App Runner to support monorepo based repositories", + "modules": [ + "service/apprunner" + ] +} \ No newline at end of file diff --git a/service/appintegrations/api_op_CreateApplication.go b/service/appintegrations/api_op_CreateApplication.go new file mode 100644 index 00000000000..820ba9c056c --- /dev/null +++ b/service/appintegrations/api_op_CreateApplication.go @@ -0,0 +1,331 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +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/appintegrations/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API is in preview release and subject to change. Creates and persists an +// Application resource. +func (c *Client) CreateApplication(ctx context.Context, params *CreateApplicationInput, optFns ...func(*Options)) (*CreateApplicationOutput, error) { + if params == nil { + params = &CreateApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateApplication", params, optFns, c.addOperationCreateApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateApplicationInput struct { + + // The configuration for where the application should be loaded from. + // + // This member is required. + ApplicationSourceConfig *types.ApplicationSourceConfig + + // The name of the application. + // + // This member is required. + Name *string + + // The namespace of the application. + // + // This member is required. + Namespace *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the Amazon Web Services SDK populates this + // field. For more information about idempotency, see Making retries safe with + // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/) + // . + ClientToken *string + + // The description of the application. + Description *string + + // The events that the application publishes. + Publications []types.Publication + + // The events that the application subscribes. + Subscriptions []types.Subscription + + // The tags used to organize, track, or control access for this resource. For + // example, { "tags": {"key1":"value1", "key2":"value2"} }. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateApplicationOutput struct { + + // The Amazon Resource Name (ARN) of the Application. + Arn *string + + // A unique identifier for the Application. + Id *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateApplication{}, 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 = addCreateApplicationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateApplicationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplication(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_initializeOpCreateApplication struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateApplication) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateApplication) 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.(*CreateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateApplicationInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateApplicationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateApplication{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "CreateApplication", + } +} + +type opCreateApplicationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateApplicationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateApplicationResolveEndpointMiddleware) 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 := "app-integrations" + 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 = "app-integrations" + } 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("app-integrations") + } + 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 addCreateApplicationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateApplicationResolveEndpointMiddleware{ + 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/appintegrations/api_op_GetApplication.go b/service/appintegrations/api_op_GetApplication.go new file mode 100644 index 00000000000..faa48ea4577 --- /dev/null +++ b/service/appintegrations/api_op_GetApplication.go @@ -0,0 +1,294 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +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/appintegrations/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// This API is in preview release and subject to change. Get an Application +// resource. +func (c *Client) GetApplication(ctx context.Context, params *GetApplicationInput, optFns ...func(*Options)) (*GetApplicationOutput, error) { + if params == nil { + params = &GetApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetApplication", params, optFns, c.addOperationGetApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetApplicationInput struct { + + // The Amazon Resource Name (ARN) of the Application. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type GetApplicationOutput struct { + + // The configuration for where the application should be loaded from. + ApplicationSourceConfig *types.ApplicationSourceConfig + + // The Amazon Resource Name (ARN) of the Application. + Arn *string + + // The created time of the Application. + CreatedTime *time.Time + + // The description of the application. + Description *string + + // A unique identifier for the Application. + Id *string + + // The last modified time of the Application. + LastModifiedTime *time.Time + + // The name of the application. + Name *string + + // The namespace of the application. + Namespace *string + + // The events that the application publishes. + Publications []types.Publication + + // The events that the application subscribes. + Subscriptions []types.Subscription + + // The tags used to organize, track, or control access for this resource. For + // example, { "tags": {"key1":"value1", "key2":"value2"} }. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetApplication{}, 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 = addGetApplicationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetApplication(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_opGetApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "GetApplication", + } +} + +type opGetApplicationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetApplicationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetApplicationResolveEndpointMiddleware) 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 := "app-integrations" + 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 = "app-integrations" + } 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("app-integrations") + } + 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 addGetApplicationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetApplicationResolveEndpointMiddleware{ + 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/appintegrations/api_op_ListApplications.go b/service/appintegrations/api_op_ListApplications.go new file mode 100644 index 00000000000..8e81494a689 --- /dev/null +++ b/service/appintegrations/api_op_ListApplications.go @@ -0,0 +1,354 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +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/appintegrations/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API is in preview release and subject to change. Lists applications in the +// account. +func (c *Client) ListApplications(ctx context.Context, params *ListApplicationsInput, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if params == nil { + params = &ListApplicationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListApplications", params, optFns, c.addOperationListApplicationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListApplicationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListApplicationsInput struct { + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListApplicationsOutput struct { + + // The Applications associated with this account. + Applications []types.ApplicationSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplications{}, 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 = addListApplicationsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplications(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 +} + +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListApplicationsPaginator is a paginator for ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + if params == nil { + params = &ListApplicationsInput{} + } + + options := ListApplicationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, 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.ListApplications(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_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "ListApplications", + } +} + +type opListApplicationsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListApplicationsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListApplicationsResolveEndpointMiddleware) 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 := "app-integrations" + 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 = "app-integrations" + } 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("app-integrations") + } + 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 addListApplicationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListApplicationsResolveEndpointMiddleware{ + 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/appintegrations/api_op_ListDataIntegrationAssociations.go b/service/appintegrations/api_op_ListDataIntegrationAssociations.go index 7ae8ddcf978..416531e1ae2 100644 --- a/service/appintegrations/api_op_ListDataIntegrationAssociations.go +++ b/service/appintegrations/api_op_ListDataIntegrationAssociations.go @@ -142,6 +142,99 @@ func (c *Client) addOperationListDataIntegrationAssociationsMiddlewares(stack *m return nil } +// ListDataIntegrationAssociationsAPIClient is a client that implements the +// ListDataIntegrationAssociations operation. +type ListDataIntegrationAssociationsAPIClient interface { + ListDataIntegrationAssociations(context.Context, *ListDataIntegrationAssociationsInput, ...func(*Options)) (*ListDataIntegrationAssociationsOutput, error) +} + +var _ ListDataIntegrationAssociationsAPIClient = (*Client)(nil) + +// ListDataIntegrationAssociationsPaginatorOptions is the paginator options for +// ListDataIntegrationAssociations +type ListDataIntegrationAssociationsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListDataIntegrationAssociationsPaginator is a paginator for +// ListDataIntegrationAssociations +type ListDataIntegrationAssociationsPaginator struct { + options ListDataIntegrationAssociationsPaginatorOptions + client ListDataIntegrationAssociationsAPIClient + params *ListDataIntegrationAssociationsInput + nextToken *string + firstPage bool +} + +// NewListDataIntegrationAssociationsPaginator returns a new +// ListDataIntegrationAssociationsPaginator +func NewListDataIntegrationAssociationsPaginator(client ListDataIntegrationAssociationsAPIClient, params *ListDataIntegrationAssociationsInput, optFns ...func(*ListDataIntegrationAssociationsPaginatorOptions)) *ListDataIntegrationAssociationsPaginator { + if params == nil { + params = &ListDataIntegrationAssociationsInput{} + } + + options := ListDataIntegrationAssociationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDataIntegrationAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataIntegrationAssociationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListDataIntegrationAssociations page. +func (p *ListDataIntegrationAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataIntegrationAssociationsOutput, 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.ListDataIntegrationAssociations(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_opListDataIntegrationAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appintegrations/api_op_ListDataIntegrations.go b/service/appintegrations/api_op_ListDataIntegrations.go index 8f49563484c..a2b7b0e22a6 100644 --- a/service/appintegrations/api_op_ListDataIntegrations.go +++ b/service/appintegrations/api_op_ListDataIntegrations.go @@ -134,6 +134,97 @@ func (c *Client) addOperationListDataIntegrationsMiddlewares(stack *middleware.S return nil } +// ListDataIntegrationsAPIClient is a client that implements the +// ListDataIntegrations operation. +type ListDataIntegrationsAPIClient interface { + ListDataIntegrations(context.Context, *ListDataIntegrationsInput, ...func(*Options)) (*ListDataIntegrationsOutput, error) +} + +var _ ListDataIntegrationsAPIClient = (*Client)(nil) + +// ListDataIntegrationsPaginatorOptions is the paginator options for +// ListDataIntegrations +type ListDataIntegrationsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListDataIntegrationsPaginator is a paginator for ListDataIntegrations +type ListDataIntegrationsPaginator struct { + options ListDataIntegrationsPaginatorOptions + client ListDataIntegrationsAPIClient + params *ListDataIntegrationsInput + nextToken *string + firstPage bool +} + +// NewListDataIntegrationsPaginator returns a new ListDataIntegrationsPaginator +func NewListDataIntegrationsPaginator(client ListDataIntegrationsAPIClient, params *ListDataIntegrationsInput, optFns ...func(*ListDataIntegrationsPaginatorOptions)) *ListDataIntegrationsPaginator { + if params == nil { + params = &ListDataIntegrationsInput{} + } + + options := ListDataIntegrationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDataIntegrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataIntegrationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListDataIntegrations page. +func (p *ListDataIntegrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataIntegrationsOutput, 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.ListDataIntegrations(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_opListDataIntegrations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appintegrations/api_op_ListEventIntegrationAssociations.go b/service/appintegrations/api_op_ListEventIntegrationAssociations.go index 4e9b062342d..70065f173b4 100644 --- a/service/appintegrations/api_op_ListEventIntegrationAssociations.go +++ b/service/appintegrations/api_op_ListEventIntegrationAssociations.go @@ -138,6 +138,99 @@ func (c *Client) addOperationListEventIntegrationAssociationsMiddlewares(stack * return nil } +// ListEventIntegrationAssociationsAPIClient is a client that implements the +// ListEventIntegrationAssociations operation. +type ListEventIntegrationAssociationsAPIClient interface { + ListEventIntegrationAssociations(context.Context, *ListEventIntegrationAssociationsInput, ...func(*Options)) (*ListEventIntegrationAssociationsOutput, error) +} + +var _ ListEventIntegrationAssociationsAPIClient = (*Client)(nil) + +// ListEventIntegrationAssociationsPaginatorOptions is the paginator options for +// ListEventIntegrationAssociations +type ListEventIntegrationAssociationsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListEventIntegrationAssociationsPaginator is a paginator for +// ListEventIntegrationAssociations +type ListEventIntegrationAssociationsPaginator struct { + options ListEventIntegrationAssociationsPaginatorOptions + client ListEventIntegrationAssociationsAPIClient + params *ListEventIntegrationAssociationsInput + nextToken *string + firstPage bool +} + +// NewListEventIntegrationAssociationsPaginator returns a new +// ListEventIntegrationAssociationsPaginator +func NewListEventIntegrationAssociationsPaginator(client ListEventIntegrationAssociationsAPIClient, params *ListEventIntegrationAssociationsInput, optFns ...func(*ListEventIntegrationAssociationsPaginatorOptions)) *ListEventIntegrationAssociationsPaginator { + if params == nil { + params = &ListEventIntegrationAssociationsInput{} + } + + options := ListEventIntegrationAssociationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEventIntegrationAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventIntegrationAssociationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEventIntegrationAssociations page. +func (p *ListEventIntegrationAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventIntegrationAssociationsOutput, 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.ListEventIntegrationAssociations(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_opListEventIntegrationAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appintegrations/api_op_ListEventIntegrations.go b/service/appintegrations/api_op_ListEventIntegrations.go index 9a52aecaec3..7312721d553 100644 --- a/service/appintegrations/api_op_ListEventIntegrations.go +++ b/service/appintegrations/api_op_ListEventIntegrations.go @@ -130,6 +130,97 @@ func (c *Client) addOperationListEventIntegrationsMiddlewares(stack *middleware. return nil } +// ListEventIntegrationsAPIClient is a client that implements the +// ListEventIntegrations operation. +type ListEventIntegrationsAPIClient interface { + ListEventIntegrations(context.Context, *ListEventIntegrationsInput, ...func(*Options)) (*ListEventIntegrationsOutput, error) +} + +var _ ListEventIntegrationsAPIClient = (*Client)(nil) + +// ListEventIntegrationsPaginatorOptions is the paginator options for +// ListEventIntegrations +type ListEventIntegrationsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListEventIntegrationsPaginator is a paginator for ListEventIntegrations +type ListEventIntegrationsPaginator struct { + options ListEventIntegrationsPaginatorOptions + client ListEventIntegrationsAPIClient + params *ListEventIntegrationsInput + nextToken *string + firstPage bool +} + +// NewListEventIntegrationsPaginator returns a new ListEventIntegrationsPaginator +func NewListEventIntegrationsPaginator(client ListEventIntegrationsAPIClient, params *ListEventIntegrationsInput, optFns ...func(*ListEventIntegrationsPaginatorOptions)) *ListEventIntegrationsPaginator { + if params == nil { + params = &ListEventIntegrationsInput{} + } + + options := ListEventIntegrationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEventIntegrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventIntegrationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEventIntegrations page. +func (p *ListEventIntegrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventIntegrationsOutput, 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.ListEventIntegrations(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_opListEventIntegrations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appintegrations/api_op_UpdateApplication.go b/service/appintegrations/api_op_UpdateApplication.go new file mode 100644 index 00000000000..8a2d0510d3f --- /dev/null +++ b/service/appintegrations/api_op_UpdateApplication.go @@ -0,0 +1,273 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +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/appintegrations/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API is in preview release and subject to change. Updates and persists an +// Application resource. +func (c *Client) UpdateApplication(ctx context.Context, params *UpdateApplicationInput, optFns ...func(*Options)) (*UpdateApplicationOutput, error) { + if params == nil { + params = &UpdateApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateApplication", params, optFns, c.addOperationUpdateApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateApplicationInput struct { + + // The Amazon Resource Name (ARN) of the Application. + // + // This member is required. + Arn *string + + // The configuration for where the application should be loaded from. + ApplicationSourceConfig *types.ApplicationSourceConfig + + // The description of the application. + Description *string + + // The name of the application. + Name *string + + // The events that the application publishes. + Publications []types.Publication + + // The events that the application subscribes. + Subscriptions []types.Subscription + + noSmithyDocumentSerde +} + +type UpdateApplicationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApplication{}, 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 = addUpdateApplicationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApplication(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_opUpdateApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "UpdateApplication", + } +} + +type opUpdateApplicationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateApplicationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateApplicationResolveEndpointMiddleware) 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 := "app-integrations" + 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 = "app-integrations" + } 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("app-integrations") + } + 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 addUpdateApplicationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateApplicationResolveEndpointMiddleware{ + 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/appintegrations/api_op_UpdateEventIntegration.go b/service/appintegrations/api_op_UpdateEventIntegration.go index 1bb2a9b5873..cf232f8d093 100644 --- a/service/appintegrations/api_op_UpdateEventIntegration.go +++ b/service/appintegrations/api_op_UpdateEventIntegration.go @@ -38,7 +38,7 @@ type UpdateEventIntegrationInput struct { // This member is required. Name *string - // The description of the event inegration. + // The description of the event integration. Description *string noSmithyDocumentSerde diff --git a/service/appintegrations/deserializers.go b/service/appintegrations/deserializers.go index 796deab81ff..2efe3564091 100644 --- a/service/appintegrations/deserializers.go +++ b/service/appintegrations/deserializers.go @@ -13,11 +13,187 @@ import ( smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) +type awsRestjson1_deserializeOpCreateApplication struct { +} + +func (*awsRestjson1_deserializeOpCreateApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateApplication) 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_deserializeOpErrorCreateApplication(response, &metadata) + } + output := &CreateApplicationOutput{} + 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_deserializeOpDocumentCreateApplicationOutput(&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_deserializeOpErrorCreateApplication(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("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, 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 *CreateApplicationOutput + if *v == nil { + sv = &CreateApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateDataIntegration struct { } @@ -614,14 +790,14 @@ func awsRestjson1_deserializeOpErrorDeleteEventIntegration(response *smithyhttp. } } -type awsRestjson1_deserializeOpGetDataIntegration struct { +type awsRestjson1_deserializeOpGetApplication struct { } -func (*awsRestjson1_deserializeOpGetDataIntegration) ID() string { +func (*awsRestjson1_deserializeOpGetApplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDataIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetApplication) 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) @@ -635,9 +811,9 @@ func (m *awsRestjson1_deserializeOpGetDataIntegration) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDataIntegration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetApplication(response, &metadata) } - output := &GetDataIntegrationOutput{} + output := &GetApplicationOutput{} out.Result = output var buff [1024]byte @@ -658,7 +834,7 @@ func (m *awsRestjson1_deserializeOpGetDataIntegration) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -671,7 +847,7 @@ func (m *awsRestjson1_deserializeOpGetDataIntegration) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDataIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetApplication(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)} @@ -737,7 +913,7 @@ func awsRestjson1_deserializeOpErrorGetDataIntegration(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(v **GetDataIntegrationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -750,15 +926,20 @@ func awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(v **GetDataInteg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDataIntegrationOutput + var sv *GetApplicationOutput if *v == nil { - sv = &GetDataIntegrationOutput{} + sv = &GetApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "ApplicationSourceConfig": + if err := awsRestjson1_deserializeDocumentApplicationSourceConfig(&sv.ApplicationSourceConfig, value); err != nil { + return err + } + case "Arn": if value != nil { jtv, ok := value.(string) @@ -768,6 +949,22 @@ func awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(v **GetDataInteg sv.Arn = ptr.String(jtv) } + case "CreatedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "Description": if value != nil { jtv, ok := value.(string) @@ -777,11 +974,6 @@ func awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(v **GetDataInteg sv.Description = ptr.String(jtv) } - case "FileConfiguration": - if err := awsRestjson1_deserializeDocumentFileConfiguration(&sv.FileConfiguration, value); err != nil { - return err - } - case "Id": if value != nil { jtv, ok := value.(string) @@ -791,41 +983,48 @@ func awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(v **GetDataInteg sv.Id = ptr.String(jtv) } - case "KmsKey": + case "LastModifiedTime": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.KmsKey = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } - case "ObjectConfiguration": - if err := awsRestjson1_deserializeDocumentObjectConfiguration(&sv.ObjectConfiguration, value); err != nil { - return err + case "Namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationNamespace to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) } - case "ScheduleConfiguration": - if err := awsRestjson1_deserializeDocumentScheduleConfiguration(&sv.ScheduleConfiguration, value); err != nil { + case "Publications": + if err := awsRestjson1_deserializeDocumentPublicationList(&sv.Publications, value); err != nil { return err } - case "SourceURI": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SourceURI to be of type string, got %T instead", value) - } - sv.SourceURI = ptr.String(jtv) + case "Subscriptions": + if err := awsRestjson1_deserializeDocumentSubscriptionList(&sv.Subscriptions, value); err != nil { + return err } case "Tags": @@ -842,14 +1041,14 @@ func awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(v **GetDataInteg return nil } -type awsRestjson1_deserializeOpGetEventIntegration struct { +type awsRestjson1_deserializeOpGetDataIntegration struct { } -func (*awsRestjson1_deserializeOpGetEventIntegration) ID() string { +func (*awsRestjson1_deserializeOpGetDataIntegration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetDataIntegration) 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) @@ -863,9 +1062,9 @@ func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetEventIntegration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetDataIntegration(response, &metadata) } - output := &GetEventIntegrationOutput{} + output := &GetDataIntegrationOutput{} out.Result = output var buff [1024]byte @@ -886,7 +1085,7 @@ func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -899,7 +1098,7 @@ func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetEventIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetDataIntegration(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)} @@ -965,7 +1164,7 @@ func awsRestjson1_deserializeOpErrorGetEventIntegration(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(v **GetEventIntegrationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(v **GetDataIntegrationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -978,15 +1177,24 @@ func awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(v **GetEventInt return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetEventIntegrationOutput + var sv *GetDataIntegrationOutput if *v == nil { - sv = &GetEventIntegrationOutput{} + sv = &GetDataIntegrationOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + case "Description": if value != nil { jtv, ok := value.(string) @@ -996,41 +1204,425 @@ func awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(v **GetEventInt sv.Description = ptr.String(jtv) } - case "EventBridgeBus": + case "FileConfiguration": + if err := awsRestjson1_deserializeDocumentFileConfiguration(&sv.FileConfiguration, value); err != nil { + return err + } + + case "Id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EventBridgeBus to be of type string, got %T instead", value) + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) } - sv.EventBridgeBus = ptr.String(jtv) + sv.Id = ptr.String(jtv) } - case "EventFilter": - if err := awsRestjson1_deserializeDocumentEventFilter(&sv.EventFilter, value); err != nil { - return err - } + case "KmsKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.KmsKey = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ObjectConfiguration": + if err := awsRestjson1_deserializeDocumentObjectConfiguration(&sv.ObjectConfiguration, value); err != nil { + return err + } + + case "ScheduleConfiguration": + if err := awsRestjson1_deserializeDocumentScheduleConfiguration(&sv.ScheduleConfiguration, value); err != nil { + return err + } + + case "SourceURI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceURI to be of type string, got %T instead", value) + } + sv.SourceURI = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetEventIntegration struct { +} + +func (*awsRestjson1_deserializeOpGetEventIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetEventIntegration) 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_deserializeOpErrorGetEventIntegration(response, &metadata) + } + output := &GetEventIntegrationOutput{} + 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_deserializeOpDocumentGetEventIntegrationOutput(&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_deserializeOpErrorGetEventIntegration(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("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(v **GetEventIntegrationOutput, 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 *GetEventIntegrationOutput + if *v == nil { + sv = &GetEventIntegrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EventBridgeBus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventBridgeBus to be of type string, got %T instead", value) + } + sv.EventBridgeBus = ptr.String(jtv) + } + + case "EventFilter": + if err := awsRestjson1_deserializeDocumentEventFilter(&sv.EventFilter, value); err != nil { + return err + } + + case "EventIntegrationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.EventIntegrationArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListApplications struct { +} + +func (*awsRestjson1_deserializeOpListApplications) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListApplications) 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_deserializeOpErrorListApplications(response, &metadata) + } + output := &ListApplicationsOutput{} + 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_deserializeOpDocumentListApplicationsOutput(&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_deserializeOpErrorListApplications(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("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, 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) + } - case "EventIntegrationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.EventIntegrationArn = ptr.String(jtv) + var sv *ListApplicationsOutput + if *v == nil { + sv = &ListApplicationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Applications": + if err := awsRestjson1_deserializeDocumentApplicationsList(&sv.Applications, value); err != nil { + return err } - case "Name": + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) - } - - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } default: @@ -2048,6 +2640,101 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } +type awsRestjson1_deserializeOpUpdateApplication struct { +} + +func (*awsRestjson1_deserializeOpUpdateApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateApplication) 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_deserializeOpErrorUpdateApplication(response, &metadata) + } + output := &UpdateApplicationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateApplication(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("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpUpdateDataIntegration struct { } @@ -2473,24 +3160,170 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo return err } - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentApplicationApprovedOrigins(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationTrustedSource to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApplicationsList(v *[]types.ApplicationSummary, 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.ApplicationSummary + if *v == nil { + cv = []types.ApplicationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ApplicationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentApplicationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApplicationSourceConfig(v **types.ApplicationSourceConfig, 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.ApplicationSourceConfig + if *v == nil { + sv = &types.ApplicationSourceConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExternalUrlConfig": + if err := awsRestjson1_deserializeDocumentExternalUrlConfig(&sv.ExternalUrlConfig, value); err != nil { + return err + } + + default: + _, _ = key, value - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } - return err } - - errorBody.Seek(0, io.SeekStart) - - return output + *v = sv + return nil } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentApplicationSummary(v **types.ApplicationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2503,22 +3336,81 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.ApplicationSummary if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.ApplicationSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "Arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Arn = ptr.String(jtv) + } + + case "CreatedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationNamespace to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) } default: @@ -3056,6 +3948,51 @@ func awsRestjson1_deserializeDocumentEventIntegrationsList(v *[]types.EventInteg return nil } +func awsRestjson1_deserializeDocumentExternalUrlConfig(v **types.ExternalUrlConfig, 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.ExternalUrlConfig + if *v == nil { + sv = &types.ExternalUrlConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccessUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URL to be of type string, got %T instead", value) + } + sv.AccessUrl = ptr.String(jtv) + } + + case "ApprovedOrigins": + if err := awsRestjson1_deserializeDocumentApplicationApprovedOrigins(&sv.ApprovedOrigins, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentFieldsList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3317,6 +4254,98 @@ func awsRestjson1_deserializeDocumentObjectConfiguration(v *map[string]map[strin return nil } +func awsRestjson1_deserializeDocumentPublication(v **types.Publication, 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.Publication + if *v == nil { + sv = &types.Publication{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Event": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventName to be of type string, got %T instead", value) + } + sv.Event = ptr.String(jtv) + } + + case "Schema": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventDefinitionSchema to be of type string, got %T instead", value) + } + sv.Schema = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPublicationList(v *[]types.Publication, 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.Publication + if *v == nil { + cv = []types.Publication{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Publication + destAddr := &col + if err := awsRestjson1_deserializeDocumentPublication(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3455,6 +4484,89 @@ func awsRestjson1_deserializeDocumentScheduleConfiguration(v **types.ScheduleCon return nil } +func awsRestjson1_deserializeDocumentSubscription(v **types.Subscription, 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.Subscription + if *v == nil { + sv = &types.Subscription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Event": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventName to be of type string, got %T instead", value) + } + sv.Event = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSubscriptionList(v *[]types.Subscription, 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.Subscription + if *v == nil { + cv = []types.Subscription{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Subscription + destAddr := &col + if err := awsRestjson1_deserializeDocumentSubscription(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/appintegrations/generated.json b/service/appintegrations/generated.json index 7e12d48a59c..bb001523086 100644 --- a/service/appintegrations/generated.json +++ b/service/appintegrations/generated.json @@ -9,12 +9,15 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_CreateApplication.go", "api_op_CreateDataIntegration.go", "api_op_CreateEventIntegration.go", "api_op_DeleteDataIntegration.go", "api_op_DeleteEventIntegration.go", + "api_op_GetApplication.go", "api_op_GetDataIntegration.go", "api_op_GetEventIntegration.go", + "api_op_ListApplications.go", "api_op_ListDataIntegrationAssociations.go", "api_op_ListDataIntegrations.go", "api_op_ListEventIntegrationAssociations.go", @@ -22,6 +25,7 @@ "api_op_ListTagsForResource.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateApplication.go", "api_op_UpdateDataIntegration.go", "api_op_UpdateEventIntegration.go", "deserializers.go", diff --git a/service/appintegrations/serializers.go b/service/appintegrations/serializers.go index 1b907150b76..b9f9817a6c9 100644 --- a/service/appintegrations/serializers.go +++ b/service/appintegrations/serializers.go @@ -14,6 +14,124 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpCreateApplication struct { +} + +func (*awsRestjson1_serializeOpCreateApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateApplication) 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.(*CreateApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications") + 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_serializeOpDocumentCreateApplicationInput(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_serializeOpHttpBindingsCreateApplicationInput(v *CreateApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateApplicationInput(v *CreateApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationSourceConfig != nil { + ok := object.Key("ApplicationSourceConfig") + if err := awsRestjson1_serializeDocumentApplicationSourceConfig(v.ApplicationSourceConfig, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Namespace != nil { + ok := object.Key("Namespace") + ok.String(*v.Namespace) + } + + if v.Publications != nil { + ok := object.Key("Publications") + if err := awsRestjson1_serializeDocumentPublicationList(v.Publications, ok); err != nil { + return err + } + } + + if v.Subscriptions != nil { + ok := object.Key("Subscriptions") + if err := awsRestjson1_serializeDocumentSubscriptionList(v.Subscriptions, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateDataIntegration struct { } @@ -371,6 +489,71 @@ func awsRestjson1_serializeOpHttpBindingsDeleteEventIntegrationInput(v *DeleteEv return nil } +type awsRestjson1_serializeOpGetApplication struct { +} + +func (*awsRestjson1_serializeOpGetApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetApplication) 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.(*GetApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{Arn}") + 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_serializeOpHttpBindingsGetApplicationInput(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_serializeOpHttpBindingsGetApplicationInput(v *GetApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetDataIntegration struct { } @@ -501,6 +684,70 @@ func awsRestjson1_serializeOpHttpBindingsGetEventIntegrationInput(v *GetEventInt return nil } +type awsRestjson1_serializeOpListApplications struct { +} + +func (*awsRestjson1_serializeOpListApplications) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListApplications) 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.(*ListApplicationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications") + 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_serializeOpHttpBindingsListApplicationsInput(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_serializeOpHttpBindingsListApplicationsInput(v *ListApplicationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListDataIntegrationAssociations struct { } @@ -1001,6 +1248,120 @@ func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInpu return nil } +type awsRestjson1_serializeOpUpdateApplication struct { +} + +func (*awsRestjson1_serializeOpUpdateApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateApplication) 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.(*UpdateApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{Arn}") + 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_serializeOpHttpBindingsUpdateApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateApplicationInput(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_serializeOpHttpBindingsUpdateApplicationInput(v *UpdateApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateApplicationInput(v *UpdateApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationSourceConfig != nil { + ok := object.Key("ApplicationSourceConfig") + if err := awsRestjson1_serializeDocumentApplicationSourceConfig(v.ApplicationSourceConfig, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Publications != nil { + ok := object.Key("Publications") + if err := awsRestjson1_serializeDocumentPublicationList(v.Publications, ok); err != nil { + return err + } + } + + if v.Subscriptions != nil { + ok := object.Key("Subscriptions") + if err := awsRestjson1_serializeDocumentSubscriptionList(v.Subscriptions, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateDataIntegration struct { } @@ -1182,6 +1543,31 @@ func awsRestjson1_serializeOpDocumentUpdateEventIntegrationInput(v *UpdateEventI return nil } +func awsRestjson1_serializeDocumentApplicationApprovedOrigins(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentApplicationSourceConfig(v *types.ApplicationSourceConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExternalUrlConfig != nil { + ok := object.Key("ExternalUrlConfig") + if err := awsRestjson1_serializeDocumentExternalUrlConfig(v.ExternalUrlConfig, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentEventFilter(v *types.EventFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1194,6 +1580,25 @@ func awsRestjson1_serializeDocumentEventFilter(v *types.EventFilter, value smith return nil } +func awsRestjson1_serializeDocumentExternalUrlConfig(v *types.ExternalUrlConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccessUrl != nil { + ok := object.Key("AccessUrl") + ok.String(*v.AccessUrl) + } + + if v.ApprovedOrigins != nil { + ok := object.Key("ApprovedOrigins") + if err := awsRestjson1_serializeDocumentApplicationApprovedOrigins(v.ApprovedOrigins, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentFieldsList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1269,6 +1674,41 @@ func awsRestjson1_serializeDocumentObjectConfiguration(v map[string]map[string][ return nil } +func awsRestjson1_serializeDocumentPublication(v *types.Publication, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Event != nil { + ok := object.Key("Event") + ok.String(*v.Event) + } + + if v.Schema != nil { + ok := object.Key("Schema") + ok.String(*v.Schema) + } + + return nil +} + +func awsRestjson1_serializeDocumentPublicationList(v []types.Publication, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPublication(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentScheduleConfiguration(v *types.ScheduleConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1291,6 +1731,36 @@ func awsRestjson1_serializeDocumentScheduleConfiguration(v *types.ScheduleConfig return nil } +func awsRestjson1_serializeDocumentSubscription(v *types.Subscription, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Event != nil { + ok := object.Key("Event") + ok.String(*v.Event) + } + + return nil +} + +func awsRestjson1_serializeDocumentSubscriptionList(v []types.Subscription, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSubscription(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/appintegrations/types/types.go b/service/appintegrations/types/types.go index 03f2c542280..95178986538 100644 --- a/service/appintegrations/types/types.go +++ b/service/appintegrations/types/types.go @@ -4,8 +4,42 @@ package types import ( smithydocument "github.com/aws/smithy-go/document" + "time" ) +// The configuration for where the application should be loaded from. +type ApplicationSourceConfig struct { + + // The external URL source for the application. + ExternalUrlConfig *ExternalUrlConfig + + noSmithyDocumentSerde +} + +// Summary information about the Application. +type ApplicationSummary struct { + + // The Amazon Resource Name (ARN) of the Application. + Arn *string + + // The time when the application was created. + CreatedTime *time.Time + + // A unique identifier for the Application. + Id *string + + // The time when the application was last modified. + LastModifiedTime *time.Time + + // The name of the application. + Name *string + + // The namespace of the application. + Namespace *string + + noSmithyDocumentSerde +} + // Summary information about the DataIntegration association. type DataIntegrationAssociationSummary struct { @@ -97,6 +131,20 @@ type EventIntegrationAssociation struct { noSmithyDocumentSerde } +// The external URL source for the application. +type ExternalUrlConfig struct { + + // The URL to access the application. + // + // This member is required. + AccessUrl *string + + // Additional URLs to allow list if different than the access URL. + ApprovedOrigins []string + + noSmithyDocumentSerde +} + // The configuration for what files should be pulled from the source. type FileConfiguration struct { @@ -111,6 +159,25 @@ type FileConfiguration struct { noSmithyDocumentSerde } +// The configuration of an event that the application publishes. +type Publication struct { + + // The name of the publication. + // + // This member is required. + Event *string + + // The JSON schema of the publication event. + // + // This member is required. + Schema *string + + // The description of the publication. + Description *string + + noSmithyDocumentSerde +} + // The name of the data and how often it should be pulled from the source. type ScheduleConfiguration struct { @@ -129,4 +196,18 @@ type ScheduleConfiguration struct { noSmithyDocumentSerde } +// The configuration of an event that the application subscribes. +type Subscription struct { + + // The name of the subscription. + // + // This member is required. + Event *string + + // The description of the subscription. + Description *string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/appintegrations/validators.go b/service/appintegrations/validators.go index 6150bba4903..ec1e89e6f91 100644 --- a/service/appintegrations/validators.go +++ b/service/appintegrations/validators.go @@ -10,6 +10,26 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpCreateApplication struct { +} + +func (*validateOpCreateApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateDataIntegration struct { } @@ -90,6 +110,26 @@ func (m *validateOpDeleteEventIntegration) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpGetApplication struct { +} + +func (*validateOpGetApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetDataIntegration struct { } @@ -230,6 +270,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateApplication struct { +} + +func (*validateOpUpdateApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateDataIntegration struct { } @@ -270,6 +330,10 @@ func (m *validateOpUpdateEventIntegration) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +func addOpCreateApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateApplication{}, middleware.After) +} + func addOpCreateDataIntegrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataIntegration{}, middleware.After) } @@ -286,6 +350,10 @@ func addOpDeleteEventIntegrationValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpDeleteEventIntegration{}, middleware.After) } +func addOpGetApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetApplication{}, middleware.After) +} + func addOpGetDataIntegrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataIntegration{}, middleware.After) } @@ -314,6 +382,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateApplication{}, middleware.After) +} + func addOpUpdateDataIntegrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDataIntegration{}, middleware.After) } @@ -322,6 +394,23 @@ func addOpUpdateEventIntegrationValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpUpdateEventIntegration{}, middleware.After) } +func validateApplicationSourceConfig(v *types.ApplicationSourceConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ApplicationSourceConfig"} + if v.ExternalUrlConfig != nil { + if err := validateExternalUrlConfig(v.ExternalUrlConfig); err != nil { + invalidParams.AddNested("ExternalUrlConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateEventFilter(v *types.EventFilter) error { if v == nil { return nil @@ -337,6 +426,21 @@ func validateEventFilter(v *types.EventFilter) error { } } +func validateExternalUrlConfig(v *types.ExternalUrlConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExternalUrlConfig"} + if v.AccessUrl == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessUrl")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFileConfiguration(v *types.FileConfiguration) error { if v == nil { return nil @@ -352,6 +456,41 @@ func validateFileConfiguration(v *types.FileConfiguration) error { } } +func validatePublication(v *types.Publication) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Publication"} + if v.Event == nil { + invalidParams.Add(smithy.NewErrParamRequired("Event")) + } + if v.Schema == nil { + invalidParams.Add(smithy.NewErrParamRequired("Schema")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePublicationList(v []types.Publication) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PublicationList"} + for i := range v { + if err := validatePublication(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateScheduleConfiguration(v *types.ScheduleConfiguration) error { if v == nil { return nil @@ -367,6 +506,73 @@ func validateScheduleConfiguration(v *types.ScheduleConfiguration) error { } } +func validateSubscription(v *types.Subscription) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Subscription"} + if v.Event == nil { + invalidParams.Add(smithy.NewErrParamRequired("Event")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSubscriptionList(v []types.Subscription) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SubscriptionList"} + for i := range v { + if err := validateSubscription(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateApplicationInput(v *CreateApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateApplicationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Namespace == nil { + invalidParams.Add(smithy.NewErrParamRequired("Namespace")) + } + if v.ApplicationSourceConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationSourceConfig")) + } else if v.ApplicationSourceConfig != nil { + if err := validateApplicationSourceConfig(v.ApplicationSourceConfig); err != nil { + invalidParams.AddNested("ApplicationSourceConfig", err.(smithy.InvalidParamsError)) + } + } + if v.Subscriptions != nil { + if err := validateSubscriptionList(v.Subscriptions); err != nil { + invalidParams.AddNested("Subscriptions", err.(smithy.InvalidParamsError)) + } + } + if v.Publications != nil { + if err := validatePublicationList(v.Publications); err != nil { + invalidParams.AddNested("Publications", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateDataIntegrationInput(v *CreateDataIntegrationInput) error { if v == nil { return nil @@ -455,6 +661,21 @@ func validateOpDeleteEventIntegrationInput(v *DeleteEventIntegrationInput) error } } +func validateOpGetApplicationInput(v *GetApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetApplicationInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetDataIntegrationInput(v *GetDataIntegrationInput) error { if v == nil { return nil @@ -566,6 +787,36 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateApplicationInput(v *UpdateApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.ApplicationSourceConfig != nil { + if err := validateApplicationSourceConfig(v.ApplicationSourceConfig); err != nil { + invalidParams.AddNested("ApplicationSourceConfig", err.(smithy.InvalidParamsError)) + } + } + if v.Subscriptions != nil { + if err := validateSubscriptionList(v.Subscriptions); err != nil { + invalidParams.AddNested("Subscriptions", err.(smithy.InvalidParamsError)) + } + } + if v.Publications != nil { + if err := validatePublicationList(v.Publications); err != nil { + invalidParams.AddNested("Publications", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateDataIntegrationInput(v *UpdateDataIntegrationInput) error { if v == nil { return nil diff --git a/service/apprunner/api_op_CreateAutoScalingConfiguration.go b/service/apprunner/api_op_CreateAutoScalingConfiguration.go index dff11875e92..171edb55929 100644 --- a/service/apprunner/api_op_CreateAutoScalingConfiguration.go +++ b/service/apprunner/api_op_CreateAutoScalingConfiguration.go @@ -50,8 +50,8 @@ type CreateAutoScalingConfigurationInput struct { // A name for the auto scaling configuration. When you use it for the first time // in an Amazon Web Services Region, App Runner creates revision number 1 of this // name. When you use the same name in subsequent calls, App Runner creates - // incremental revisions of the configuration. Prior to the release of Managing - // auto scaling (https://docs.aws.amazon.com/apprunner/latest/relnotes/release-yyyy-mm-dd-asc-improvements.html) + // incremental revisions of the configuration. Prior to the release of Auto scale + // configuration enhancements (https://docs.aws.amazon.com/apprunner/latest/relnotes/release-2023-09-22-auto-scale-config.html) // , the name DefaultConfiguration was reserved. This restriction is no longer in // place. You can now manage DefaultConfiguration the same way you manage your // custom auto scaling configurations. This means you can do the following with the diff --git a/service/apprunner/deserializers.go b/service/apprunner/deserializers.go index cc96ca9040f..125c7521492 100644 --- a/service/apprunner/deserializers.go +++ b/service/apprunner/deserializers.go @@ -5159,6 +5159,15 @@ func awsAwsjson10_deserializeDocumentCodeRepository(v **types.CodeRepository, va return err } + case "SourceDirectory": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceDirectory to be of type string, got %T instead", value) + } + sv.SourceDirectory = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/apprunner/serializers.go b/service/apprunner/serializers.go index 9b496bc45a8..ed6effcf8ff 100644 --- a/service/apprunner/serializers.go +++ b/service/apprunner/serializers.go @@ -2149,6 +2149,11 @@ func awsAwsjson10_serializeDocumentCodeRepository(v *types.CodeRepository, value } } + if v.SourceDirectory != nil { + ok := object.Key("SourceDirectory") + ok.String(*v.SourceDirectory) + } + return nil } diff --git a/service/apprunner/types/types.go b/service/apprunner/types/types.go index 2551ed0920e..a37e4b0298b 100644 --- a/service/apprunner/types/types.go +++ b/service/apprunner/types/types.go @@ -245,6 +245,11 @@ type CodeRepository struct { // repository. CodeConfiguration is required only for CreateService request. CodeConfiguration *CodeConfiguration + // The path of the directory that stores source code and configuration files. The + // build and start commands also execute from here. The path is absolute from root + // and, if not specified, defaults to the repository root. + SourceDirectory *string + noSmithyDocumentSerde } diff --git a/service/codedeploy/api_op_BatchGetDeploymentGroups.go b/service/codedeploy/api_op_BatchGetDeploymentGroups.go index f4b80a0351d..5f4036331e6 100644 --- a/service/codedeploy/api_op_BatchGetDeploymentGroups.go +++ b/service/codedeploy/api_op_BatchGetDeploymentGroups.go @@ -35,7 +35,7 @@ func (c *Client) BatchGetDeploymentGroups(ctx context.Context, params *BatchGetD // Represents the input of a BatchGetDeploymentGroups operation. type BatchGetDeploymentGroupsInput struct { - // The name of an CodeDeploy application associated with the applicable IAM or + // The name of an CodeDeploy application associated with the applicable user or // Amazon Web Services account. // // This member is required. diff --git a/service/codedeploy/api_op_CreateApplication.go b/service/codedeploy/api_op_CreateApplication.go index 1c3c5beaa93..244bda64cbb 100644 --- a/service/codedeploy/api_op_CreateApplication.go +++ b/service/codedeploy/api_op_CreateApplication.go @@ -35,7 +35,7 @@ func (c *Client) CreateApplication(ctx context.Context, params *CreateApplicatio // Represents the input of a CreateApplication operation. type CreateApplicationInput struct { - // The name of the application. This name must be unique with the applicable IAM + // The name of the application. This name must be unique with the applicable user // or Amazon Web Services account. // // This member is required. diff --git a/service/codedeploy/api_op_CreateDeployment.go b/service/codedeploy/api_op_CreateDeployment.go index d97dc45d1b9..d594609258c 100644 --- a/service/codedeploy/api_op_CreateDeployment.go +++ b/service/codedeploy/api_op_CreateDeployment.go @@ -35,8 +35,8 @@ func (c *Client) CreateDeployment(ctx context.Context, params *CreateDeploymentI // Represents the input of a CreateDeployment operation. type CreateDeploymentInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string @@ -45,9 +45,9 @@ type CreateDeploymentInput struct { // deployment is created. AutoRollbackConfiguration *types.AutoRollbackConfiguration - // The name of a deployment configuration associated with the IAM user or Amazon - // Web Services account. If not specified, the value configured in the deployment - // group is used as the default. If the deployment group does not have a deployment + // The name of a deployment configuration associated with the user or Amazon Web + // Services account. If not specified, the value configured in the deployment group + // is used as the default. If the deployment group does not have a deployment // configuration associated with it, CodeDeployDefault . OneAtATime is used by // default. DeploymentConfigName *string diff --git a/service/codedeploy/api_op_CreateDeploymentGroup.go b/service/codedeploy/api_op_CreateDeploymentGroup.go index 1a2c32a33b4..cc12181b630 100644 --- a/service/codedeploy/api_op_CreateDeploymentGroup.go +++ b/service/codedeploy/api_op_CreateDeploymentGroup.go @@ -35,8 +35,8 @@ func (c *Client) CreateDeploymentGroup(ctx context.Context, params *CreateDeploy // Represents the input of a CreateDeploymentGroup operation. type CreateDeploymentGroupInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string diff --git a/service/codedeploy/api_op_DeleteApplication.go b/service/codedeploy/api_op_DeleteApplication.go index 63c81ca8a76..3e730177aaf 100644 --- a/service/codedeploy/api_op_DeleteApplication.go +++ b/service/codedeploy/api_op_DeleteApplication.go @@ -34,8 +34,8 @@ func (c *Client) DeleteApplication(ctx context.Context, params *DeleteApplicatio // Represents the input of a DeleteApplication operation. type DeleteApplicationInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string diff --git a/service/codedeploy/api_op_DeleteDeploymentConfig.go b/service/codedeploy/api_op_DeleteDeploymentConfig.go index c4dda6cd0e0..6448dd67116 100644 --- a/service/codedeploy/api_op_DeleteDeploymentConfig.go +++ b/service/codedeploy/api_op_DeleteDeploymentConfig.go @@ -35,8 +35,8 @@ func (c *Client) DeleteDeploymentConfig(ctx context.Context, params *DeleteDeplo // Represents the input of a DeleteDeploymentConfig operation. type DeleteDeploymentConfigInput struct { - // The name of a deployment configuration associated with the IAM user or Amazon - // Web Services account. + // The name of a deployment configuration associated with the user or Amazon Web + // Services account. // // This member is required. DeploymentConfigName *string diff --git a/service/codedeploy/api_op_DeleteDeploymentGroup.go b/service/codedeploy/api_op_DeleteDeploymentGroup.go index 579fa61a7c7..dfe5a3615ba 100644 --- a/service/codedeploy/api_op_DeleteDeploymentGroup.go +++ b/service/codedeploy/api_op_DeleteDeploymentGroup.go @@ -35,8 +35,8 @@ func (c *Client) DeleteDeploymentGroup(ctx context.Context, params *DeleteDeploy // Represents the input of a DeleteDeploymentGroup operation. type DeleteDeploymentGroupInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string diff --git a/service/codedeploy/api_op_DeleteResourcesByExternalId.go b/service/codedeploy/api_op_DeleteResourcesByExternalId.go index 73d59932fee..db6d6dc0346 100644 --- a/service/codedeploy/api_op_DeleteResourcesByExternalId.go +++ b/service/codedeploy/api_op_DeleteResourcesByExternalId.go @@ -15,7 +15,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes resources linked to an external ID. +// Deletes resources linked to an external ID. This action only applies if you +// have configured blue/green deployments through CloudFormation. It is not +// necessary to call this action directly. CloudFormation calls it on your behalf +// when it needs to delete stack resources. This action is offered publicly in case +// you need to delete resources to comply with General Data Protection Regulation +// (GDPR) requirements. func (c *Client) DeleteResourcesByExternalId(ctx context.Context, params *DeleteResourcesByExternalIdInput, optFns ...func(*Options)) (*DeleteResourcesByExternalIdOutput, error) { if params == nil { params = &DeleteResourcesByExternalIdInput{} diff --git a/service/codedeploy/api_op_GetApplication.go b/service/codedeploy/api_op_GetApplication.go index 431251e10e7..ecee38ee8f0 100644 --- a/service/codedeploy/api_op_GetApplication.go +++ b/service/codedeploy/api_op_GetApplication.go @@ -35,8 +35,8 @@ func (c *Client) GetApplication(ctx context.Context, params *GetApplicationInput // Represents the input of a GetApplication operation. type GetApplicationInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string diff --git a/service/codedeploy/api_op_GetDeployment.go b/service/codedeploy/api_op_GetDeployment.go index e86201dfbca..18adb744030 100644 --- a/service/codedeploy/api_op_GetDeployment.go +++ b/service/codedeploy/api_op_GetDeployment.go @@ -42,8 +42,8 @@ func (c *Client) GetDeployment(ctx context.Context, params *GetDeploymentInput, // Represents the input of a GetDeployment operation. type GetDeploymentInput struct { - // The unique ID of a deployment associated with the IAM user or Amazon Web - // Services account. + // The unique ID of a deployment associated with the user or Amazon Web Services + // account. // // This member is required. DeploymentId *string diff --git a/service/codedeploy/api_op_GetDeploymentConfig.go b/service/codedeploy/api_op_GetDeploymentConfig.go index 860e05d74da..2eac18ea4ac 100644 --- a/service/codedeploy/api_op_GetDeploymentConfig.go +++ b/service/codedeploy/api_op_GetDeploymentConfig.go @@ -35,8 +35,8 @@ func (c *Client) GetDeploymentConfig(ctx context.Context, params *GetDeploymentC // Represents the input of a GetDeploymentConfig operation. type GetDeploymentConfigInput struct { - // The name of a deployment configuration associated with the IAM user or Amazon - // Web Services account. + // The name of a deployment configuration associated with the user or Amazon Web + // Services account. // // This member is required. DeploymentConfigName *string diff --git a/service/codedeploy/api_op_GetDeploymentGroup.go b/service/codedeploy/api_op_GetDeploymentGroup.go index d65549179e5..d9f0ab13d51 100644 --- a/service/codedeploy/api_op_GetDeploymentGroup.go +++ b/service/codedeploy/api_op_GetDeploymentGroup.go @@ -35,8 +35,8 @@ func (c *Client) GetDeploymentGroup(ctx context.Context, params *GetDeploymentGr // Represents the input of a GetDeploymentGroup operation. type GetDeploymentGroupInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string diff --git a/service/codedeploy/api_op_ListApplicationRevisions.go b/service/codedeploy/api_op_ListApplicationRevisions.go index 0e813363ac7..99539d2eaea 100644 --- a/service/codedeploy/api_op_ListApplicationRevisions.go +++ b/service/codedeploy/api_op_ListApplicationRevisions.go @@ -35,8 +35,8 @@ func (c *Client) ListApplicationRevisions(ctx context.Context, params *ListAppli // Represents the input of a ListApplicationRevisions operation. type ListApplicationRevisionsInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string diff --git a/service/codedeploy/api_op_ListApplications.go b/service/codedeploy/api_op_ListApplications.go index 3e2a2bf02f0..4c9f03078cb 100644 --- a/service/codedeploy/api_op_ListApplications.go +++ b/service/codedeploy/api_op_ListApplications.go @@ -15,8 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the applications registered with the IAM user or Amazon Web Services -// account. +// Lists the applications registered with the user or Amazon Web Services account. func (c *Client) ListApplications(ctx context.Context, params *ListApplicationsInput, optFns ...func(*Options)) (*ListApplicationsOutput, error) { if params == nil { params = &ListApplicationsInput{} diff --git a/service/codedeploy/api_op_ListDeploymentConfigs.go b/service/codedeploy/api_op_ListDeploymentConfigs.go index 05438a595b4..6f0759dde3b 100644 --- a/service/codedeploy/api_op_ListDeploymentConfigs.go +++ b/service/codedeploy/api_op_ListDeploymentConfigs.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the deployment configurations with the IAM user or Amazon Web Services +// Lists the deployment configurations with the user or Amazon Web Services // account. func (c *Client) ListDeploymentConfigs(ctx context.Context, params *ListDeploymentConfigsInput, optFns ...func(*Options)) (*ListDeploymentConfigsOutput, error) { if params == nil { diff --git a/service/codedeploy/api_op_ListDeploymentGroups.go b/service/codedeploy/api_op_ListDeploymentGroups.go index 52ce77aa12c..194f2dc6194 100644 --- a/service/codedeploy/api_op_ListDeploymentGroups.go +++ b/service/codedeploy/api_op_ListDeploymentGroups.go @@ -15,8 +15,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the deployment groups for an application registered with the IAM user or -// Amazon Web Services account. +// Lists the deployment groups for an application registered with the Amazon Web +// Services user or Amazon Web Services account. func (c *Client) ListDeploymentGroups(ctx context.Context, params *ListDeploymentGroupsInput, optFns ...func(*Options)) (*ListDeploymentGroupsOutput, error) { if params == nil { params = &ListDeploymentGroupsInput{} @@ -35,8 +35,8 @@ func (c *Client) ListDeploymentGroups(ctx context.Context, params *ListDeploymen // Represents the input of a ListDeploymentGroups operation. type ListDeploymentGroupsInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string diff --git a/service/codedeploy/api_op_ListDeploymentInstances.go b/service/codedeploy/api_op_ListDeploymentInstances.go index 0b020b35158..a7a803948e4 100644 --- a/service/codedeploy/api_op_ListDeploymentInstances.go +++ b/service/codedeploy/api_op_ListDeploymentInstances.go @@ -19,7 +19,7 @@ import ( // The newer BatchGetDeploymentTargets should be used instead because it works // with all compute types. ListDeploymentInstances throws an exception if it is // used with a compute platform other than EC2/On-premises or Lambda. Lists the -// instance for a deployment associated with the IAM user or Amazon Web Services +// instance for a deployment associated with the user or Amazon Web Services // account. // // Deprecated: This operation is deprecated, use ListDeploymentTargets instead. diff --git a/service/codedeploy/api_op_ListDeployments.go b/service/codedeploy/api_op_ListDeployments.go index 8112b3bd51b..7d5365106ff 100644 --- a/service/codedeploy/api_op_ListDeployments.go +++ b/service/codedeploy/api_op_ListDeployments.go @@ -17,7 +17,7 @@ import ( ) // Lists the deployments in a deployment group for an application registered with -// the IAM user or Amazon Web Services account. +// the user or Amazon Web Services account. func (c *Client) ListDeployments(ctx context.Context, params *ListDeploymentsInput, optFns ...func(*Options)) (*ListDeploymentsOutput, error) { if params == nil { params = &ListDeploymentsInput{} @@ -36,8 +36,8 @@ func (c *Client) ListDeployments(ctx context.Context, params *ListDeploymentsInp // Represents the input of a ListDeployments operation. type ListDeploymentsInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. If applicationName is specified, then deploymentGroupName + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. If applicationName is specified, then deploymentGroupName // must be specified. If it is not specified, then deploymentGroupName must not be // specified. ApplicationName *string diff --git a/service/codedeploy/api_op_RegisterApplicationRevision.go b/service/codedeploy/api_op_RegisterApplicationRevision.go index a3c9afb19b9..b6933f2206a 100644 --- a/service/codedeploy/api_op_RegisterApplicationRevision.go +++ b/service/codedeploy/api_op_RegisterApplicationRevision.go @@ -35,8 +35,8 @@ func (c *Client) RegisterApplicationRevision(ctx context.Context, params *Regist // Represents the input of a RegisterApplicationRevision operation. type RegisterApplicationRevisionInput struct { - // The name of an CodeDeploy application associated with the IAM user or Amazon - // Web Services account. + // The name of an CodeDeploy application associated with the user or Amazon Web + // Services account. // // This member is required. ApplicationName *string diff --git a/service/codedeploy/api_op_RegisterOnPremisesInstance.go b/service/codedeploy/api_op_RegisterOnPremisesInstance.go index 5c0e9f71c48..ff8146fae48 100644 --- a/service/codedeploy/api_op_RegisterOnPremisesInstance.go +++ b/service/codedeploy/api_op_RegisterOnPremisesInstance.go @@ -43,7 +43,7 @@ type RegisterOnPremisesInstanceInput struct { // The ARN of the IAM session to associate with the on-premises instance. IamSessionArn *string - // The ARN of the IAM user to associate with the on-premises instance. + // The ARN of the user to associate with the on-premises instance. IamUserArn *string noSmithyDocumentSerde diff --git a/service/codedeploy/api_op_UpdateDeploymentGroup.go b/service/codedeploy/api_op_UpdateDeploymentGroup.go index 693a2c36927..62c09c774e4 100644 --- a/service/codedeploy/api_op_UpdateDeploymentGroup.go +++ b/service/codedeploy/api_op_UpdateDeploymentGroup.go @@ -60,7 +60,7 @@ type UpdateDeploymentGroupInput struct { // - To remove Auto Scaling groups, specify a non-null empty list of Auto // Scaling group names to detach all CodeDeploy-managed Auto Scaling lifecycle // hooks. For examples, see Amazon EC2 instances in an Amazon EC2 Auto Scaling - // group fail to launch and receive the error "Heartbeat Timeout" (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting-auto-scaling.html#troubleshooting-auto-scaling-heartbeat) + // group fail to launch and receive the error "Heartbeat Timeout" (https://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting-auto-scaling.html#troubleshooting-auto-scaling-heartbeat) // in the CodeDeploy User Guide. AutoScalingGroups []string diff --git a/service/codedeploy/types/errors.go b/service/codedeploy/types/errors.go index 6b0dcad2f98..a1b92115e6d 100644 --- a/service/codedeploy/types/errors.go +++ b/service/codedeploy/types/errors.go @@ -33,7 +33,7 @@ func (e *AlarmsLimitExceededException) ErrorCode() string { } func (e *AlarmsLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// An application with the specified name with the IAM user or Amazon Web Services +// An application with the specified name with the user or Amazon Web Services // account already exists. type ApplicationAlreadyExistsException struct { Message *string @@ -60,7 +60,7 @@ func (e *ApplicationAlreadyExistsException) ErrorCode() string { } func (e *ApplicationAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The application does not exist with the IAM user or Amazon Web Services account. +// The application does not exist with the user or Amazon Web Services account. type ApplicationDoesNotExistException struct { Message *string @@ -245,8 +245,8 @@ func (e *DeploymentAlreadyCompletedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// A deployment configuration with the specified name with the IAM user or Amazon -// Web Services account already exists. +// A deployment configuration with the specified name with the user or Amazon Web +// Services account already exists. type DeploymentConfigAlreadyExistsException struct { Message *string @@ -274,7 +274,7 @@ func (e *DeploymentConfigAlreadyExistsException) ErrorFault() smithy.ErrorFault return smithy.FaultClient } -// The deployment configuration does not exist with the IAM user or Amazon Web +// The deployment configuration does not exist with the user or Amazon Web // Services account. type DeploymentConfigDoesNotExistException struct { Message *string @@ -385,7 +385,7 @@ func (e *DeploymentConfigNameRequiredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The deployment with the IAM user or Amazon Web Services account does not exist. +// The deployment with the user or Amazon Web Services account does not exist. type DeploymentDoesNotExistException struct { Message *string @@ -411,8 +411,8 @@ func (e *DeploymentDoesNotExistException) ErrorCode() string { } func (e *DeploymentDoesNotExistException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// A deployment group with the specified name with the IAM user or Amazon Web -// Services account already exists. +// A deployment group with the specified name with the user or Amazon Web Services +// account already exists. type DeploymentGroupAlreadyExistsException struct { Message *string @@ -440,8 +440,8 @@ func (e *DeploymentGroupAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The named deployment group with the IAM user or Amazon Web Services account -// does not exist. +// The named deployment group with the user or Amazon Web Services account does +// not exist. type DeploymentGroupDoesNotExistException struct { Message *string @@ -829,8 +829,8 @@ func (e *GitHubAccountTokenNameRequiredException) ErrorFault() smithy.ErrorFault return smithy.FaultClient } -// No IAM ARN was included in the request. You must use an IAM session ARN or IAM -// user ARN in the request. +// No IAM ARN was included in the request. You must use an IAM session ARN or user +// ARN in the request. type IamArnRequiredException struct { Message *string @@ -885,7 +885,7 @@ func (e *IamSessionArnAlreadyRegisteredException) ErrorFault() smithy.ErrorFault return smithy.FaultClient } -// The specified IAM user ARN is already registered with an on-premises instance. +// The specified user ARN is already registered with an on-premises instance. type IamUserArnAlreadyRegisteredException struct { Message *string @@ -913,7 +913,7 @@ func (e *IamUserArnAlreadyRegisteredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// An IAM user ARN was not specified. +// An user ARN was not specified. type IamUserArnRequiredException struct { Message *string @@ -1787,7 +1787,7 @@ func (e *InvalidIamSessionArnException) ErrorCode() string { } func (e *InvalidIamSessionArnException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The IAM user ARN was specified in an invalid format. +// The user ARN was specified in an invalid format. type InvalidIamUserArnException struct { Message *string @@ -2630,8 +2630,8 @@ func (e *LifecycleHookLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Both an IAM user ARN and an IAM session ARN were included in the request. Use -// only one ARN type. +// Both an user ARN and an IAM session ARN were included in the request. Use only +// one ARN type. type MultipleIamArnsProvidedException struct { Message *string @@ -2735,8 +2735,7 @@ func (e *ResourceValidationException) ErrorCode() string { } func (e *ResourceValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The named revision does not exist with the IAM user or Amazon Web Services -// account. +// The named revision does not exist with the user or Amazon Web Services account. type RevisionDoesNotExistException struct { Message *string diff --git a/service/codedeploy/types/types.go b/service/codedeploy/types/types.go index ccf8333b901..e128c29bbe4 100644 --- a/service/codedeploy/types/types.go +++ b/service/codedeploy/types/types.go @@ -683,16 +683,17 @@ type ECSTaskSet struct { noSmithyDocumentSerde } -// Information about a load balancer in Elastic Load Balancing to use in a +// Information about a Classic Load Balancer in Elastic Load Balancing to use in a // deployment. Instances are registered directly with a load balancer, and traffic // is routed to the load balancer. type ELBInfo struct { - // For blue/green deployments, the name of the load balancer that is used to route - // traffic from original instances to replacement instances in a blue/green - // deployment. For in-place deployments, the name of the load balancer that - // instances are deregistered from so they are not serving traffic during a - // deployment, and then re-registered with after the deployment is complete. + // For blue/green deployments, the name of the Classic Load Balancer that is used + // to route traffic from original instances to replacement instances in a + // blue/green deployment. For in-place deployments, the name of the Classic Load + // Balancer that instances are deregistered from so they are not serving traffic + // during a deployment, and then re-registered with after the deployment is + // complete. Name *string noSmithyDocumentSerde @@ -795,7 +796,7 @@ type InstanceInfo struct { // The ARN of the IAM session associated with the on-premises instance. IamSessionArn *string - // The IAM user ARN associated with the on-premises instance. + // The user ARN associated with the on-premises instance. IamUserArn *string // The ARN of the on-premises instance. @@ -979,19 +980,24 @@ type LifecycleEvent struct { } // Information about the Elastic Load Balancing load balancer or target group used -// in a deployment. +// in a deployment. You can use load balancers and target groups in combination. +// For example, if you have two Classic Load Balancers, and five target groups tied +// to an Application Load Balancer, you can specify the two Classic Load Balancers +// in elbInfoList , and the five target groups in targetGroupInfoList . type LoadBalancerInfo struct { - // An array that contains information about the load balancer to use for load - // balancing in a deployment. In Elastic Load Balancing, load balancers are used - // with Classic Load Balancers. Adding more than one load balancer to the array is - // not supported. + // An array that contains information about the load balancers to use for load + // balancing in a deployment. If you're using Classic Load Balancers, specify those + // load balancers in this array. You can add up to 10 load balancers to the array. + // If you're using Application Load Balancers or Network Load Balancers, use the + // targetGroupInfoList array instead of this one. ElbInfoList []ELBInfo - // An array that contains information about the target group to use for load - // balancing in a deployment. In Elastic Load Balancing, target groups are used - // with Application Load Balancers. Adding more than one target group to the array - // is not supported. + // An array that contains information about the target groups to use for load + // balancing in a deployment. If you're using Application Load Balancers and + // Network Load Balancers, specify their associated target groups in this array. + // You can add up to 10 target groups to the array. If you're using Classic Load + // Balancers, use the elbInfoList array instead of this one. TargetGroupInfoList []TargetGroupInfo // The target group pair information. This is an array of TargeGroupPairInfo @@ -1146,6 +1152,8 @@ type S3Location struct { // - tar : A tar archive file. // - tgz : A compressed tar archive file. // - zip : A zip archive file. + // - YAML : A YAML-formatted file. + // - JSON : A JSON-formatted file. BundleType BundleType // The ETag of the Amazon S3 object that represents the bundled artifacts for the diff --git a/service/connect/api_op_CreateQuickConnect.go b/service/connect/api_op_CreateQuickConnect.go index b27fbb7f6a2..8870fa8f492 100644 --- a/service/connect/api_op_CreateQuickConnect.go +++ b/service/connect/api_op_CreateQuickConnect.go @@ -40,7 +40,7 @@ type CreateQuickConnectInput struct { // This member is required. InstanceId *string - // The name of the quick connect. + // A unique name of the quick connect. // // This member is required. Name *string diff --git a/service/connect/api_op_CreateSecurityProfile.go b/service/connect/api_op_CreateSecurityProfile.go index ce2f9786437..170b7c6003f 100644 --- a/service/connect/api_op_CreateSecurityProfile.go +++ b/service/connect/api_op_CreateSecurityProfile.go @@ -10,6 +10,7 @@ import ( 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/connect/types" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -49,6 +50,10 @@ type CreateSecurityProfileInput struct { // in Amazon Connect. AllowedAccessControlTags map[string]string + // This API is in preview release for Amazon Connect and is subject to change. A + // list of third party applications that the security profile will give access to. + Applications []types.Application + // The description of the security profile. Description *string diff --git a/service/connect/api_op_ListPhoneNumbers.go b/service/connect/api_op_ListPhoneNumbers.go index 2cafa3f55c5..5884d736eb4 100644 --- a/service/connect/api_op_ListPhoneNumbers.go +++ b/service/connect/api_op_ListPhoneNumbers.go @@ -64,7 +64,10 @@ type ListPhoneNumbersInput struct { // The ISO country code. PhoneNumberCountryCodes []types.PhoneNumberCountryCode - // The type of phone number. + // The type of phone number. We recommend using ListPhoneNumbersV2 (https://docs.aws.amazon.com/connect/latest/APIReference/API_ListPhoneNumbersV2.html) + // to return phone number types. While ListPhoneNumbers returns number types UIFN , + // SHARED , THIRD_PARTY_TF , and THIRD_PARTY_DID , it incorrectly lists them as + // TOLL_FREE or DID . PhoneNumberTypes []types.PhoneNumberType noSmithyDocumentSerde diff --git a/service/connect/api_op_ListSecurityProfileApplications.go b/service/connect/api_op_ListSecurityProfileApplications.go new file mode 100644 index 00000000000..0350d57d1c6 --- /dev/null +++ b/service/connect/api_op_ListSecurityProfileApplications.go @@ -0,0 +1,368 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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/connect/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of third party applications in a specific security profile. +func (c *Client) ListSecurityProfileApplications(ctx context.Context, params *ListSecurityProfileApplicationsInput, optFns ...func(*Options)) (*ListSecurityProfileApplicationsOutput, error) { + if params == nil { + params = &ListSecurityProfileApplicationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSecurityProfileApplications", params, optFns, c.addOperationListSecurityProfileApplicationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSecurityProfileApplicationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSecurityProfileApplicationsInput struct { + + // The instance identifier. + // + // This member is required. + InstanceId *string + + // The security profile identifier. + // + // This member is required. + SecurityProfileId *string + + // The maximum number of results to return per page. + MaxResults int32 + + // The token for the next set of results. The next set of results can be retrieved + // by using the token value returned in the previous response when making the next + // request. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSecurityProfileApplicationsOutput struct { + + // A list of the third party application's metadata. + Applications []types.Application + + // The token for the next set of results. The next set of results can be retrieved + // by using the token value returned in the previous response when making the next + // request. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSecurityProfileApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSecurityProfileApplications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSecurityProfileApplications{}, 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 = addListSecurityProfileApplicationsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpListSecurityProfileApplicationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSecurityProfileApplications(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 +} + +// ListSecurityProfileApplicationsAPIClient is a client that implements the +// ListSecurityProfileApplications operation. +type ListSecurityProfileApplicationsAPIClient interface { + ListSecurityProfileApplications(context.Context, *ListSecurityProfileApplicationsInput, ...func(*Options)) (*ListSecurityProfileApplicationsOutput, error) +} + +var _ ListSecurityProfileApplicationsAPIClient = (*Client)(nil) + +// ListSecurityProfileApplicationsPaginatorOptions is the paginator options for +// ListSecurityProfileApplications +type ListSecurityProfileApplicationsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListSecurityProfileApplicationsPaginator is a paginator for +// ListSecurityProfileApplications +type ListSecurityProfileApplicationsPaginator struct { + options ListSecurityProfileApplicationsPaginatorOptions + client ListSecurityProfileApplicationsAPIClient + params *ListSecurityProfileApplicationsInput + nextToken *string + firstPage bool +} + +// NewListSecurityProfileApplicationsPaginator returns a new +// ListSecurityProfileApplicationsPaginator +func NewListSecurityProfileApplicationsPaginator(client ListSecurityProfileApplicationsAPIClient, params *ListSecurityProfileApplicationsInput, optFns ...func(*ListSecurityProfileApplicationsPaginatorOptions)) *ListSecurityProfileApplicationsPaginator { + if params == nil { + params = &ListSecurityProfileApplicationsInput{} + } + + options := ListSecurityProfileApplicationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSecurityProfileApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityProfileApplicationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSecurityProfileApplications page. +func (p *ListSecurityProfileApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityProfileApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListSecurityProfileApplications(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_opListSecurityProfileApplications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "ListSecurityProfileApplications", + } +} + +type opListSecurityProfileApplicationsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListSecurityProfileApplicationsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListSecurityProfileApplicationsResolveEndpointMiddleware) 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 := "connect" + 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 = "connect" + } 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("connect") + } + 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 addListSecurityProfileApplicationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListSecurityProfileApplicationsResolveEndpointMiddleware{ + 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/connect/api_op_UpdateSecurityProfile.go b/service/connect/api_op_UpdateSecurityProfile.go index c39ff7639eb..ae0eabf2b51 100644 --- a/service/connect/api_op_UpdateSecurityProfile.go +++ b/service/connect/api_op_UpdateSecurityProfile.go @@ -10,6 +10,7 @@ import ( 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/connect/types" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -49,6 +50,10 @@ type UpdateSecurityProfileInput struct { // in Amazon Connect. AllowedAccessControlTags map[string]string + // This API is in preview release for Amazon Connect and is subject to change. A + // list of the third party application's metadata. + Applications []types.Application + // The description of the security profile. Description *string diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index 3a21f9c48bb..a5c7221426d 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -18851,6 +18851,174 @@ func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKe return nil } +type awsRestjson1_deserializeOpListSecurityProfileApplications struct { +} + +func (*awsRestjson1_deserializeOpListSecurityProfileApplications) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSecurityProfileApplications) 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_deserializeOpErrorListSecurityProfileApplications(response, &metadata) + } + output := &ListSecurityProfileApplicationsOutput{} + 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_deserializeOpDocumentListSecurityProfileApplicationsOutput(&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_deserializeOpErrorListSecurityProfileApplications(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("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(v **ListSecurityProfileApplicationsOutput, 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 *ListSecurityProfileApplicationsOutput + if *v == nil { + sv = &ListSecurityProfileApplicationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Applications": + if err := awsRestjson1_deserializeDocumentApplications(&sv.Applications, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListSecurityProfilePermissions struct { } @@ -31229,6 +31397,121 @@ func awsRestjson1_deserializeDocumentAllowedAccessControlTags(v *map[string]stri return nil } +func awsRestjson1_deserializeDocumentApplication(v **types.Application, 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.Application + if *v == nil { + sv = &types.Application{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicationPermissions": + if err := awsRestjson1_deserializeDocumentApplicationPermissions(&sv.ApplicationPermissions, value); err != nil { + return err + } + + case "Namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentApplicationPermissions(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Permission to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApplications(v *[]types.Application, 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.Application + if *v == nil { + cv = []types.Application{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Application + destAddr := &col + if err := awsRestjson1_deserializeDocumentApplication(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAssignContactCategoryActionDefinition(v **types.AssignContactCategoryActionDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/connect/generated.json b/service/connect/generated.json index 6be1df2bb00..1e7eb3dd3d2 100644 --- a/service/connect/generated.json +++ b/service/connect/generated.json @@ -136,6 +136,7 @@ "api_op_ListRoutingProfiles.go", "api_op_ListRules.go", "api_op_ListSecurityKeys.go", + "api_op_ListSecurityProfileApplications.go", "api_op_ListSecurityProfilePermissions.go", "api_op_ListSecurityProfiles.go", "api_op_ListTagsForResource.go", diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 2cba3e5e506..370de0d6e77 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -2762,6 +2762,13 @@ func awsRestjson1_serializeOpDocumentCreateSecurityProfileInput(v *CreateSecurit } } + if v.Applications != nil { + ok := object.Key("Applications") + if err := awsRestjson1_serializeDocumentApplications(v.Applications, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) @@ -10847,6 +10854,88 @@ func awsRestjson1_serializeOpHttpBindingsListSecurityKeysInput(v *ListSecurityKe return nil } +type awsRestjson1_serializeOpListSecurityProfileApplications struct { +} + +func (*awsRestjson1_serializeOpListSecurityProfileApplications) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSecurityProfileApplications) 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.(*ListSecurityProfileApplicationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/security-profiles-applications/{InstanceId}/{SecurityProfileId}") + 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_serializeOpHttpBindingsListSecurityProfileApplicationsInput(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_serializeOpHttpBindingsListSecurityProfileApplicationsInput(v *ListSecurityProfileApplicationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.SecurityProfileId == nil || len(*v.SecurityProfileId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SecurityProfileId must not be empty")} + } + if v.SecurityProfileId != nil { + if err := encoder.SetURI("SecurityProfileId").String(*v.SecurityProfileId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListSecurityProfilePermissions struct { } @@ -17649,6 +17738,13 @@ func awsRestjson1_serializeOpDocumentUpdateSecurityProfileInput(v *UpdateSecurit } } + if v.Applications != nil { + ok := object.Key("Applications") + if err := awsRestjson1_serializeDocumentApplications(v.Applications, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) @@ -18856,6 +18952,49 @@ func awsRestjson1_serializeDocumentAnswerMachineDetectionConfig(v *types.AnswerM return nil } +func awsRestjson1_serializeDocumentApplication(v *types.Application, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationPermissions != nil { + ok := object.Key("ApplicationPermissions") + if err := awsRestjson1_serializeDocumentApplicationPermissions(v.ApplicationPermissions, ok); err != nil { + return err + } + } + + if v.Namespace != nil { + ok := object.Key("Namespace") + ok.String(*v.Namespace) + } + + return nil +} + +func awsRestjson1_serializeDocumentApplicationPermissions(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentApplications(v []types.Application, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentApplication(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAssignContactCategoryActionDefinition(v *types.AssignContactCategoryActionDefinition, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index 3ababaacb98..f202da88476 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -729,6 +729,7 @@ const ( IntegrationTypeWisdomAssistant IntegrationType = "WISDOM_ASSISTANT" IntegrationTypeWisdomKnowledgeBase IntegrationType = "WISDOM_KNOWLEDGE_BASE" IntegrationTypeCasesDomain IntegrationType = "CASES_DOMAIN" + IntegrationTypeApplication IntegrationType = "APPLICATION" ) // Values returns all known values for IntegrationType. Note that this can be @@ -742,6 +743,7 @@ func (IntegrationType) Values() []IntegrationType { "WISDOM_ASSISTANT", "WISDOM_KNOWLEDGE_BASE", "CASES_DOMAIN", + "APPLICATION", } } diff --git a/service/connect/types/types.go b/service/connect/types/types.go index 08274234b53..c26edd53aa9 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -147,6 +147,20 @@ type AnswerMachineDetectionConfig struct { noSmithyDocumentSerde } +// This API is in preview release for Amazon Connect and is subject to change. A +// third party application's metadata. +type Application struct { + + // The permissions that the agent is granted on the application. Only the ACCESS + // permission is supported. + ApplicationPermissions []string + + // Namespace of the application that you want to give access to. + Namespace *string + + noSmithyDocumentSerde +} + // This action must be set if TriggerEventSource is one of the following values: // OnPostCallAnalysisAvailable | OnRealTimeCallAnalysisAvailable | // OnPostChatAnalysisAvailable . Contact is categorized using the rule name. @@ -3053,13 +3067,21 @@ type RuleAction struct { // This member is required. ActionType ActionType - // Information about the contact category action. + // Information about the contact category action. Supported only for + // TriggerEventSource values: OnPostCallAnalysisAvailable | + // OnRealTimeCallAnalysisAvailable | OnPostChatAnalysisAvailable | + // OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate AssignContactCategoryAction *AssignContactCategoryActionDefinition - // Information about the EventBridge action. + // Information about the EventBridge action. Supported only for TriggerEventSource + // values: OnPostCallAnalysisAvailable | OnRealTimeCallAnalysisAvailable | + // OnPostChatAnalysisAvailable | OnContactEvaluationSubmit | OnMetricDataUpdate EventBridgeAction *EventBridgeActionDefinition - // Information about the send notification action. + // Information about the send notification action. Supported only for + // TriggerEventSource values: OnPostCallAnalysisAvailable | + // OnRealTimeCallAnalysisAvailable | OnPostChatAnalysisAvailable | + // OnContactEvaluationSubmit | OnMetricDataUpdate SendNotificationAction *SendNotificationActionDefinition // Information about the task action. This field is required if TriggerEventSource @@ -3118,7 +3140,7 @@ type RuleSummary struct { // The name of the event source. This field is required if TriggerEventSource is // one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate -// | OnSalesforceCaseCreate +// | OnSalesforceCaseCreate | OnContactEvaluationSubmit | OnMetricDataUpdate . type RuleTriggerEventSource struct { // The name of the event source. diff --git a/service/connect/validators.go b/service/connect/validators.go index 1a4c39819e4..6630033deb8 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -2510,6 +2510,26 @@ func (m *validateOpListSecurityKeys) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpListSecurityProfileApplications struct { +} + +func (*validateOpListSecurityProfileApplications) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSecurityProfileApplications) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSecurityProfileApplicationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSecurityProfileApplicationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListSecurityProfilePermissions struct { } @@ -4610,6 +4630,10 @@ func addOpListSecurityKeysValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSecurityKeys{}, middleware.After) } +func addOpListSecurityProfileApplicationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSecurityProfileApplications{}, middleware.After) +} + func addOpListSecurityProfilePermissionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSecurityProfilePermissions{}, middleware.After) } @@ -8598,6 +8622,24 @@ func validateOpListSecurityKeysInput(v *ListSecurityKeysInput) error { } } +func validateOpListSecurityProfileApplicationsInput(v *ListSecurityProfileApplicationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSecurityProfileApplicationsInput"} + if v.SecurityProfileId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecurityProfileId")) + } + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListSecurityProfilePermissionsInput(v *ListSecurityProfilePermissionsInput) error { if v == nil { return nil diff --git a/service/dynamodb/api_op_ExportTableToPointInTime.go b/service/dynamodb/api_op_ExportTableToPointInTime.go index e1d17adde6a..6814d3db325 100644 --- a/service/dynamodb/api_op_ExportTableToPointInTime.go +++ b/service/dynamodb/api_op_ExportTableToPointInTime.go @@ -67,6 +67,14 @@ type ExportTableToPointInTimeInput struct { // state at this point in time. ExportTime *time.Time + // Choice of whether to execute as a full export or incremental export. Valid + // values are FULL_EXPORT or INCREMENTAL_EXPORT . If INCREMENTAL_EXPORT is + // provided, the IncrementalExportSpecification must also be used. + ExportType types.ExportType + + // Optional object containing the parameters specific to an incremental export. + IncrementalExportSpecification *types.IncrementalExportSpecification + // The ID of the Amazon Web Services account that owns the bucket the export will // be stored in. S3BucketOwner *string diff --git a/service/dynamodb/api_op_ListBackups.go b/service/dynamodb/api_op_ListBackups.go index 9ddc8e5469f..44a5b262be3 100644 --- a/service/dynamodb/api_op_ListBackups.go +++ b/service/dynamodb/api_op_ListBackups.go @@ -18,13 +18,16 @@ import ( "time" ) -// List backups associated with an Amazon Web Services account. To list backups -// for a given table, specify TableName . ListBackups returns a paginated list of +// List DynamoDB backups that are associated with an Amazon Web Services account +// and weren't made with Amazon Web Services Backup. To list these backups for a +// given table, specify TableName . ListBackups returns a paginated list of // results with at most 1 MB worth of items in a page. You can also specify a // maximum number of entries to be returned in a page. In the request, start time // is inclusive, but end time is exclusive. Note that these boundaries are for the // time at which the original backup was requested. You can call ListBackups a -// maximum of five times per second. +// maximum of five times per second. If you want to retrieve the complete list of +// backups made with Amazon Web Services Backup, use the Amazon Web Services +// Backup list API. (https://docs.aws.amazon.com/aws-backup/latest/devguide/API_ListBackupJobs.html) func (c *Client) ListBackups(ctx context.Context, params *ListBackupsInput, optFns ...func(*Options)) (*ListBackupsOutput, error) { if params == nil { params = &ListBackupsInput{} diff --git a/service/dynamodb/deserializers.go b/service/dynamodb/deserializers.go index e4d99a1758a..ccb22609a36 100644 --- a/service/dynamodb/deserializers.go +++ b/service/dynamodb/deserializers.go @@ -9900,6 +9900,15 @@ func awsAwsjson10_deserializeDocumentExportDescription(v **types.ExportDescripti } } + case "ExportType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExportType to be of type string, got %T instead", value) + } + sv.ExportType = types.ExportType(jtv) + } + case "FailureCode": if value != nil { jtv, ok := value.(string) @@ -9918,6 +9927,11 @@ func awsAwsjson10_deserializeDocumentExportDescription(v **types.ExportDescripti sv.FailureMessage = ptr.String(jtv) } + case "IncrementalExportSpecification": + if err := awsAwsjson10_deserializeDocumentIncrementalExportSpecification(&sv.IncrementalExportSpecification, value); err != nil { + return err + } + case "ItemCount": if value != nil { jtv, ok := value.(json.Number) @@ -10133,6 +10147,15 @@ func awsAwsjson10_deserializeDocumentExportSummary(v **types.ExportSummary, valu sv.ExportStatus = types.ExportStatus(jtv) } + case "ExportType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExportType to be of type string, got %T instead", value) + } + sv.ExportType = types.ExportType(jtv) + } + default: _, _ = key, value @@ -11272,6 +11295,78 @@ func awsAwsjson10_deserializeDocumentImportTableDescription(v **types.ImportTabl return nil } +func awsAwsjson10_deserializeDocumentIncrementalExportSpecification(v **types.IncrementalExportSpecification, 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.IncrementalExportSpecification + if *v == nil { + sv = &types.IncrementalExportSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExportFromTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExportFromTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ExportFromTime to be a JSON Number, got %T instead", value) + + } + } + + case "ExportToTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExportToTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ExportToTime to be a JSON Number, got %T instead", value) + + } + } + + case "ExportViewType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExportViewType to be of type string, got %T instead", value) + } + sv.ExportViewType = types.ExportViewType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentIndexNotFoundException(v **types.IndexNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/dynamodb/serializers.go b/service/dynamodb/serializers.go index 8427f74ad45..0317bd60ff7 100644 --- a/service/dynamodb/serializers.go +++ b/service/dynamodb/serializers.go @@ -3788,6 +3788,28 @@ func awsAwsjson10_serializeDocumentGlobalTableGlobalSecondaryIndexSettingsUpdate return nil } +func awsAwsjson10_serializeDocumentIncrementalExportSpecification(v *types.IncrementalExportSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExportFromTime != nil { + ok := object.Key("ExportFromTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ExportFromTime)) + } + + if v.ExportToTime != nil { + ok := object.Key("ExportToTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ExportToTime)) + } + + if len(v.ExportViewType) > 0 { + ok := object.Key("ExportViewType") + ok.String(string(v.ExportViewType)) + } + + return nil +} + func awsAwsjson10_serializeDocumentInputFormatOptions(v *types.InputFormatOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5438,6 +5460,18 @@ func awsAwsjson10_serializeOpDocumentExportTableToPointInTimeInput(v *ExportTabl ok.Double(smithytime.FormatEpochSeconds(*v.ExportTime)) } + if len(v.ExportType) > 0 { + ok := object.Key("ExportType") + ok.String(string(v.ExportType)) + } + + if v.IncrementalExportSpecification != nil { + ok := object.Key("IncrementalExportSpecification") + if err := awsAwsjson10_serializeDocumentIncrementalExportSpecification(v.IncrementalExportSpecification, ok); err != nil { + return err + } + } + if v.S3Bucket != nil { ok := object.Key("S3Bucket") ok.String(*v.S3Bucket) diff --git a/service/dynamodb/types/enums.go b/service/dynamodb/types/enums.go index 5a99a7cc5b0..a603b3406ef 100644 --- a/service/dynamodb/types/enums.go +++ b/service/dynamodb/types/enums.go @@ -318,6 +318,42 @@ func (ExportStatus) Values() []ExportStatus { } } +type ExportType string + +// Enum values for ExportType +const ( + ExportTypeFullExport ExportType = "FULL_EXPORT" + ExportTypeIncrementalExport ExportType = "INCREMENTAL_EXPORT" +) + +// Values returns all known values for ExportType. 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 (ExportType) Values() []ExportType { + return []ExportType{ + "FULL_EXPORT", + "INCREMENTAL_EXPORT", + } +} + +type ExportViewType string + +// Enum values for ExportViewType +const ( + ExportViewTypeNewImage ExportViewType = "NEW_IMAGE" + ExportViewTypeNewAndOldImages ExportViewType = "NEW_AND_OLD_IMAGES" +) + +// Values returns all known values for ExportViewType. 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 (ExportViewType) Values() []ExportViewType { + return []ExportViewType{ + "NEW_IMAGE", + "NEW_AND_OLD_IMAGES", + } +} + type GlobalTableStatus string // Enum values for GlobalTableStatus diff --git a/service/dynamodb/types/types.go b/service/dynamodb/types/types.go index 5e946d17946..6c054fd8057 100644 --- a/service/dynamodb/types/types.go +++ b/service/dynamodb/types/types.go @@ -1173,12 +1173,20 @@ type ExportDescription struct { // Point in time from which table data was exported. ExportTime *time.Time + // Choice of whether to execute as a full export or incremental export. Valid + // values are FULL_EXPORT or INCREMENTAL_EXPORT . If INCREMENTAL_EXPORT is + // provided, the IncrementalExportSpecification must also be used. + ExportType ExportType + // Status code for the result of the failed export. FailureCode *string // Export failure reason description. FailureMessage *string + // Optional object containing the parameters specific to an incremental export. + IncrementalExportSpecification *IncrementalExportSpecification + // The number of items exported. ItemCount *int64 @@ -1224,6 +1232,11 @@ type ExportSummary struct { // Export can be in one of the following states: IN_PROGRESS, COMPLETED, or FAILED. ExportStatus ExportStatus + // Choice of whether to execute as a full export or incremental export. Valid + // values are FULL_EXPORT or INCREMENTAL_EXPORT . If INCREMENTAL_EXPORT is + // provided, the IncrementalExportSpecification must also be used. + ExportType ExportType + noSmithyDocumentSerde } @@ -1607,6 +1620,28 @@ type ImportTableDescription struct { noSmithyDocumentSerde } +// Optional object containing the parameters specific to an incremental export. +type IncrementalExportSpecification struct { + + // Time in the past which provides the inclusive start range for the export + // table's data, counted in seconds from the start of the Unix epoch. The + // incremental export will reflect the table's state including and after this point + // in time. + ExportFromTime *time.Time + + // Time in the past which provides the exclusive end range for the export table's + // data, counted in seconds from the start of the Unix epoch. The incremental + // export will reflect the table's state just prior to this point in time. If this + // is not provided, the latest time with data available will be used. + ExportToTime *time.Time + + // Choice of whether to output the previous item image prior to the start time of + // the incremental export. Valid values are NEW_AND_OLD_IMAGES and NEW_IMAGES . + ExportViewType ExportViewType + + noSmithyDocumentSerde +} + // The format options for the data that was imported into the target table. There // is one value, CsvOption. type InputFormatOptions struct { diff --git a/service/ec2/api_op_CreateVerifiedAccessInstance.go b/service/ec2/api_op_CreateVerifiedAccessInstance.go index 27c55d38c6a..ae5ef32a169 100644 --- a/service/ec2/api_op_CreateVerifiedAccessInstance.go +++ b/service/ec2/api_op_CreateVerifiedAccessInstance.go @@ -50,6 +50,10 @@ type CreateVerifiedAccessInstanceInput struct { // UnauthorizedOperation . DryRun *bool + // Choose to enable or disable support for Federal Information Processing + // Standards (FIPS) on the instance. + FIPSEnabled *bool + // The tags to assign to the Verified Access instance. TagSpecifications []types.TagSpecification diff --git a/service/ec2/api_op_RevokeSecurityGroupIngress.go b/service/ec2/api_op_RevokeSecurityGroupIngress.go index 316c14989c3..8c41904c6d3 100644 --- a/service/ec2/api_op_RevokeSecurityGroupIngress.go +++ b/service/ec2/api_op_RevokeSecurityGroupIngress.go @@ -26,10 +26,12 @@ import ( // group rule has a description, you do not need to specify the description to // revoke the rule. For a default VPC, if the values you specify do not match the // existing rule's values, no error is returned, and the output describes the -// security group rules that were not revoked. Amazon Web Services recommends that -// you describe the security group to verify that the rules were removed. Rule -// changes are propagated to instances within the security group as quickly as -// possible. However, a small delay might occur. +// security group rules that were not revoked. For a non-default VPC, if the values +// you specify do not match the existing rule's values, an +// InvalidPermission.NotFound client error is returned, and no rules are revoked. +// Amazon Web Services recommends that you describe the security group to verify +// that the rules were removed. Rule changes are propagated to instances within the +// security group as quickly as possible. However, a small delay might occur. func (c *Client) RevokeSecurityGroupIngress(ctx context.Context, params *RevokeSecurityGroupIngressInput, optFns ...func(*Options)) (*RevokeSecurityGroupIngressOutput, error) { if params == nil { params = &RevokeSecurityGroupIngressInput{} diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index a4b80ac78e0..550e192be68 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -127959,6 +127959,22 @@ func awsEc2query_deserializeDocumentVerifiedAccessInstance(v **types.VerifiedAcc sv.Description = ptr.String(xtv) } + case strings.EqualFold("fipsEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.FipsEnabled = ptr.Bool(xtv) + } + case strings.EqualFold("lastUpdatedTime", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index fd944068dd5..7718a7ce973 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -51811,6 +51811,11 @@ func awsEc2query_serializeOpDocumentCreateVerifiedAccessInstanceInput(v *CreateV objectKey.Boolean(*v.DryRun) } + if v.FIPSEnabled != nil { + objectKey := object.Key("FIPSEnabled") + objectKey.Boolean(*v.FIPSEnabled) + } + if v.TagSpecifications != nil { objectKey := object.FlatKey("TagSpecification") if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 96ef657e585..ad7331c54f6 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -16543,6 +16543,10 @@ type VerifiedAccessInstance struct { // A description for the Amazon Web Services Verified Access instance. Description *string + // Describes if support for Federal Information Processing Standards (FIPS) is + // enabled on the instance. + FipsEnabled *bool + // The last updated time. LastUpdatedTime *string diff --git a/service/lakeformation/api_op_CreateLakeFormationOptIn.go b/service/lakeformation/api_op_CreateLakeFormationOptIn.go new file mode 100644 index 00000000000..12a90833cc3 --- /dev/null +++ b/service/lakeformation/api_op_CreateLakeFormationOptIn.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +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/lakeformation/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enforce Lake Formation permissions for the given databases, tables, and +// principals. +func (c *Client) CreateLakeFormationOptIn(ctx context.Context, params *CreateLakeFormationOptInInput, optFns ...func(*Options)) (*CreateLakeFormationOptInOutput, error) { + if params == nil { + params = &CreateLakeFormationOptInInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLakeFormationOptIn", params, optFns, c.addOperationCreateLakeFormationOptInMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLakeFormationOptInOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateLakeFormationOptInInput struct { + + // The Lake Formation principal. Supported principals are IAM users or IAM roles. + // + // This member is required. + Principal *types.DataLakePrincipal + + // A structure for the resource. + // + // This member is required. + Resource *types.Resource + + noSmithyDocumentSerde +} + +type CreateLakeFormationOptInOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLakeFormationOptInMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateLakeFormationOptIn{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateLakeFormationOptIn{}, 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 = addCreateLakeFormationOptInResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateLakeFormationOptInValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLakeFormationOptIn(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_opCreateLakeFormationOptIn(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lakeformation", + OperationName: "CreateLakeFormationOptIn", + } +} + +type opCreateLakeFormationOptInResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateLakeFormationOptInResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateLakeFormationOptInResolveEndpointMiddleware) 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 := "lakeformation" + 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 = "lakeformation" + } 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("lakeformation") + } + 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 addCreateLakeFormationOptInResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateLakeFormationOptInResolveEndpointMiddleware{ + 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/lakeformation/api_op_DeleteLakeFormationOptIn.go b/service/lakeformation/api_op_DeleteLakeFormationOptIn.go new file mode 100644 index 00000000000..bd3ae4a20b9 --- /dev/null +++ b/service/lakeformation/api_op_DeleteLakeFormationOptIn.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +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/lakeformation/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Remove the Lake Formation permissions enforcement of the given databases, +// tables, and principals. +func (c *Client) DeleteLakeFormationOptIn(ctx context.Context, params *DeleteLakeFormationOptInInput, optFns ...func(*Options)) (*DeleteLakeFormationOptInOutput, error) { + if params == nil { + params = &DeleteLakeFormationOptInInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLakeFormationOptIn", params, optFns, c.addOperationDeleteLakeFormationOptInMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLakeFormationOptInOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteLakeFormationOptInInput struct { + + // The Lake Formation principal. Supported principals are IAM users or IAM roles. + // + // This member is required. + Principal *types.DataLakePrincipal + + // A structure for the resource. + // + // This member is required. + Resource *types.Resource + + noSmithyDocumentSerde +} + +type DeleteLakeFormationOptInOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLakeFormationOptInMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteLakeFormationOptIn{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteLakeFormationOptIn{}, 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 = addDeleteLakeFormationOptInResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteLakeFormationOptInValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLakeFormationOptIn(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_opDeleteLakeFormationOptIn(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lakeformation", + OperationName: "DeleteLakeFormationOptIn", + } +} + +type opDeleteLakeFormationOptInResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteLakeFormationOptInResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteLakeFormationOptInResolveEndpointMiddleware) 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 := "lakeformation" + 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 = "lakeformation" + } 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("lakeformation") + } + 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 addDeleteLakeFormationOptInResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteLakeFormationOptInResolveEndpointMiddleware{ + 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/lakeformation/api_op_ListLakeFormationOptIns.go b/service/lakeformation/api_op_ListLakeFormationOptIns.go new file mode 100644 index 00000000000..b08543cc05c --- /dev/null +++ b/service/lakeformation/api_op_ListLakeFormationOptIns.go @@ -0,0 +1,364 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +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/lakeformation/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieve the current list of resources and principals that are opt in to +// enforce Lake Formation permissions. +func (c *Client) ListLakeFormationOptIns(ctx context.Context, params *ListLakeFormationOptInsInput, optFns ...func(*Options)) (*ListLakeFormationOptInsOutput, error) { + if params == nil { + params = &ListLakeFormationOptInsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLakeFormationOptIns", params, optFns, c.addOperationListLakeFormationOptInsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLakeFormationOptInsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListLakeFormationOptInsInput struct { + + // The maximum number of results to return. + MaxResults *int32 + + // A continuation token, if this is not the first call to retrieve this list. + NextToken *string + + // The Lake Formation principal. Supported principals are IAM users or IAM roles. + Principal *types.DataLakePrincipal + + // A structure for the resource. + Resource *types.Resource + + noSmithyDocumentSerde +} + +type ListLakeFormationOptInsOutput struct { + + // A list of principal-resource pairs that have Lake Formation permissins enforced. + LakeFormationOptInsInfoList []types.LakeFormationOptInsInfo + + // A continuation token, if this is not the first call to retrieve this list. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListLakeFormationOptInsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListLakeFormationOptIns{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLakeFormationOptIns{}, 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 = addListLakeFormationOptInsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpListLakeFormationOptInsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLakeFormationOptIns(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 +} + +// ListLakeFormationOptInsAPIClient is a client that implements the +// ListLakeFormationOptIns operation. +type ListLakeFormationOptInsAPIClient interface { + ListLakeFormationOptIns(context.Context, *ListLakeFormationOptInsInput, ...func(*Options)) (*ListLakeFormationOptInsOutput, error) +} + +var _ ListLakeFormationOptInsAPIClient = (*Client)(nil) + +// ListLakeFormationOptInsPaginatorOptions is the paginator options for +// ListLakeFormationOptIns +type ListLakeFormationOptInsPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListLakeFormationOptInsPaginator is a paginator for ListLakeFormationOptIns +type ListLakeFormationOptInsPaginator struct { + options ListLakeFormationOptInsPaginatorOptions + client ListLakeFormationOptInsAPIClient + params *ListLakeFormationOptInsInput + nextToken *string + firstPage bool +} + +// NewListLakeFormationOptInsPaginator returns a new +// ListLakeFormationOptInsPaginator +func NewListLakeFormationOptInsPaginator(client ListLakeFormationOptInsAPIClient, params *ListLakeFormationOptInsInput, optFns ...func(*ListLakeFormationOptInsPaginatorOptions)) *ListLakeFormationOptInsPaginator { + if params == nil { + params = &ListLakeFormationOptInsInput{} + } + + options := ListLakeFormationOptInsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListLakeFormationOptInsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLakeFormationOptInsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListLakeFormationOptIns page. +func (p *ListLakeFormationOptInsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLakeFormationOptInsOutput, 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.ListLakeFormationOptIns(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_opListLakeFormationOptIns(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lakeformation", + OperationName: "ListLakeFormationOptIns", + } +} + +type opListLakeFormationOptInsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListLakeFormationOptInsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListLakeFormationOptInsResolveEndpointMiddleware) 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 := "lakeformation" + 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 = "lakeformation" + } 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("lakeformation") + } + 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 addListLakeFormationOptInsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListLakeFormationOptInsResolveEndpointMiddleware{ + 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/lakeformation/api_op_RegisterResource.go b/service/lakeformation/api_op_RegisterResource.go index 09d0029fdda..abbf763f7fe 100644 --- a/service/lakeformation/api_op_RegisterResource.go +++ b/service/lakeformation/api_op_RegisterResource.go @@ -50,6 +50,10 @@ type RegisterResourceInput struct { // This member is required. ResourceArn *string + // Specifies whether the data access of tables pointing to the location can be + // managed by both Lake Formation permissions as well as Amazon S3 bucket policies. + HybridAccessEnabled *bool + // The identifier for the role that registers the resource. RoleArn *string diff --git a/service/lakeformation/api_op_UpdateResource.go b/service/lakeformation/api_op_UpdateResource.go index 0ff390e3880..b7a98378d8a 100644 --- a/service/lakeformation/api_op_UpdateResource.go +++ b/service/lakeformation/api_op_UpdateResource.go @@ -44,6 +44,10 @@ type UpdateResourceInput struct { // This member is required. RoleArn *string + // Specifies whether the data access of tables pointing to the location can be + // managed by both Lake Formation permissions as well as Amazon S3 bucket policies. + HybridAccessEnabled *bool + // Whether or not the resource is a federated resource. WithFederation *bool diff --git a/service/lakeformation/deserializers.go b/service/lakeformation/deserializers.go index 966722654dc..eaa3888bd0b 100644 --- a/service/lakeformation/deserializers.go +++ b/service/lakeformation/deserializers.go @@ -1046,6 +1046,104 @@ func awsRestjson1_deserializeOpErrorCreateDataCellsFilter(response *smithyhttp.R } } +type awsRestjson1_deserializeOpCreateLakeFormationOptIn struct { +} + +func (*awsRestjson1_deserializeOpCreateLakeFormationOptIn) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateLakeFormationOptIn) 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_deserializeOpErrorCreateLakeFormationOptIn(response, &metadata) + } + output := &CreateLakeFormationOptInOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateLakeFormationOptIn(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("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpCreateLFTag struct { } @@ -1239,6 +1337,104 @@ func awsRestjson1_deserializeOpErrorDeleteDataCellsFilter(response *smithyhttp.R } } +type awsRestjson1_deserializeOpDeleteLakeFormationOptIn struct { +} + +func (*awsRestjson1_deserializeOpDeleteLakeFormationOptIn) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteLakeFormationOptIn) 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_deserializeOpErrorDeleteLakeFormationOptIn(response, &metadata) + } + output := &DeleteLakeFormationOptInOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteLakeFormationOptIn(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("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDeleteLFTag struct { } @@ -4229,6 +4425,171 @@ func awsRestjson1_deserializeOpDocumentListDataCellsFilterOutput(v **ListDataCel return nil } +type awsRestjson1_deserializeOpListLakeFormationOptIns struct { +} + +func (*awsRestjson1_deserializeOpListLakeFormationOptIns) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListLakeFormationOptIns) 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_deserializeOpErrorListLakeFormationOptIns(response, &metadata) + } + output := &ListLakeFormationOptInsOutput{} + 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_deserializeOpDocumentListLakeFormationOptInsOutput(&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_deserializeOpErrorListLakeFormationOptIns(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("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListLakeFormationOptInsOutput(v **ListLakeFormationOptInsOutput, 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 *ListLakeFormationOptInsOutput + if *v == nil { + sv = &ListLakeFormationOptInsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LakeFormationOptInsInfoList": + if err := awsRestjson1_deserializeDocumentLakeFormationOptInsInfoList(&sv.LakeFormationOptInsInfoList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListLFTags struct { } @@ -8728,6 +9089,106 @@ func awsRestjson1_deserializeDocumentInvalidInputException(v **types.InvalidInpu return nil } +func awsRestjson1_deserializeDocumentLakeFormationOptInsInfo(v **types.LakeFormationOptInsInfo, 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.LakeFormationOptInsInfo + if *v == nil { + sv = &types.LakeFormationOptInsInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LastModified": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastModifiedTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "LastUpdatedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.LastUpdatedBy = ptr.String(jtv) + } + + case "Principal": + if err := awsRestjson1_deserializeDocumentDataLakePrincipal(&sv.Principal, value); err != nil { + return err + } + + case "Resource": + if err := awsRestjson1_deserializeDocumentResource(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLakeFormationOptInsInfoList(v *[]types.LakeFormationOptInsInfo, 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.LakeFormationOptInsInfo + if *v == nil { + cv = []types.LakeFormationOptInsInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LakeFormationOptInsInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentLakeFormationOptInsInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentLFTag(v **types.LFTag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9492,6 +9953,31 @@ func awsRestjson1_deserializeDocumentPrincipalResourcePermissions(v **types.Prin return err } + case "LastUpdated": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastModifiedTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "LastUpdatedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.LastUpdatedBy = ptr.String(jtv) + } + case "Permissions": if err := awsRestjson1_deserializeDocumentPermissionList(&sv.Permissions, value); err != nil { return err @@ -9648,6 +10134,15 @@ func awsRestjson1_deserializeDocumentResourceInfo(v **types.ResourceInfo, value for key, value := range shape { switch key { + case "HybridAccessEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.HybridAccessEnabled = ptr.Bool(jtv) + } + case "LastModified": if value != nil { switch jtv := value.(type) { diff --git a/service/lakeformation/generated.json b/service/lakeformation/generated.json index 490c10af6fa..c665863f0ff 100644 --- a/service/lakeformation/generated.json +++ b/service/lakeformation/generated.json @@ -17,8 +17,10 @@ "api_op_CommitTransaction.go", "api_op_CreateDataCellsFilter.go", "api_op_CreateLFTag.go", + "api_op_CreateLakeFormationOptIn.go", "api_op_DeleteDataCellsFilter.go", "api_op_DeleteLFTag.go", + "api_op_DeleteLakeFormationOptIn.go", "api_op_DeleteObjectsOnCancel.go", "api_op_DeregisterResource.go", "api_op_DescribeResource.go", @@ -39,6 +41,7 @@ "api_op_GrantPermissions.go", "api_op_ListDataCellsFilter.go", "api_op_ListLFTags.go", + "api_op_ListLakeFormationOptIns.go", "api_op_ListPermissions.go", "api_op_ListResources.go", "api_op_ListTableStorageOptimizers.go", diff --git a/service/lakeformation/serializers.go b/service/lakeformation/serializers.go index 49477f5b675..c7c45738591 100644 --- a/service/lakeformation/serializers.go +++ b/service/lakeformation/serializers.go @@ -585,6 +585,90 @@ func awsRestjson1_serializeOpDocumentCreateDataCellsFilterInput(v *CreateDataCel return nil } +type awsRestjson1_serializeOpCreateLakeFormationOptIn struct { +} + +func (*awsRestjson1_serializeOpCreateLakeFormationOptIn) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateLakeFormationOptIn) 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.(*CreateLakeFormationOptInInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/CreateLakeFormationOptIn") + 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_serializeOpDocumentCreateLakeFormationOptInInput(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_serializeOpHttpBindingsCreateLakeFormationOptInInput(v *CreateLakeFormationOptInInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateLakeFormationOptInInput(v *CreateLakeFormationOptInInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Principal != nil { + ok := object.Key("Principal") + if err := awsRestjson1_serializeDocumentDataLakePrincipal(v.Principal, ok); err != nil { + return err + } + } + + if v.Resource != nil { + ok := object.Key("Resource") + if err := awsRestjson1_serializeDocumentResource(v.Resource, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateLFTag struct { } @@ -762,6 +846,90 @@ func awsRestjson1_serializeOpDocumentDeleteDataCellsFilterInput(v *DeleteDataCel return nil } +type awsRestjson1_serializeOpDeleteLakeFormationOptIn struct { +} + +func (*awsRestjson1_serializeOpDeleteLakeFormationOptIn) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteLakeFormationOptIn) 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.(*DeleteLakeFormationOptInInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteLakeFormationOptIn") + 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_serializeOpDocumentDeleteLakeFormationOptInInput(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_serializeOpHttpBindingsDeleteLakeFormationOptInInput(v *DeleteLakeFormationOptInInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteLakeFormationOptInInput(v *DeleteLakeFormationOptInInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Principal != nil { + ok := object.Key("Principal") + if err := awsRestjson1_serializeDocumentDataLakePrincipal(v.Principal, ok); err != nil { + return err + } + } + + if v.Resource != nil { + ok := object.Key("Resource") + if err := awsRestjson1_serializeDocumentResource(v.Resource, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteLFTag struct { } @@ -2490,6 +2658,100 @@ func awsRestjson1_serializeOpDocumentListDataCellsFilterInput(v *ListDataCellsFi return nil } +type awsRestjson1_serializeOpListLakeFormationOptIns struct { +} + +func (*awsRestjson1_serializeOpListLakeFormationOptIns) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListLakeFormationOptIns) 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.(*ListLakeFormationOptInsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListLakeFormationOptIns") + 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_serializeOpDocumentListLakeFormationOptInsInput(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_serializeOpHttpBindingsListLakeFormationOptInsInput(v *ListLakeFormationOptInsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListLakeFormationOptInsInput(v *ListLakeFormationOptInsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.Principal != nil { + ok := object.Key("Principal") + if err := awsRestjson1_serializeDocumentDataLakePrincipal(v.Principal, ok); err != nil { + return err + } + } + + if v.Resource != nil { + ok := object.Key("Resource") + if err := awsRestjson1_serializeDocumentResource(v.Resource, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListLFTags struct { } @@ -3115,6 +3377,11 @@ func awsRestjson1_serializeOpDocumentRegisterResourceInput(v *RegisterResourceIn object := value.Object() defer object.Close() + if v.HybridAccessEnabled != nil { + ok := object.Key("HybridAccessEnabled") + ok.Boolean(*v.HybridAccessEnabled) + } + if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) @@ -3909,6 +4176,11 @@ func awsRestjson1_serializeOpDocumentUpdateResourceInput(v *UpdateResourceInput, object := value.Object() defer object.Close() + if v.HybridAccessEnabled != nil { + ok := object.Key("HybridAccessEnabled") + ok.Boolean(*v.HybridAccessEnabled) + } + if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) diff --git a/service/lakeformation/types/types.go b/service/lakeformation/types/types.go index c7b3c5af199..acea213c8bc 100644 --- a/service/lakeformation/types/types.go +++ b/service/lakeformation/types/types.go @@ -364,6 +364,24 @@ type FilterCondition struct { noSmithyDocumentSerde } +// A single principal-resource pair that has Lake Formation permissins enforced. +type LakeFormationOptInsInfo struct { + + // The last modified date and time of the record. + LastModified *time.Time + + // The user who updated the record. + LastUpdatedBy *string + + // The Lake Formation principal. Supported principals are IAM users or IAM roles. + Principal *DataLakePrincipal + + // A structure for the resource. + Resource *Resource + + noSmithyDocumentSerde +} + // A structure that allows an admin to grant user permissions on certain // conditions. For example, granting a role access to all columns that do not have // the LF-tag 'PII' in tables that have the LF-tag 'Prod'. @@ -374,7 +392,9 @@ type LFTag struct { // This member is required. TagKey *string - // A list of possible values an attribute can take. + // A list of possible values an attribute can take. The maximum number of values + // that can be defined for a LF-Tag is 1000. A single API call supports 50 values. + // You can use multiple API calls to add more values. // // This member is required. TagValues []string @@ -523,6 +543,12 @@ type PrincipalResourcePermissions struct { // ARN. AdditionalDetails *DetailsMap + // The date and time when the resource was last updated. + LastUpdated *time.Time + + // The user who updated the record. + LastUpdatedBy *string + // The permissions to be granted or revoked on the resource. Permissions []Permission @@ -610,6 +636,10 @@ type Resource struct { // A structure containing information about an Lake Formation resource. type ResourceInfo struct { + // Indicates whether the data access of tables pointing to the location can be + // managed by both Lake Formation permissions as well as Amazon S3 bucket policies. + HybridAccessEnabled *bool + // The date and time the resource was last modified. LastModified *time.Time diff --git a/service/lakeformation/validators.go b/service/lakeformation/validators.go index b9e4e9ee634..84a0c619496 100644 --- a/service/lakeformation/validators.go +++ b/service/lakeformation/validators.go @@ -150,6 +150,26 @@ func (m *validateOpCreateDataCellsFilter) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCreateLakeFormationOptIn struct { +} + +func (*validateOpCreateLakeFormationOptIn) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLakeFormationOptIn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLakeFormationOptInInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLakeFormationOptInInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateLFTag struct { } @@ -170,6 +190,26 @@ func (m *validateOpCreateLFTag) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpDeleteLakeFormationOptIn struct { +} + +func (*validateOpDeleteLakeFormationOptIn) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteLakeFormationOptIn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteLakeFormationOptInInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteLakeFormationOptInInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteLFTag struct { } @@ -530,6 +570,26 @@ func (m *validateOpListDataCellsFilter) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListLakeFormationOptIns struct { +} + +func (*validateOpListLakeFormationOptIns) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListLakeFormationOptIns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListLakeFormationOptInsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListLakeFormationOptInsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListPermissions struct { } @@ -838,10 +898,18 @@ func addOpCreateDataCellsFilterValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpCreateDataCellsFilter{}, middleware.After) } +func addOpCreateLakeFormationOptInValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLakeFormationOptIn{}, middleware.After) +} + func addOpCreateLFTagValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateLFTag{}, middleware.After) } +func addOpDeleteLakeFormationOptInValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteLakeFormationOptIn{}, middleware.After) +} + func addOpDeleteLFTagValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteLFTag{}, middleware.After) } @@ -914,6 +982,10 @@ func addOpListDataCellsFilterValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListDataCellsFilter{}, middleware.After) } +func addOpListLakeFormationOptInsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListLakeFormationOptIns{}, middleware.After) +} + func addOpListPermissionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListPermissions{}, middleware.After) } @@ -1514,6 +1586,28 @@ func validateOpCreateDataCellsFilterInput(v *CreateDataCellsFilterInput) error { } } +func validateOpCreateLakeFormationOptInInput(v *CreateLakeFormationOptInInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLakeFormationOptInInput"} + if v.Principal == nil { + invalidParams.Add(smithy.NewErrParamRequired("Principal")) + } + if v.Resource == nil { + invalidParams.Add(smithy.NewErrParamRequired("Resource")) + } else if v.Resource != nil { + if err := validateResource(v.Resource); err != nil { + invalidParams.AddNested("Resource", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateLFTagInput(v *CreateLFTagInput) error { if v == nil { return nil @@ -1532,6 +1626,28 @@ func validateOpCreateLFTagInput(v *CreateLFTagInput) error { } } +func validateOpDeleteLakeFormationOptInInput(v *DeleteLakeFormationOptInInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteLakeFormationOptInInput"} + if v.Principal == nil { + invalidParams.Add(smithy.NewErrParamRequired("Principal")) + } + if v.Resource == nil { + invalidParams.Add(smithy.NewErrParamRequired("Resource")) + } else if v.Resource != nil { + if err := validateResource(v.Resource); err != nil { + invalidParams.AddNested("Resource", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteLFTagInput(v *DeleteLFTagInput) error { if v == nil { return nil @@ -1853,6 +1969,23 @@ func validateOpListDataCellsFilterInput(v *ListDataCellsFilterInput) error { } } +func validateOpListLakeFormationOptInsInput(v *ListLakeFormationOptInsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListLakeFormationOptInsInput"} + if v.Resource != nil { + if err := validateResource(v.Resource); err != nil { + invalidParams.AddNested("Resource", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListPermissionsInput(v *ListPermissionsInput) error { if v == nil { return nil diff --git a/service/pinpoint/api_op_RemoveAttributes.go b/service/pinpoint/api_op_RemoveAttributes.go index 12ce1e6eb35..8ac20582f4d 100644 --- a/service/pinpoint/api_op_RemoveAttributes.go +++ b/service/pinpoint/api_op_RemoveAttributes.go @@ -16,8 +16,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes one or more attributes, of the same attribute type, from all the -// endpoints that are associated with an application. +// Removes one or more custom attributes, of the same attribute type, from the +// application. Existing endpoints still have the attributes but Amazon Pinpoint +// will stop capturing new or changed values for these attributes. func (c *Client) RemoveAttributes(ctx context.Context, params *RemoveAttributesInput, optFns ...func(*Options)) (*RemoveAttributesOutput, error) { if params == nil { params = &RemoveAttributesInput{} diff --git a/service/s3/types/enums.go b/service/s3/types/enums.go index 08756b48bfa..613da169d4c 100644 --- a/service/s3/types/enums.go +++ b/service/s3/types/enums.go @@ -1006,10 +1006,11 @@ type ReplicationStatus string // Enum values for ReplicationStatus const ( - ReplicationStatusComplete ReplicationStatus = "COMPLETE" - ReplicationStatusPending ReplicationStatus = "PENDING" - ReplicationStatusFailed ReplicationStatus = "FAILED" - ReplicationStatusReplica ReplicationStatus = "REPLICA" + ReplicationStatusComplete ReplicationStatus = "COMPLETE" + ReplicationStatusPending ReplicationStatus = "PENDING" + ReplicationStatusFailed ReplicationStatus = "FAILED" + ReplicationStatusReplica ReplicationStatus = "REPLICA" + ReplicationStatusCompleted ReplicationStatus = "COMPLETED" ) // Values returns all known values for ReplicationStatus. Note that this can be @@ -1021,6 +1022,7 @@ func (ReplicationStatus) Values() []ReplicationStatus { "PENDING", "FAILED", "REPLICA", + "COMPLETED", } }