diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..62fefdbbd8c --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/tnb" + ] +} \ No newline at end of file diff --git a/.changelog/887cd926cad3490d9844c5195ec1c527.json b/.changelog/887cd926cad3490d9844c5195ec1c527.json new file mode 100644 index 00000000000..9babe5141a6 --- /dev/null +++ b/.changelog/887cd926cad3490d9844c5195ec1c527.json @@ -0,0 +1,8 @@ +{ + "id": "887cd926-cad3-490d-9844-c5195ec1c527", + "type": "feature", + "description": "S3 data sources now accept a custom IAM role.", + "modules": [ + "service/quicksight" + ] +} \ No newline at end of file diff --git a/.changelog/945f945bb2484510b085e088dc59f592.json b/.changelog/945f945bb2484510b085e088dc59f592.json new file mode 100644 index 00000000000..d69f5d0bd4e --- /dev/null +++ b/.changelog/945f945bb2484510b085e088dc59f592.json @@ -0,0 +1,8 @@ +{ + "id": "945f945b-b248-4510-b085-e088dc59f592", + "type": "feature", + "description": "This is the initial SDK release for AWS Telco Network Builder (TNB). AWS Telco Network Builder is a network automation service that helps you deploy and manage telecom networks.", + "modules": [ + "service/tnb" + ] +} \ No newline at end of file diff --git a/.changelog/f64bf88a47e9418a9bee7af5fdaebab5.json b/.changelog/f64bf88a47e9418a9bee7af5fdaebab5.json new file mode 100644 index 00000000000..57eae45f0e7 --- /dev/null +++ b/.changelog/f64bf88a47e9418a9bee7af5fdaebab5.json @@ -0,0 +1,8 @@ +{ + "id": "f64bf88a-47e9-418a-9bee-7af5fdaebab5", + "type": "documentation", + "description": "Documentation updates for AWS Security Hub", + "modules": [ + "service/securityhub" + ] +} \ No newline at end of file diff --git a/.changelog/f9c01ead06424ab79f12bd4a7afc7017.json b/.changelog/f9c01ead06424ab79f12bd4a7afc7017.json new file mode 100644 index 00000000000..6894da08ab9 --- /dev/null +++ b/.changelog/f9c01ead06424ab79f12bd4a7afc7017.json @@ -0,0 +1,8 @@ +{ + "id": "f9c01ead-0642-4ab7-9f12-bd4a7afc7017", + "type": "feature", + "description": "In this release we improved resilience hub application creation and maintenance by introducing new resource and app component crud APIs, improving visibility and maintenance of application input sources and added support for additional information attributes to be provided by customers.", + "modules": [ + "service/resiliencehub" + ] +} \ No newline at end of file diff --git a/service/kinesisanalytics/internal/endpoints/endpoints.go b/service/kinesisanalytics/internal/endpoints/endpoints.go index de1beb4a10d..6e7113bb96f 100644 --- a/service/kinesisanalytics/internal/endpoints/endpoints.go +++ b/service/kinesisanalytics/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/kinesisanalyticsv2/internal/endpoints/endpoints.go b/service/kinesisanalyticsv2/internal/endpoints/endpoints.go index d9e3e8c8746..4ffb6adcdc5 100644 --- a/service/kinesisanalyticsv2/internal/endpoints/endpoints.go +++ b/service/kinesisanalyticsv2/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/quicksight/deserializers.go b/service/quicksight/deserializers.go index 368e67269d3..b4c7e1f19f3 100644 --- a/service/quicksight/deserializers.go +++ b/service/quicksight/deserializers.go @@ -54496,6 +54496,15 @@ func awsRestjson1_deserializeDocumentS3Parameters(v **types.S3Parameters, value return err } + case "RoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/quicksight/serializers.go b/service/quicksight/serializers.go index 08918a1db5f..f3a60e36f36 100644 --- a/service/quicksight/serializers.go +++ b/service/quicksight/serializers.go @@ -23531,6 +23531,11 @@ func awsRestjson1_serializeDocumentS3Parameters(v *types.S3Parameters, value smi } } + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + return nil } diff --git a/service/quicksight/types/types.go b/service/quicksight/types/types.go index ec835c1c07c..7a04a4c8225 100644 --- a/service/quicksight/types/types.go +++ b/service/quicksight/types/types.go @@ -9150,6 +9150,14 @@ type S3Parameters struct { // This member is required. ManifestFileLocation *ManifestFileLocation + // Use the RoleArn structure to override an account-wide role for a specific S3 + // data source. For example, say an account administrator has turned off all S3 + // access with an account-wide role. The administrator can then use RoleArn to + // bypass the account-wide role and allow S3 access for the single S3 data source + // that is specified in the structure, even if the account-wide role forbidding S3 + // access is still active. + RoleArn *string + noSmithyDocumentSerde } diff --git a/service/resiliencehub/api_op_AddDraftAppVersionResourceMappings.go b/service/resiliencehub/api_op_AddDraftAppVersionResourceMappings.go index 53162b0b8bf..a21e988ad62 100644 --- a/service/resiliencehub/api_op_AddDraftAppVersionResourceMappings.go +++ b/service/resiliencehub/api_op_AddDraftAppVersionResourceMappings.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds the resource mapping for the draft application version. +// Adds the resource mapping for the draft application version. You can also update +// an existing resource mapping to a new physical resource. func (c *Client) AddDraftAppVersionResourceMappings(ctx context.Context, params *AddDraftAppVersionResourceMappingsInput, optFns ...func(*Options)) (*AddDraftAppVersionResourceMappingsOutput, error) { if params == nil { params = &AddDraftAppVersionResourceMappingsInput{} @@ -29,11 +30,11 @@ func (c *Client) AddDraftAppVersionResourceMappings(ctx context.Context, params type AddDraftAppVersionResourceMappingsInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -52,11 +53,11 @@ type AddDraftAppVersionResourceMappingsInput struct { type AddDraftAppVersionResourceMappingsOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_CreateApp.go b/service/resiliencehub/api_op_CreateApp.go index 289149b62fb..3610771158d 100644 --- a/service/resiliencehub/api_op_CreateApp.go +++ b/service/resiliencehub/api_op_CreateApp.go @@ -12,12 +12,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a Resilience Hub application. A Resilience Hub application is a -// collection of Amazon Web Services resources structured to prevent and recover -// Amazon Web Services application disruptions. To describe a Resilience Hub +// Creates an AWS Resilience Hub application. An AWS Resilience Hub application is +// a collection of Amazon Web Services resources structured to prevent and recover +// Amazon Web Services application disruptions. To describe a AWS Resilience Hub // application, you provide an application name, resources from one or more–up to // five–CloudFormation stacks, and an appropriate resiliency policy. After you -// create a Resilience Hub application, you publish it so that you can run a +// create an AWS Resilience Hub application, you publish it so that you can run a // resiliency assessment on it. You can then use recommendations from the // assessment to improve resiliency by running another assessment, comparing // results, and then iterating the process until you achieve your goals for @@ -59,7 +59,7 @@ type CreateAppInput struct { // is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For // more information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. PolicyArn *string // The tags assigned to the resource. A tag is a label that you assign to an Amazon diff --git a/service/resiliencehub/api_op_CreateAppVersionAppComponent.go b/service/resiliencehub/api_op_CreateAppVersionAppComponent.go new file mode 100644 index 00000000000..b559218b121 --- /dev/null +++ b/service/resiliencehub/api_op_CreateAppVersionAppComponent.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new Application Component in the AWS Resilience Hub application. This +// API updates the AWS Resilience Hub application draft version. To use this +// Application Component for running assessments, you must publish the AWS +// Resilience Hub application using the PublishAppVersion API. +func (c *Client) CreateAppVersionAppComponent(ctx context.Context, params *CreateAppVersionAppComponentInput, optFns ...func(*Options)) (*CreateAppVersionAppComponentOutput, error) { + if params == nil { + params = &CreateAppVersionAppComponentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAppVersionAppComponent", params, optFns, c.addOperationCreateAppVersionAppComponentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAppVersionAppComponentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAppVersionAppComponentInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The name of the Application Component. + // + // This member is required. + Name *string + + // The type of Application Component. For more information about the types of + // Application Component, see Grouping resources in an AppComponent + // (https://docs.aws.amazon.com/resilience-hub/latest/userguide/AppComponent.grouping.html). + // + // This member is required. + Type *string + + // Currently, there is no supported additional information for Application + // Components. + AdditionalInfo map[string][]string + + // Used for an idempotency token. A client token is a unique, case-sensitive string + // of up to 64 ASCII characters. You should not reuse the same client token for + // other API requests. + ClientToken *string + + // The identifier of the Application Component. + Id *string + + noSmithyDocumentSerde +} + +type CreateAppVersionAppComponentOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines an Application Component. + AppComponent *types.AppComponent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAppVersionAppComponentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAppVersionAppComponent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAppVersionAppComponent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateAppVersionAppComponentMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAppVersionAppComponentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAppVersionAppComponent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateAppVersionAppComponent struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAppVersionAppComponent) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAppVersionAppComponent) 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.(*CreateAppVersionAppComponentInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAppVersionAppComponentInput ") + } + + 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_opCreateAppVersionAppComponentMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAppVersionAppComponent{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAppVersionAppComponent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "CreateAppVersionAppComponent", + } +} diff --git a/service/resiliencehub/api_op_CreateAppVersionResource.go b/service/resiliencehub/api_op_CreateAppVersionResource.go new file mode 100644 index 00000000000..7058e062f40 --- /dev/null +++ b/service/resiliencehub/api_op_CreateAppVersionResource.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds a resource to the AWS Resilience Hub applicationand assigns it to the +// specified Application Components. If you specify a new Application Component, +// AWS Resilience Hub will automatically create the Application Component. +// +// * This +// action has no effect outside AWS Resilience Hub. +// +// * This API updates the AWS +// Resilience Hub application draft version. To use this resource for running +// resiliency assessments, you must publish the AWS Resilience Hub application +// using the PublishAppVersion API. +// +// * To update application version with new +// physicalResourceID, you must call ResolveAppVersionResources API. +func (c *Client) CreateAppVersionResource(ctx context.Context, params *CreateAppVersionResourceInput, optFns ...func(*Options)) (*CreateAppVersionResourceOutput, error) { + if params == nil { + params = &CreateAppVersionResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAppVersionResource", params, optFns, c.addOperationCreateAppVersionResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAppVersionResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAppVersionResourceInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The list of Application Components that this resource belongs to. If an + // Application Component is not part of the AWS Resilience Hub application, it will + // be added. + // + // This member is required. + AppComponents []string + + // The logical identifier of the resource. + // + // This member is required. + LogicalResourceId *types.LogicalResourceId + + // The physical identifier of the resource. + // + // This member is required. + PhysicalResourceId *string + + // The name of the resource. + // + // This member is required. + ResourceName *string + + // The type of resource. + // + // This member is required. + ResourceType *string + + // Currently, there is no supported additional information for resources. + AdditionalInfo map[string][]string + + // The Amazon Web Services account that owns the physical resource. + AwsAccountId *string + + // The Amazon Web Services region that owns the physical resource. + AwsRegion *string + + // Used for an idempotency token. A client token is a unique, case-sensitive string + // of up to 64 ASCII characters. You should not reuse the same client token for + // other API requests. + ClientToken *string + + noSmithyDocumentSerde +} + +type CreateAppVersionResourceOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines a physical resource. A physical resource is a resource that exists in + // your account. It can be identified using an Amazon Resource Name (ARN) or a + // Resilience Hub-native identifier. + PhysicalResource *types.PhysicalResource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAppVersionResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAppVersionResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAppVersionResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateAppVersionResourceMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAppVersionResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAppVersionResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateAppVersionResource struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAppVersionResource) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAppVersionResource) 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.(*CreateAppVersionResourceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAppVersionResourceInput ") + } + + 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_opCreateAppVersionResourceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAppVersionResource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAppVersionResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "CreateAppVersionResource", + } +} diff --git a/service/resiliencehub/api_op_CreateRecommendationTemplate.go b/service/resiliencehub/api_op_CreateRecommendationTemplate.go index a98ac341081..6ebd997427e 100644 --- a/service/resiliencehub/api_op_CreateRecommendationTemplate.go +++ b/service/resiliencehub/api_op_CreateRecommendationTemplate.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new recommendation template. +// Creates a new recommendation template for the AWS Resilience Hub application. func (c *Client) CreateRecommendationTemplate(ctx context.Context, params *CreateRecommendationTemplateInput, optFns ...func(*Options)) (*CreateRecommendationTemplateOutput, error) { if params == nil { params = &CreateRecommendationTemplateInput{} @@ -34,7 +34,7 @@ type CreateRecommendationTemplateInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string diff --git a/service/resiliencehub/api_op_DeleteApp.go b/service/resiliencehub/api_op_DeleteApp.go index a50503e34e3..46908769112 100644 --- a/service/resiliencehub/api_op_DeleteApp.go +++ b/service/resiliencehub/api_op_DeleteApp.go @@ -30,11 +30,11 @@ func (c *Client) DeleteApp(ctx context.Context, params *DeleteAppInput, optFns . type DeleteAppInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -44,7 +44,7 @@ type DeleteAppInput struct { // other API requests. ClientToken *string - // A boolean option to force the deletion of a Resilience Hub application. + // A boolean option to force the deletion of an AWS Resilience Hub application. ForceDelete *bool noSmithyDocumentSerde @@ -52,11 +52,11 @@ type DeleteAppInput struct { type DeleteAppOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_DeleteAppAssessment.go b/service/resiliencehub/api_op_DeleteAppAssessment.go index 23c4879ddc3..c7357f93e83 100644 --- a/service/resiliencehub/api_op_DeleteAppAssessment.go +++ b/service/resiliencehub/api_op_DeleteAppAssessment.go @@ -35,7 +35,7 @@ type DeleteAppAssessmentInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -54,7 +54,7 @@ type DeleteAppAssessmentOutput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string diff --git a/service/resiliencehub/api_op_DeleteAppInputSource.go b/service/resiliencehub/api_op_DeleteAppInputSource.go new file mode 100644 index 00000000000..3788e0ccc85 --- /dev/null +++ b/service/resiliencehub/api_op_DeleteAppInputSource.go @@ -0,0 +1,187 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the input source and all of its imported resources from the AWS +// Resilience Hub application. +func (c *Client) DeleteAppInputSource(ctx context.Context, params *DeleteAppInputSourceInput, optFns ...func(*Options)) (*DeleteAppInputSourceOutput, error) { + if params == nil { + params = &DeleteAppInputSourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAppInputSource", params, optFns, c.addOperationDeleteAppInputSourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAppInputSourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAppInputSourceInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // Used for an idempotency token. A client token is a unique, case-sensitive string + // of up to 64 ASCII characters. You should not reuse the same client token for + // other API requests. + ClientToken *string + + // The Amazon Resource Name (ARN) of the imported resource you want to remove from + // the AWS Resilience Hub application. For more information about ARNs, see Amazon + // Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + SourceArn *string + + // The imported Terraform s3 state file you want to remove from the AWS Resilience + // Hub application. + TerraformSource *types.TerraformSource + + noSmithyDocumentSerde +} + +type DeleteAppInputSourceOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + AppArn *string + + // The name of the input source from where the application resource is imported + // from. + AppInputSource *types.AppInputSource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAppInputSourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAppInputSource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAppInputSource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteAppInputSourceMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteAppInputSourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAppInputSource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpDeleteAppInputSource struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteAppInputSource) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteAppInputSource) 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.(*DeleteAppInputSourceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAppInputSourceInput ") + } + + 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_opDeleteAppInputSourceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteAppInputSource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteAppInputSource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "DeleteAppInputSource", + } +} diff --git a/service/resiliencehub/api_op_DeleteAppVersionAppComponent.go b/service/resiliencehub/api_op_DeleteAppVersionAppComponent.go new file mode 100644 index 00000000000..43b3cbfd77f --- /dev/null +++ b/service/resiliencehub/api_op_DeleteAppVersionAppComponent.go @@ -0,0 +1,194 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Application Component from the AWS Resilience Hub application. +// +// * +// This API updates the AWS Resilience Hub application draft version. To use this +// Application Component for running assessments, you must publish the AWS +// Resilience Hub application using the PublishAppVersion API. +// +// * You will not be +// able to delete an Application Component if it has resources associated with it. +func (c *Client) DeleteAppVersionAppComponent(ctx context.Context, params *DeleteAppVersionAppComponentInput, optFns ...func(*Options)) (*DeleteAppVersionAppComponentOutput, error) { + if params == nil { + params = &DeleteAppVersionAppComponentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAppVersionAppComponent", params, optFns, c.addOperationDeleteAppVersionAppComponentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAppVersionAppComponentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAppVersionAppComponentInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The identifier of the Application Component. + // + // This member is required. + Id *string + + // Used for an idempotency token. A client token is a unique, case-sensitive string + // of up to 64 ASCII characters. You should not reuse the same client token for + // other API requests. + ClientToken *string + + noSmithyDocumentSerde +} + +type DeleteAppVersionAppComponentOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines an Application Component. + AppComponent *types.AppComponent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAppVersionAppComponentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAppVersionAppComponent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAppVersionAppComponent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteAppVersionAppComponentMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteAppVersionAppComponentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAppVersionAppComponent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpDeleteAppVersionAppComponent struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteAppVersionAppComponent) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteAppVersionAppComponent) 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.(*DeleteAppVersionAppComponentInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAppVersionAppComponentInput ") + } + + 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_opDeleteAppVersionAppComponentMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteAppVersionAppComponent{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteAppVersionAppComponent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "DeleteAppVersionAppComponent", + } +} diff --git a/service/resiliencehub/api_op_DeleteAppVersionResource.go b/service/resiliencehub/api_op_DeleteAppVersionResource.go new file mode 100644 index 00000000000..10f12dfdb9b --- /dev/null +++ b/service/resiliencehub/api_op_DeleteAppVersionResource.go @@ -0,0 +1,209 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a resource from the AWS Resilience Hub application. +// +// * You can only +// delete a manually added resource. To exclude non-manually added resources, use +// the UpdateAppVersionResource API. +// +// * This action has no effect outside AWS +// Resilience Hub. +// +// * This API updates the AWS Resilience Hub application draft +// version. To use this resource for running resiliency assessments, you must +// publish the AWS Resilience Hub application using the PublishAppVersion API. +func (c *Client) DeleteAppVersionResource(ctx context.Context, params *DeleteAppVersionResourceInput, optFns ...func(*Options)) (*DeleteAppVersionResourceOutput, error) { + if params == nil { + params = &DeleteAppVersionResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAppVersionResource", params, optFns, c.addOperationDeleteAppVersionResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAppVersionResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAppVersionResourceInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The Amazon Web Services account that owns the physical resource. + AwsAccountId *string + + // The Amazon Web Services region that owns the physical resource. + AwsRegion *string + + // Used for an idempotency token. A client token is a unique, case-sensitive string + // of up to 64 ASCII characters. You should not reuse the same client token for + // other API requests. + ClientToken *string + + // The logical identifier of the resource. + LogicalResourceId *types.LogicalResourceId + + // The physical identifier of the resource. + PhysicalResourceId *string + + // The name of the resource. + ResourceName *string + + noSmithyDocumentSerde +} + +type DeleteAppVersionResourceOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines a physical resource. A physical resource is a resource that exists in + // your account. It can be identified using an Amazon Resource Name (ARN) or a + // Resilience Hub-native identifier. + PhysicalResource *types.PhysicalResource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAppVersionResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAppVersionResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAppVersionResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteAppVersionResourceMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteAppVersionResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAppVersionResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpDeleteAppVersionResource struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteAppVersionResource) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteAppVersionResource) 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.(*DeleteAppVersionResourceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAppVersionResourceInput ") + } + + 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_opDeleteAppVersionResourceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteAppVersionResource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteAppVersionResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "DeleteAppVersionResource", + } +} diff --git a/service/resiliencehub/api_op_DeleteResiliencyPolicy.go b/service/resiliencehub/api_op_DeleteResiliencyPolicy.go index bfebd1c4cea..33f323dda3e 100644 --- a/service/resiliencehub/api_op_DeleteResiliencyPolicy.go +++ b/service/resiliencehub/api_op_DeleteResiliencyPolicy.go @@ -33,7 +33,7 @@ type DeleteResiliencyPolicyInput struct { // is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For // more information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. PolicyArn *string @@ -52,7 +52,7 @@ type DeleteResiliencyPolicyOutput struct { // is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For // more information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. PolicyArn *string diff --git a/service/resiliencehub/api_op_DescribeApp.go b/service/resiliencehub/api_op_DescribeApp.go index 5f23e309edd..430c7fc14b4 100644 --- a/service/resiliencehub/api_op_DescribeApp.go +++ b/service/resiliencehub/api_op_DescribeApp.go @@ -29,11 +29,11 @@ func (c *Client) DescribeApp(ctx context.Context, params *DescribeAppInput, optF type DescribeAppInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_DescribeAppAssessment.go b/service/resiliencehub/api_op_DescribeAppAssessment.go index 99ef5308377..4c1030d48d7 100644 --- a/service/resiliencehub/api_op_DescribeAppAssessment.go +++ b/service/resiliencehub/api_op_DescribeAppAssessment.go @@ -33,7 +33,7 @@ type DescribeAppAssessmentInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string diff --git a/service/resiliencehub/api_op_DescribeAppVersion.go b/service/resiliencehub/api_op_DescribeAppVersion.go new file mode 100644 index 00000000000..4cbc08a3290 --- /dev/null +++ b/service/resiliencehub/api_op_DescribeAppVersion.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the AWS Resilience Hub application version. +func (c *Client) DescribeAppVersion(ctx context.Context, params *DescribeAppVersionInput, optFns ...func(*Options)) (*DescribeAppVersionOutput, error) { + if params == nil { + params = &DescribeAppVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAppVersion", params, optFns, c.addOperationDescribeAppVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeAppVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeAppVersionInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + noSmithyDocumentSerde +} + +type DescribeAppVersionOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Additional configuration parameters for an AWS Resilience Hub application. + // Currently, this parameter supports only failover region and account. + AdditionalInfo map[string][]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeAppVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppVersion{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeAppVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeAppVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "DescribeAppVersion", + } +} diff --git a/service/resiliencehub/api_op_DescribeAppVersionAppComponent.go b/service/resiliencehub/api_op_DescribeAppVersionAppComponent.go new file mode 100644 index 00000000000..23e26cb68b6 --- /dev/null +++ b/service/resiliencehub/api_op_DescribeAppVersionAppComponent.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes an Application Component in the AWS Resilience Hub application. +func (c *Client) DescribeAppVersionAppComponent(ctx context.Context, params *DescribeAppVersionAppComponentInput, optFns ...func(*Options)) (*DescribeAppVersionAppComponentOutput, error) { + if params == nil { + params = &DescribeAppVersionAppComponentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAppVersionAppComponent", params, optFns, c.addOperationDescribeAppVersionAppComponentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeAppVersionAppComponentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeAppVersionAppComponentInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // The identifier of the Application Component. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DescribeAppVersionAppComponentOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines an Application Component. + AppComponent *types.AppComponent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeAppVersionAppComponentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppVersionAppComponent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppVersionAppComponent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeAppVersionAppComponentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppVersionAppComponent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeAppVersionAppComponent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "DescribeAppVersionAppComponent", + } +} diff --git a/service/resiliencehub/api_op_DescribeAppVersionResource.go b/service/resiliencehub/api_op_DescribeAppVersionResource.go new file mode 100644 index 00000000000..2ab30f1c1bc --- /dev/null +++ b/service/resiliencehub/api_op_DescribeAppVersionResource.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes a resource of the AWS Resilience Hub application. This API accepts +// only one of the following parameters to descibe the resource: +// +// * resourceName +// +// * +// logicalResourceId +// +// * physicalResourceId (Along with physicalResourceId, you can +// also provide awsAccountId, and awsRegion) +func (c *Client) DescribeAppVersionResource(ctx context.Context, params *DescribeAppVersionResourceInput, optFns ...func(*Options)) (*DescribeAppVersionResourceOutput, error) { + if params == nil { + params = &DescribeAppVersionResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAppVersionResource", params, optFns, c.addOperationDescribeAppVersionResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeAppVersionResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeAppVersionResourceInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // The Amazon Web Services account that owns the physical resource. + AwsAccountId *string + + // The Amazon Web Services region that owns the physical resource. + AwsRegion *string + + // The logical identifier of the resource. + LogicalResourceId *types.LogicalResourceId + + // The physical identifier of the resource. + PhysicalResourceId *string + + // The name of the resource. + ResourceName *string + + noSmithyDocumentSerde +} + +type DescribeAppVersionResourceOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines a physical resource. A physical resource is a resource that exists in + // your account. It can be identified using an Amazon Resource Name (ARN) or a + // Resilience Hub-native identifier. + PhysicalResource *types.PhysicalResource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeAppVersionResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppVersionResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppVersionResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeAppVersionResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppVersionResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeAppVersionResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "DescribeAppVersionResource", + } +} diff --git a/service/resiliencehub/api_op_DescribeAppVersionResourcesResolutionStatus.go b/service/resiliencehub/api_op_DescribeAppVersionResourcesResolutionStatus.go index f4d34dd7e89..ed3e5dc7ed0 100644 --- a/service/resiliencehub/api_op_DescribeAppVersionResourcesResolutionStatus.go +++ b/service/resiliencehub/api_op_DescribeAppVersionResourcesResolutionStatus.go @@ -31,11 +31,11 @@ func (c *Client) DescribeAppVersionResourcesResolutionStatus(ctx context.Context type DescribeAppVersionResourcesResolutionStatusInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -53,11 +53,11 @@ type DescribeAppVersionResourcesResolutionStatusInput struct { type DescribeAppVersionResourcesResolutionStatusOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_DescribeAppVersionTemplate.go b/service/resiliencehub/api_op_DescribeAppVersionTemplate.go index 75368988002..e70edd20524 100644 --- a/service/resiliencehub/api_op_DescribeAppVersionTemplate.go +++ b/service/resiliencehub/api_op_DescribeAppVersionTemplate.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes details about an AWS Resilience Hub +// Describes details about an AWS Resilience Hub application. func (c *Client) DescribeAppVersionTemplate(ctx context.Context, params *DescribeAppVersionTemplateInput, optFns ...func(*Options)) (*DescribeAppVersionTemplateOutput, error) { if params == nil { params = &DescribeAppVersionTemplateInput{} @@ -28,11 +28,11 @@ func (c *Client) DescribeAppVersionTemplate(ctx context.Context, params *Describ type DescribeAppVersionTemplateInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -47,16 +47,99 @@ type DescribeAppVersionTemplateInput struct { type DescribeAppVersionTemplateOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string - // The body of the template. + // A JSON string that provides information about your application structure. To + // learn more about the appTemplateBody template, see the sample template provided + // in the Examples section. The appTemplateBody JSON string has the following + // structure: + // + // * resources The list of logical resources that needs to be included + // in the application. Type: Array Don't add the resources that you want to + // exclude. Each resources array item includes the following fields: + // + // * + // logicalResourceId The logical identifier of the resource. Type: Object Each + // logicalResourceId object includes the following fields: + // + // * identifier The + // identifier of the resource. Type: String + // + // * logicalStackName The name of the + // CloudFormation stack this resource belongs to. Type: String + // + // * resourceGroupName + // The name of the resource group this resource belongs to. Type: String + // + // * + // terraformSourceName The name of the Terraform S3 state file this resource + // belongs to. Type: String + // + // * type The type of resource. Type: string + // + // * name The + // name of the resource. Type: String + // + // * appComponents The list of Application + // Components that this resource belongs to. If an Application Component is not + // part of the AWS Resilience Hub application, it will be added. Type: Array Each + // appComponents array item includes the following fields: + // + // * name The name of the + // Application Component. Type: String + // + // * type The type of Application Component. + // For more information about the types of Application Component, see Grouping + // resources in an AppComponent + // (https://docs.aws.amazon.com/resilience-hub/latest/userguide/AppComponent.grouping.html). + // Type: String + // + // * resourceNames The list of included resources that are assigned + // to the Application Component. Type: Array of strings + // + // * additionalInfo + // Additional configuration parameters for an AWS Resilience Hub application. + // Currently, this parameter accepts a key-value mapping (in a string format) of + // only one failover region and one associated account. Key: "failover-regions" + // Value: "[{"region":"", "accounts":[{"id":""}]}]" + // + // * + // excludedResources The list of logical resource identifiers to be excluded from + // the application. Type: Array Don't add the resources that you want to include. + // Each excludedResources array item includes the following fields: + // + // * + // logicalResourceIds The logical identifier of the resource. Type: Object You can + // configure only one of the following fields: + // + // * logicalStackName + // + // * + // resourceGroupName + // + // * terraformSourceName + // + // Each logicalResourceIds object + // includes the following fields: + // + // * identifier The identifier of the resource. + // Type: String + // + // * logicalStackName The name of the CloudFormation stack this + // resource belongs to. Type: String + // + // * resourceGroupName The name of the resource + // group this resource belongs to. Type: String + // + // * terraformSourceName The name of + // the Terraform S3 state file this resource belongs to. Type: String // // This member is required. AppTemplateBody *string diff --git a/service/resiliencehub/api_op_DescribeDraftAppVersionResourcesImportStatus.go b/service/resiliencehub/api_op_DescribeDraftAppVersionResourcesImportStatus.go index 20d39c7e602..950cefef2bc 100644 --- a/service/resiliencehub/api_op_DescribeDraftAppVersionResourcesImportStatus.go +++ b/service/resiliencehub/api_op_DescribeDraftAppVersionResourcesImportStatus.go @@ -12,7 +12,10 @@ import ( "time" ) -// Describes the status of importing resources to an application version. +// Describes the status of importing resources to an application version. If you +// get a 404 error with ResourceImportStatusNotFoundAppMetadataException, you must +// call importResourcesToDraftAppVersion after creating the application and before +// calling describeDraftAppVersionResourcesImportStatus to obtain the status. func (c *Client) DescribeDraftAppVersionResourcesImportStatus(ctx context.Context, params *DescribeDraftAppVersionResourcesImportStatusInput, optFns ...func(*Options)) (*DescribeDraftAppVersionResourcesImportStatusOutput, error) { if params == nil { params = &DescribeDraftAppVersionResourcesImportStatusInput{} @@ -30,11 +33,11 @@ func (c *Client) DescribeDraftAppVersionResourcesImportStatus(ctx context.Contex type DescribeDraftAppVersionResourcesImportStatusInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -44,11 +47,11 @@ type DescribeDraftAppVersionResourcesImportStatusInput struct { type DescribeDraftAppVersionResourcesImportStatusOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_DescribeResiliencyPolicy.go b/service/resiliencehub/api_op_DescribeResiliencyPolicy.go index cebf8ca694a..780326546d8 100644 --- a/service/resiliencehub/api_op_DescribeResiliencyPolicy.go +++ b/service/resiliencehub/api_op_DescribeResiliencyPolicy.go @@ -35,7 +35,7 @@ type DescribeResiliencyPolicyInput struct { // is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For // more information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. PolicyArn *string diff --git a/service/resiliencehub/api_op_ImportResourcesToDraftAppVersion.go b/service/resiliencehub/api_op_ImportResourcesToDraftAppVersion.go index 8c36b895abe..936a78196ac 100644 --- a/service/resiliencehub/api_op_ImportResourcesToDraftAppVersion.go +++ b/service/resiliencehub/api_op_ImportResourcesToDraftAppVersion.go @@ -11,8 +11,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Imports resources from sources such as a CloudFormation stack, resource-groups, -// or application registry app to a draft application version. +// Imports resources to AWS Resilience Hub application draft version from different +// input sources. For more information about the input sources supported by AWS +// Resilience Hub, see Discover the structure and describe your Resilience Hub +// application +// (https://docs.aws.amazon.com/resilience-hub/latest/userguide/discover-structure.html). func (c *Client) ImportResourcesToDraftAppVersion(ctx context.Context, params *ImportResourcesToDraftAppVersionInput, optFns ...func(*Options)) (*ImportResourcesToDraftAppVersionOutput, error) { if params == nil { params = &ImportResourcesToDraftAppVersionInput{} @@ -30,15 +33,19 @@ func (c *Client) ImportResourcesToDraftAppVersion(ctx context.Context, params *I type ImportResourcesToDraftAppVersionInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string + // The import strategy you would like to set to import resources into AWS + // Resilience Hub application. + ImportStrategy types.ResourceImportStrategyType + // The Amazon Resource Names (ARNs) for the resources that you want to import. SourceArns []string @@ -50,11 +57,11 @@ type ImportResourcesToDraftAppVersionInput struct { type ImportResourcesToDraftAppVersionOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_ListAlarmRecommendations.go b/service/resiliencehub/api_op_ListAlarmRecommendations.go index c06d675b4af..49f9cc86160 100644 --- a/service/resiliencehub/api_op_ListAlarmRecommendations.go +++ b/service/resiliencehub/api_op_ListAlarmRecommendations.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the alarm recommendations for a AWS Resilience Hub application. +// Lists the alarm recommendations for an AWS Resilience Hub application. func (c *Client) ListAlarmRecommendations(ctx context.Context, params *ListAlarmRecommendationsInput, optFns ...func(*Options)) (*ListAlarmRecommendationsOutput, error) { if params == nil { params = &ListAlarmRecommendationsInput{} @@ -34,7 +34,7 @@ type ListAlarmRecommendationsInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -53,7 +53,7 @@ type ListAlarmRecommendationsInput struct { type ListAlarmRecommendationsOutput struct { // The alarm recommendations for an AWS Resilience Hub application, returned as an - // object. This object includes application component names, descriptions, + // object. This object includes Application Component names, descriptions, // information about whether a recommendation has already been implemented or not, // prerequisites, and more. // diff --git a/service/resiliencehub/api_op_ListAppAssessments.go b/service/resiliencehub/api_op_ListAppAssessments.go index e35df9753b9..9204c60eb23 100644 --- a/service/resiliencehub/api_op_ListAppAssessments.go +++ b/service/resiliencehub/api_op_ListAppAssessments.go @@ -31,11 +31,11 @@ func (c *Client) ListAppAssessments(ctx context.Context, params *ListAppAssessme type ListAppAssessmentsInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. AppArn *string // The name for the assessment. diff --git a/service/resiliencehub/api_op_ListAppComponentCompliances.go b/service/resiliencehub/api_op_ListAppComponentCompliances.go index 913d021fb3b..31077306391 100644 --- a/service/resiliencehub/api_op_ListAppComponentCompliances.go +++ b/service/resiliencehub/api_op_ListAppComponentCompliances.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the compliances for an AWS Resilience Hub component. +// Lists the compliances for an AWS Resilience Hub Application Component. func (c *Client) ListAppComponentCompliances(ctx context.Context, params *ListAppComponentCompliancesInput, optFns ...func(*Options)) (*ListAppComponentCompliancesOutput, error) { if params == nil { params = &ListAppComponentCompliancesInput{} @@ -34,7 +34,7 @@ type ListAppComponentCompliancesInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -52,9 +52,9 @@ type ListAppComponentCompliancesInput struct { type ListAppComponentCompliancesOutput struct { - // The compliances for an AWS Resilience Hub application component, returned as an - // object. This object contains component names, compliances, costs, resiliency - // scores, outage scores, and more. + // The compliances for an AWS Resilience Hub Application Component, returned as an + // object. This object contains the names of the Application Components, + // compliances, costs, resiliency scores, outage scores, and more. // // This member is required. ComponentCompliances []types.AppComponentCompliance diff --git a/service/resiliencehub/api_op_ListAppComponentRecommendations.go b/service/resiliencehub/api_op_ListAppComponentRecommendations.go index 3e3f3030daa..1736fc5f1cf 100644 --- a/service/resiliencehub/api_op_ListAppComponentRecommendations.go +++ b/service/resiliencehub/api_op_ListAppComponentRecommendations.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the recommendations for an AWS Resilience Hub component. +// Lists the recommendations for an AWS Resilience Hub Application Component. func (c *Client) ListAppComponentRecommendations(ctx context.Context, params *ListAppComponentRecommendationsInput, optFns ...func(*Options)) (*ListAppComponentRecommendationsOutput, error) { if params == nil { params = &ListAppComponentRecommendationsInput{} @@ -34,7 +34,7 @@ type ListAppComponentRecommendationsInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -52,9 +52,9 @@ type ListAppComponentRecommendationsInput struct { type ListAppComponentRecommendationsOutput struct { - // The recommendations for an Resilience Hub application component, returned as an - // object. This object contains component names, configuration recommendations, and - // recommendation statuses. + // The recommendations for an AWS Resilience Hub Application Component, returned as + // an object. This object contains the names of the Application Components, + // configuration recommendations, and recommendation statuses. // // This member is required. ComponentRecommendations []types.ComponentRecommendation diff --git a/service/resiliencehub/api_op_ListAppInputSources.go b/service/resiliencehub/api_op_ListAppInputSources.go new file mode 100644 index 00000000000..83b5b0bb00a --- /dev/null +++ b/service/resiliencehub/api_op_ListAppInputSources.go @@ -0,0 +1,238 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the input sources of the AWS Resilience Hub application. For more +// information about the input sources supported by AWS Resilience Hub, see +// Discover the structure and describe your Resilience Hub application +// (https://docs.aws.amazon.com/resilience-hub/latest/userguide/discover-structure.html). +func (c *Client) ListAppInputSources(ctx context.Context, params *ListAppInputSourcesInput, optFns ...func(*Options)) (*ListAppInputSourcesOutput, error) { + if params == nil { + params = &ListAppInputSourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAppInputSources", params, optFns, c.addOperationListAppInputSourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAppInputSourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAppInputSourcesInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Maximum number of input sources to be displayed per AWS Resilience Hub + // application. + MaxResults *int32 + + // Null, or the token from a previous call to get the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAppInputSourcesOutput struct { + + // The list of AWS Resilience Hub application input sources. + // + // This member is required. + AppInputSources []types.AppInputSource + + // The token for the next set of results, or null if there are no more results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAppInputSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppInputSources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppInputSources{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListAppInputSourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppInputSources(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListAppInputSourcesAPIClient is a client that implements the ListAppInputSources +// operation. +type ListAppInputSourcesAPIClient interface { + ListAppInputSources(context.Context, *ListAppInputSourcesInput, ...func(*Options)) (*ListAppInputSourcesOutput, error) +} + +var _ ListAppInputSourcesAPIClient = (*Client)(nil) + +// ListAppInputSourcesPaginatorOptions is the paginator options for +// ListAppInputSources +type ListAppInputSourcesPaginatorOptions struct { + // Maximum number of input sources to be displayed per AWS Resilience Hub + // application. + 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 +} + +// ListAppInputSourcesPaginator is a paginator for ListAppInputSources +type ListAppInputSourcesPaginator struct { + options ListAppInputSourcesPaginatorOptions + client ListAppInputSourcesAPIClient + params *ListAppInputSourcesInput + nextToken *string + firstPage bool +} + +// NewListAppInputSourcesPaginator returns a new ListAppInputSourcesPaginator +func NewListAppInputSourcesPaginator(client ListAppInputSourcesAPIClient, params *ListAppInputSourcesInput, optFns ...func(*ListAppInputSourcesPaginatorOptions)) *ListAppInputSourcesPaginator { + if params == nil { + params = &ListAppInputSourcesInput{} + } + + options := ListAppInputSourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAppInputSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAppInputSourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAppInputSources page. +func (p *ListAppInputSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppInputSourcesOutput, 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.ListAppInputSources(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_opListAppInputSources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "ListAppInputSources", + } +} diff --git a/service/resiliencehub/api_op_ListAppVersionAppComponents.go b/service/resiliencehub/api_op_ListAppVersionAppComponents.go new file mode 100644 index 00000000000..feb169dc0e9 --- /dev/null +++ b/service/resiliencehub/api_op_ListAppVersionAppComponents.go @@ -0,0 +1,249 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the Application Components in the AWS Resilience Hub application. +func (c *Client) ListAppVersionAppComponents(ctx context.Context, params *ListAppVersionAppComponentsInput, optFns ...func(*Options)) (*ListAppVersionAppComponentsOutput, error) { + if params == nil { + params = &ListAppVersionAppComponentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAppVersionAppComponents", params, optFns, c.addOperationListAppVersionAppComponentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAppVersionAppComponentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAppVersionAppComponentsInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The version of the Application Component. + // + // This member is required. + AppVersion *string + + // Maximum number of Application Components to be displayed per AWS Resilience Hub + // application version. + MaxResults *int32 + + // Null, or the token from a previous call to get the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAppVersionAppComponentsOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines an Application Component. + AppComponents []types.AppComponent + + // The token for the next set of results, or null if there are no more results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAppVersionAppComponentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppVersionAppComponents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppVersionAppComponents{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListAppVersionAppComponentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppVersionAppComponents(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListAppVersionAppComponentsAPIClient is a client that implements the +// ListAppVersionAppComponents operation. +type ListAppVersionAppComponentsAPIClient interface { + ListAppVersionAppComponents(context.Context, *ListAppVersionAppComponentsInput, ...func(*Options)) (*ListAppVersionAppComponentsOutput, error) +} + +var _ ListAppVersionAppComponentsAPIClient = (*Client)(nil) + +// ListAppVersionAppComponentsPaginatorOptions is the paginator options for +// ListAppVersionAppComponents +type ListAppVersionAppComponentsPaginatorOptions struct { + // Maximum number of Application Components to be displayed per AWS Resilience Hub + // application version. + 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 +} + +// ListAppVersionAppComponentsPaginator is a paginator for +// ListAppVersionAppComponents +type ListAppVersionAppComponentsPaginator struct { + options ListAppVersionAppComponentsPaginatorOptions + client ListAppVersionAppComponentsAPIClient + params *ListAppVersionAppComponentsInput + nextToken *string + firstPage bool +} + +// NewListAppVersionAppComponentsPaginator returns a new +// ListAppVersionAppComponentsPaginator +func NewListAppVersionAppComponentsPaginator(client ListAppVersionAppComponentsAPIClient, params *ListAppVersionAppComponentsInput, optFns ...func(*ListAppVersionAppComponentsPaginatorOptions)) *ListAppVersionAppComponentsPaginator { + if params == nil { + params = &ListAppVersionAppComponentsInput{} + } + + options := ListAppVersionAppComponentsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAppVersionAppComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAppVersionAppComponentsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAppVersionAppComponents page. +func (p *ListAppVersionAppComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppVersionAppComponentsOutput, 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.ListAppVersionAppComponents(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_opListAppVersionAppComponents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "ListAppVersionAppComponents", + } +} diff --git a/service/resiliencehub/api_op_ListAppVersionResourceMappings.go b/service/resiliencehub/api_op_ListAppVersionResourceMappings.go index 489d662f0b2..dce6910acbd 100644 --- a/service/resiliencehub/api_op_ListAppVersionResourceMappings.go +++ b/service/resiliencehub/api_op_ListAppVersionResourceMappings.go @@ -32,11 +32,11 @@ func (c *Client) ListAppVersionResourceMappings(ctx context.Context, params *Lis type ListAppVersionResourceMappingsInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_ListAppVersionResources.go b/service/resiliencehub/api_op_ListAppVersionResources.go index 8a7099ce2af..bfe19e93520 100644 --- a/service/resiliencehub/api_op_ListAppVersionResources.go +++ b/service/resiliencehub/api_op_ListAppVersionResources.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all the resources in an application version. +// Lists all the resources in an AWS Resilience Hub application. func (c *Client) ListAppVersionResources(ctx context.Context, params *ListAppVersionResourcesInput, optFns ...func(*Options)) (*ListAppVersionResourcesOutput, error) { if params == nil { params = &ListAppVersionResourcesInput{} @@ -30,11 +30,11 @@ func (c *Client) ListAppVersionResources(ctx context.Context, params *ListAppVer type ListAppVersionResourcesInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -65,7 +65,7 @@ type ListAppVersionResourcesOutput struct { // This member is required. PhysicalResources []types.PhysicalResource - // The identifier for a specific resolution. + // The ID for a specific resolution. // // This member is required. ResolutionId *string diff --git a/service/resiliencehub/api_op_ListAppVersions.go b/service/resiliencehub/api_op_ListAppVersions.go index b7e1f808872..d4026c1d2be 100644 --- a/service/resiliencehub/api_op_ListAppVersions.go +++ b/service/resiliencehub/api_op_ListAppVersions.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the different versions for the Resilience Hub applications. +// Lists the different versions for the AWS Resilience Hub applications. func (c *Client) ListAppVersions(ctx context.Context, params *ListAppVersionsInput, optFns ...func(*Options)) (*ListAppVersionsOutput, error) { if params == nil { params = &ListAppVersionsInput{} @@ -30,11 +30,11 @@ func (c *Client) ListAppVersions(ctx context.Context, params *ListAppVersionsInp type ListAppVersionsInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_ListApps.go b/service/resiliencehub/api_op_ListApps.go index c8d453aa167..7cd022a342a 100644 --- a/service/resiliencehub/api_op_ListApps.go +++ b/service/resiliencehub/api_op_ListApps.go @@ -12,7 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists your Resilience Hub applications. +// Lists your AWS Resilience Hub applications. You can filter applications using +// only one filter at a time or without using any filter. If you try to filter +// applications using multiple filters, you will get the following error: An error +// occurred (ValidationException) when calling the ListApps operation: Only one +// filter is supported for this operation. func (c *Client) ListApps(ctx context.Context, params *ListAppsInput, optFns ...func(*Options)) (*ListAppsOutput, error) { if params == nil { params = &ListAppsInput{} @@ -30,11 +34,11 @@ func (c *Client) ListApps(ctx context.Context, params *ListAppsInput, optFns ... type ListAppsInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. AppArn *string // The maximum number of results to include in the response. If more results exist @@ -53,7 +57,7 @@ type ListAppsInput struct { type ListAppsOutput struct { - // Summaries for the Resilience Hub application. + // Summaries for the AWS Resilience Hub application. // // This member is required. AppSummaries []types.AppSummary diff --git a/service/resiliencehub/api_op_ListRecommendationTemplates.go b/service/resiliencehub/api_op_ListRecommendationTemplates.go index 93676bbb9f1..c170cf0f95f 100644 --- a/service/resiliencehub/api_op_ListRecommendationTemplates.go +++ b/service/resiliencehub/api_op_ListRecommendationTemplates.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the recommendation templates for the Resilience Hub applications. +// Lists the recommendation templates for the AWS Resilience Hub applications. func (c *Client) ListRecommendationTemplates(ctx context.Context, params *ListRecommendationTemplatesInput, optFns ...func(*Options)) (*ListRecommendationTemplatesOutput, error) { if params == nil { params = &ListRecommendationTemplatesInput{} @@ -34,7 +34,7 @@ type ListRecommendationTemplatesInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -68,7 +68,7 @@ type ListRecommendationTemplatesOutput struct { // The token for the next set of results, or null if there are no more results. NextToken *string - // The recommendation templates for the Resilience Hub applications. + // The recommendation templates for the AWS Resilience Hub applications. RecommendationTemplates []types.RecommendationTemplate // Metadata pertaining to the operation's result. diff --git a/service/resiliencehub/api_op_ListResiliencyPolicies.go b/service/resiliencehub/api_op_ListResiliencyPolicies.go index a55be8d7c07..b6fceaf06e2 100644 --- a/service/resiliencehub/api_op_ListResiliencyPolicies.go +++ b/service/resiliencehub/api_op_ListResiliencyPolicies.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the resiliency policies for the Resilience Hub applications. +// Lists the resiliency policies for the AWS Resilience Hub applications. func (c *Client) ListResiliencyPolicies(ctx context.Context, params *ListResiliencyPoliciesInput, optFns ...func(*Options)) (*ListResiliencyPoliciesOutput, error) { if params == nil { params = &ListResiliencyPoliciesInput{} @@ -46,7 +46,7 @@ type ListResiliencyPoliciesInput struct { type ListResiliencyPoliciesOutput struct { - // The resiliency policies for the Resilience Hub applications. + // The resiliency policies for the AWS Resilience Hub applications. // // This member is required. ResiliencyPolicies []types.ResiliencyPolicy diff --git a/service/resiliencehub/api_op_ListSopRecommendations.go b/service/resiliencehub/api_op_ListSopRecommendations.go index 8fadb93c64b..6c191a71625 100644 --- a/service/resiliencehub/api_op_ListSopRecommendations.go +++ b/service/resiliencehub/api_op_ListSopRecommendations.go @@ -12,8 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the standard operating procedure (SOP) recommendations for the Resilience -// Hub applications. +// Lists the standard operating procedure (SOP) recommendations for the AWS +// Resilience Hub applications. func (c *Client) ListSopRecommendations(ctx context.Context, params *ListSopRecommendationsInput, optFns ...func(*Options)) (*ListSopRecommendationsOutput, error) { if params == nil { params = &ListSopRecommendationsInput{} @@ -35,7 +35,7 @@ type ListSopRecommendationsInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -53,8 +53,8 @@ type ListSopRecommendationsInput struct { type ListSopRecommendationsOutput struct { - // The standard operating procedure (SOP) recommendations for the Resilience Hub - // applications. + // The standard operating procedure (SOP) recommendations for the AWS Resilience + // Hub applications. // // This member is required. SopRecommendations []types.SopRecommendation diff --git a/service/resiliencehub/api_op_ListSuggestedResiliencyPolicies.go b/service/resiliencehub/api_op_ListSuggestedResiliencyPolicies.go index e3b3e268860..848d4d0c169 100644 --- a/service/resiliencehub/api_op_ListSuggestedResiliencyPolicies.go +++ b/service/resiliencehub/api_op_ListSuggestedResiliencyPolicies.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the suggested resiliency policies for the Resilience Hub applications. +// Lists the suggested resiliency policies for the AWS Resilience Hub applications. func (c *Client) ListSuggestedResiliencyPolicies(ctx context.Context, params *ListSuggestedResiliencyPoliciesInput, optFns ...func(*Options)) (*ListSuggestedResiliencyPoliciesOutput, error) { if params == nil { params = &ListSuggestedResiliencyPoliciesInput{} @@ -43,7 +43,7 @@ type ListSuggestedResiliencyPoliciesInput struct { type ListSuggestedResiliencyPoliciesOutput struct { - // The suggested resiliency policies for the Resilience Hub applications. + // The suggested resiliency policies for the AWS Resilience Hub applications. // // This member is required. ResiliencyPolicies []types.ResiliencyPolicy diff --git a/service/resiliencehub/api_op_ListTagsForResource.go b/service/resiliencehub/api_op_ListTagsForResource.go index 62fb43212ba..ece1b473c7f 100644 --- a/service/resiliencehub/api_op_ListTagsForResource.go +++ b/service/resiliencehub/api_op_ListTagsForResource.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the tags for your resources in your Resilience Hub applications. +// Lists the tags for your resources in your AWS Resilience Hub applications. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} @@ -28,8 +28,8 @@ func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForRes type ListTagsForResourceInput struct { - // The Amazon Resource Name (ARN) for a specific resource in your Resilience Hub - // application. + // The Amazon Resource Name (ARN) for a specific resource in your AWS Resilience + // Hub application. // // This member is required. ResourceArn *string diff --git a/service/resiliencehub/api_op_ListTestRecommendations.go b/service/resiliencehub/api_op_ListTestRecommendations.go index f1fea99d088..ac1bebf0a1c 100644 --- a/service/resiliencehub/api_op_ListTestRecommendations.go +++ b/service/resiliencehub/api_op_ListTestRecommendations.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the test recommendations for the Resilience Hub application. +// Lists the test recommendations for the AWS Resilience Hub application. func (c *Client) ListTestRecommendations(ctx context.Context, params *ListTestRecommendationsInput, optFns ...func(*Options)) (*ListTestRecommendationsOutput, error) { if params == nil { params = &ListTestRecommendationsInput{} @@ -34,7 +34,7 @@ type ListTestRecommendationsInput struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -52,7 +52,7 @@ type ListTestRecommendationsInput struct { type ListTestRecommendationsOutput struct { - // The test recommendations for the Resilience Hub application. + // The test recommendations for the AWS Resilience Hub application. // // This member is required. TestRecommendations []types.TestRecommendation diff --git a/service/resiliencehub/api_op_ListUnsupportedAppVersionResources.go b/service/resiliencehub/api_op_ListUnsupportedAppVersionResources.go index b42cc0bfddb..dd4878ee76f 100644 --- a/service/resiliencehub/api_op_ListUnsupportedAppVersionResources.go +++ b/service/resiliencehub/api_op_ListUnsupportedAppVersionResources.go @@ -14,7 +14,7 @@ import ( // Lists the resources that are not currently supported in AWS Resilience Hub. An // unsupported resource is a resource that exists in the object that was used to -// create an app, but is not supported by Resilience Hub. +// create an app, but is not supported by AWS Resilience Hub. func (c *Client) ListUnsupportedAppVersionResources(ctx context.Context, params *ListUnsupportedAppVersionResourcesInput, optFns ...func(*Options)) (*ListUnsupportedAppVersionResourcesOutput, error) { if params == nil { params = &ListUnsupportedAppVersionResourcesInput{} @@ -32,11 +32,11 @@ func (c *Client) ListUnsupportedAppVersionResources(ctx context.Context, params type ListUnsupportedAppVersionResourcesInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_PublishAppVersion.go b/service/resiliencehub/api_op_PublishAppVersion.go index 9dbe1e7b6f9..95c6f354e8f 100644 --- a/service/resiliencehub/api_op_PublishAppVersion.go +++ b/service/resiliencehub/api_op_PublishAppVersion.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Publishes a new version of a specific Resilience Hub application. +// Publishes a new version of a specific AWS Resilience Hub application. func (c *Client) PublishAppVersion(ctx context.Context, params *PublishAppVersionInput, optFns ...func(*Options)) (*PublishAppVersionOutput, error) { if params == nil { params = &PublishAppVersionInput{} @@ -28,11 +28,11 @@ func (c *Client) PublishAppVersion(ctx context.Context, params *PublishAppVersio type PublishAppVersionInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -42,11 +42,11 @@ type PublishAppVersionInput struct { type PublishAppVersionOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_PutDraftAppVersionTemplate.go b/service/resiliencehub/api_op_PutDraftAppVersionTemplate.go index 9b08803fe8f..82d0fbf5f60 100644 --- a/service/resiliencehub/api_op_PutDraftAppVersionTemplate.go +++ b/service/resiliencehub/api_op_PutDraftAppVersionTemplate.go @@ -10,7 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds or updates the app template for a draft version of a Resilience Hub app. +// Adds or updates the app template for an AWS Resilience Hub application draft +// version. func (c *Client) PutDraftAppVersionTemplate(ctx context.Context, params *PutDraftAppVersionTemplateInput, optFns ...func(*Options)) (*PutDraftAppVersionTemplateOutput, error) { if params == nil { params = &PutDraftAppVersionTemplateInput{} @@ -28,16 +29,99 @@ func (c *Client) PutDraftAppVersionTemplate(ctx context.Context, params *PutDraf type PutDraftAppVersionTemplateInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string - // A JSON string that contains the body of the app template. + // A JSON string that provides information about your application structure. To + // learn more about the appTemplateBody template, see the sample template provided + // in the Examples section. The appTemplateBody JSON string has the following + // structure: + // + // * resources The list of logical resources that needs to be included + // in the application. Type: Array Don't add the resources that you want to + // exclude. Each resources array item includes the following fields: + // + // * + // logicalResourceId The logical identifier of the resource. Type: Object Each + // logicalResourceId object includes the following fields: + // + // * identifier The + // identifier of the resource. Type: String + // + // * logicalStackName The name of the + // CloudFormation stack this resource belongs to. Type: String + // + // * resourceGroupName + // The name of the resource group this resource belongs to. Type: String + // + // * + // terraformSourceName The name of the Terraform S3 state file this resource + // belongs to. Type: String + // + // * type The type of resource. Type: string + // + // * name The + // name of the resource. Type: String + // + // * appComponents The list of Application + // Components that this resource belongs to. If an Application Component is not + // part of the AWS Resilience Hub application, it will be added. Type: Array Each + // appComponents array item includes the following fields: + // + // * name The name of the + // Application Component. Type: String + // + // * type The type of Application Component. + // For more information about the types of Application Component, see Grouping + // resources in an AppComponent + // (https://docs.aws.amazon.com/resilience-hub/latest/userguide/AppComponent.grouping.html). + // Type: String + // + // * resourceNames The list of included resources that are assigned + // to the Application Component. Type: Array of strings + // + // * additionalInfo + // Additional configuration parameters for an AWS Resilience Hub application. + // Currently, this parameter accepts a key-value mapping (in a string format) of + // only one failover region and one associated account. Key: "failover-regions" + // Value: "[{"region":"", "accounts":[{"id":""}]}]" + // + // * + // excludedResources The list of logical resource identifiers to be excluded from + // the application. Type: Array Don't add the resources that you want to include. + // Each excludedResources array item includes the following fields: + // + // * + // logicalResourceIds The logical identifier of the resource. Type: Object You can + // configure only one of the following fields: + // + // * logicalStackName + // + // * + // resourceGroupName + // + // * terraformSourceName + // + // Each logicalResourceIds object + // includes the following fields: + // + // * identifier The identifier of the resource. + // Type: String + // + // * logicalStackName The name of the CloudFormation stack this + // resource belongs to. Type: String + // + // * resourceGroupName The name of the resource + // group this resource belongs to. Type: String + // + // * terraformSourceName The name of + // the Terraform S3 state file this resource belongs to. Type: String // // This member is required. AppTemplateBody *string @@ -47,11 +131,11 @@ type PutDraftAppVersionTemplateInput struct { type PutDraftAppVersionTemplateOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. AppArn *string // The version of the application. diff --git a/service/resiliencehub/api_op_RemoveDraftAppVersionResourceMappings.go b/service/resiliencehub/api_op_RemoveDraftAppVersionResourceMappings.go index d97fb1e39ee..fd6de98dc72 100644 --- a/service/resiliencehub/api_op_RemoveDraftAppVersionResourceMappings.go +++ b/service/resiliencehub/api_op_RemoveDraftAppVersionResourceMappings.go @@ -28,28 +28,31 @@ func (c *Client) RemoveDraftAppVersionResourceMappings(ctx context.Context, para type RemoveDraftAppVersionResourceMappingsInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string - // The names of the registered applications to remove from the resource mappings. + // The names of the registered applications you want to remove from the resource + // mappings. AppRegistryAppNames []string - // The names of the CloudFormation stacks to remove from the resource mappings. + // The names of the CloudFormation stacks you want to remove from the resource + // mappings. LogicalStackNames []string - // The names of the resource groups to remove from the resource mappings. + // The names of the resource groups you want to remove from the resource mappings. ResourceGroupNames []string - // The names of the resources to remove from the resource mappings. + // The names of the resources you want to remove from the resource mappings. ResourceNames []string - // + // The names of the Terraform sources you want to remove from the resource + // mappings. TerraformSourceNames []string noSmithyDocumentSerde @@ -57,11 +60,11 @@ type RemoveDraftAppVersionResourceMappingsInput struct { type RemoveDraftAppVersionResourceMappingsOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. AppArn *string // The version of the application. diff --git a/service/resiliencehub/api_op_ResolveAppVersionResources.go b/service/resiliencehub/api_op_ResolveAppVersionResources.go index c3054c57fa2..deec49b1cb1 100644 --- a/service/resiliencehub/api_op_ResolveAppVersionResources.go +++ b/service/resiliencehub/api_op_ResolveAppVersionResources.go @@ -29,11 +29,11 @@ func (c *Client) ResolveAppVersionResources(ctx context.Context, params *Resolve type ResolveAppVersionResourcesInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -48,11 +48,11 @@ type ResolveAppVersionResourcesInput struct { type ResolveAppVersionResourcesOutput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_StartAppAssessment.go b/service/resiliencehub/api_op_StartAppAssessment.go index ed8340c68f9..8a38185ed1b 100644 --- a/service/resiliencehub/api_op_StartAppAssessment.go +++ b/service/resiliencehub/api_op_StartAppAssessment.go @@ -30,11 +30,11 @@ func (c *Client) StartAppAssessment(ctx context.Context, params *StartAppAssessm type StartAppAssessmentInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string diff --git a/service/resiliencehub/api_op_UntagResource.go b/service/resiliencehub/api_op_UntagResource.go index 8323c9c30e4..00fc2cb28de 100644 --- a/service/resiliencehub/api_op_UntagResource.go +++ b/service/resiliencehub/api_op_UntagResource.go @@ -33,7 +33,7 @@ type UntagResourceInput struct { // This member is required. ResourceArn *string - // The keys of the tags to remove. + // The keys of the tags you want to remove. // // This member is required. TagKeys []string diff --git a/service/resiliencehub/api_op_UpdateApp.go b/service/resiliencehub/api_op_UpdateApp.go index 2be230cbc10..02bd89b35ad 100644 --- a/service/resiliencehub/api_op_UpdateApp.go +++ b/service/resiliencehub/api_op_UpdateApp.go @@ -29,11 +29,11 @@ func (c *Client) UpdateApp(ctx context.Context, params *UpdateAppInput, optFns . type UpdateAppInput struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -51,7 +51,7 @@ type UpdateAppInput struct { // is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For // more information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. PolicyArn *string noSmithyDocumentSerde diff --git a/service/resiliencehub/api_op_UpdateAppVersion.go b/service/resiliencehub/api_op_UpdateAppVersion.go new file mode 100644 index 00000000000..7014dc12c8c --- /dev/null +++ b/service/resiliencehub/api_op_UpdateAppVersion.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the AWS Resilience Hub application version. This API updates the AWS +// Resilience Hub application draft version. To use this information for running +// resiliency assessments, you must publish the AWS Resilience Hub application +// using the PublishAppVersion API. +func (c *Client) UpdateAppVersion(ctx context.Context, params *UpdateAppVersionInput, optFns ...func(*Options)) (*UpdateAppVersionOutput, error) { + if params == nil { + params = &UpdateAppVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAppVersion", params, optFns, c.addOperationUpdateAppVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAppVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAppVersionInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // Additional configuration parameters for an AWS Resilience Hub application. + // Currently, this parameter accepts a key-value mapping (in a string format) of + // only one failover region and one associated account. Key: "failover-regions" + // Value: "[{"region":"", "accounts":[{"id":""}]}]" + AdditionalInfo map[string][]string + + noSmithyDocumentSerde +} + +type UpdateAppVersionOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Additional configuration parameters for an AWS Resilience Hub application. + // Currently, this parameter supports only failover region and account. + AdditionalInfo map[string][]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAppVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAppVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAppVersion{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateAppVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAppVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateAppVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "UpdateAppVersion", + } +} diff --git a/service/resiliencehub/api_op_UpdateAppVersionAppComponent.go b/service/resiliencehub/api_op_UpdateAppVersionAppComponent.go new file mode 100644 index 00000000000..e86261afb6f --- /dev/null +++ b/service/resiliencehub/api_op_UpdateAppVersionAppComponent.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an existing Application Component in the AWS Resilience Hub application. +// This API updates the AWS Resilience Hub application draft version. To use this +// Application Component for running assessments, you must publish the AWS +// Resilience Hub application using the PublishAppVersion API. +func (c *Client) UpdateAppVersionAppComponent(ctx context.Context, params *UpdateAppVersionAppComponentInput, optFns ...func(*Options)) (*UpdateAppVersionAppComponentOutput, error) { + if params == nil { + params = &UpdateAppVersionAppComponentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAppVersionAppComponent", params, optFns, c.addOperationUpdateAppVersionAppComponentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAppVersionAppComponentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAppVersionAppComponentInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The identifier of the Application Component. + // + // This member is required. + Id *string + + // Currently, there is no supported additional information for Application + // Components. + AdditionalInfo map[string][]string + + // The name of the Application Component. + Name *string + + // The type of Application Component. For more information about the types of + // Application Component, see Grouping resources in an AppComponent + // (https://docs.aws.amazon.com/resilience-hub/latest/userguide/AppComponent.grouping.html). + Type *string + + noSmithyDocumentSerde +} + +type UpdateAppVersionAppComponentOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines an Application Component. + AppComponent *types.AppComponent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAppVersionAppComponentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAppVersionAppComponent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAppVersionAppComponent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateAppVersionAppComponentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAppVersionAppComponent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateAppVersionAppComponent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "UpdateAppVersionAppComponent", + } +} diff --git a/service/resiliencehub/api_op_UpdateAppVersionResource.go b/service/resiliencehub/api_op_UpdateAppVersionResource.go new file mode 100644 index 00000000000..9ac546e1d0d --- /dev/null +++ b/service/resiliencehub/api_op_UpdateAppVersionResource.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the resource details in the AWS Resilience Hub application. +// +// * This +// action has no effect outside AWS Resilience Hub. +// +// * This API updates the AWS +// Resilience Hub application draft version. To use this resource for running +// resiliency assessments, you must publish the AWS Resilience Hub application +// using the PublishAppVersion API. +// +// * To update application version with new +// physicalResourceID, you must call ResolveAppVersionResources API. +func (c *Client) UpdateAppVersionResource(ctx context.Context, params *UpdateAppVersionResourceInput, optFns ...func(*Options)) (*UpdateAppVersionResourceOutput, error) { + if params == nil { + params = &UpdateAppVersionResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAppVersionResource", params, optFns, c.addOperationUpdateAppVersionResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAppVersionResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAppVersionResourceInput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // Currently, there is no supported additional information for resources. + AdditionalInfo map[string][]string + + // The list of Application Components that this resource belongs to. If an + // Application Component is not part of the AWS Resilience Hub application, it will + // be added. + AppComponents []string + + // The Amazon Web Services account that owns the physical resource. + AwsAccountId *string + + // The Amazon Web Services region that owns the physical resource. + AwsRegion *string + + // Indicates if a resource is excluded from an AWS Resilience Hub application. You + // can exclude only imported resources from an AWS Resilience Hub application. + Excluded *bool + + // The logical identifier of the resource. + LogicalResourceId *types.LogicalResourceId + + // The physical identifier of the resource. + PhysicalResourceId *string + + // The name of the resource. + ResourceName *string + + // The type of resource. + ResourceType *string + + noSmithyDocumentSerde +} + +type UpdateAppVersionResourceOutput struct { + + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + // + // This member is required. + AppArn *string + + // The AWS Resilience Hub application version. + // + // This member is required. + AppVersion *string + + // Defines a physical resource. A physical resource is a resource that exists in + // your account. It can be identified using an Amazon Resource Name (ARN) or a + // Resilience Hub-native identifier. + PhysicalResource *types.PhysicalResource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAppVersionResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAppVersionResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAppVersionResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateAppVersionResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAppVersionResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateAppVersionResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resiliencehub", + OperationName: "UpdateAppVersionResource", + } +} diff --git a/service/resiliencehub/api_op_UpdateResiliencyPolicy.go b/service/resiliencehub/api_op_UpdateResiliencyPolicy.go index 1bfc75d0429..2390c90f735 100644 --- a/service/resiliencehub/api_op_UpdateResiliencyPolicy.go +++ b/service/resiliencehub/api_op_UpdateResiliencyPolicy.go @@ -33,7 +33,7 @@ type UpdateResiliencyPolicyInput struct { // is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For // more information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. PolicyArn *string diff --git a/service/resiliencehub/deserializers.go b/service/resiliencehub/deserializers.go index 42fd859a617..885416046a8 100644 --- a/service/resiliencehub/deserializers.go +++ b/service/resiliencehub/deserializers.go @@ -365,14 +365,14 @@ func awsRestjson1_deserializeOpDocumentCreateAppOutput(v **CreateAppOutput, valu return nil } -type awsRestjson1_deserializeOpCreateRecommendationTemplate struct { +type awsRestjson1_deserializeOpCreateAppVersionAppComponent struct { } -func (*awsRestjson1_deserializeOpCreateRecommendationTemplate) ID() string { +func (*awsRestjson1_deserializeOpCreateAppVersionAppComponent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateRecommendationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAppVersionAppComponent) 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) @@ -386,9 +386,9 @@ func (m *awsRestjson1_deserializeOpCreateRecommendationTemplate) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateRecommendationTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAppVersionAppComponent(response, &metadata) } - output := &CreateRecommendationTemplateOutput{} + output := &CreateAppVersionAppComponentOutput{} out.Result = output var buff [1024]byte @@ -409,7 +409,7 @@ func (m *awsRestjson1_deserializeOpCreateRecommendationTemplate) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateRecommendationTemplateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAppVersionAppComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -422,7 +422,7 @@ func (m *awsRestjson1_deserializeOpCreateRecommendationTemplate) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateRecommendationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAppVersionAppComponent(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)} @@ -475,6 +475,9 @@ func awsRestjson1_deserializeOpErrorCreateRecommendationTemplate(response *smith case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -491,7 +494,7 @@ func awsRestjson1_deserializeOpErrorCreateRecommendationTemplate(response *smith } } -func awsRestjson1_deserializeOpDocumentCreateRecommendationTemplateOutput(v **CreateRecommendationTemplateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAppVersionAppComponentOutput(v **CreateAppVersionAppComponentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -504,20 +507,38 @@ func awsRestjson1_deserializeOpDocumentCreateRecommendationTemplateOutput(v **Cr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateRecommendationTemplateOutput + var sv *CreateAppVersionAppComponentOutput if *v == nil { - sv = &CreateRecommendationTemplateOutput{} + sv = &CreateAppVersionAppComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "recommendationTemplate": - if err := awsRestjson1_deserializeDocumentRecommendationTemplate(&sv.RecommendationTemplate, value); err != nil { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appComponent": + if err := awsRestjson1_deserializeDocumentAppComponent(&sv.AppComponent, value); err != nil { return err } + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + default: _, _ = key, value @@ -527,14 +548,14 @@ func awsRestjson1_deserializeOpDocumentCreateRecommendationTemplateOutput(v **Cr return nil } -type awsRestjson1_deserializeOpCreateResiliencyPolicy struct { +type awsRestjson1_deserializeOpCreateAppVersionResource struct { } -func (*awsRestjson1_deserializeOpCreateResiliencyPolicy) ID() string { +func (*awsRestjson1_deserializeOpCreateAppVersionResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateResiliencyPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAppVersionResource) 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) @@ -548,9 +569,9 @@ func (m *awsRestjson1_deserializeOpCreateResiliencyPolicy) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateResiliencyPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAppVersionResource(response, &metadata) } - output := &CreateResiliencyPolicyOutput{} + output := &CreateAppVersionResourceOutput{} out.Result = output var buff [1024]byte @@ -571,7 +592,7 @@ func (m *awsRestjson1_deserializeOpCreateResiliencyPolicy) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateResiliencyPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAppVersionResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -584,7 +605,7 @@ func (m *awsRestjson1_deserializeOpCreateResiliencyPolicy) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateResiliencyPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAppVersionResource(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)} @@ -634,6 +655,9 @@ func awsRestjson1_deserializeOpErrorCreateResiliencyPolicy(response *smithyhttp. case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) @@ -653,7 +677,7 @@ func awsRestjson1_deserializeOpErrorCreateResiliencyPolicy(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentCreateResiliencyPolicyOutput(v **CreateResiliencyPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAppVersionResourceOutput(v **CreateAppVersionResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -666,17 +690,35 @@ func awsRestjson1_deserializeOpDocumentCreateResiliencyPolicyOutput(v **CreateRe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateResiliencyPolicyOutput + var sv *CreateAppVersionResourceOutput if *v == nil { - sv = &CreateResiliencyPolicyOutput{} + sv = &CreateAppVersionResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "policy": - if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&sv.Policy, value); err != nil { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + case "physicalResource": + if err := awsRestjson1_deserializeDocumentPhysicalResource(&sv.PhysicalResource, value); err != nil { return err } @@ -689,14 +731,14 @@ func awsRestjson1_deserializeOpDocumentCreateResiliencyPolicyOutput(v **CreateRe return nil } -type awsRestjson1_deserializeOpDeleteApp struct { +type awsRestjson1_deserializeOpCreateRecommendationTemplate struct { } -func (*awsRestjson1_deserializeOpDeleteApp) ID() string { +func (*awsRestjson1_deserializeOpCreateRecommendationTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateRecommendationTemplate) 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) @@ -710,9 +752,9 @@ func (m *awsRestjson1_deserializeOpDeleteApp) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteApp(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateRecommendationTemplate(response, &metadata) } - output := &DeleteAppOutput{} + output := &CreateRecommendationTemplateOutput{} out.Result = output var buff [1024]byte @@ -733,7 +775,7 @@ func (m *awsRestjson1_deserializeOpDeleteApp) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteAppOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateRecommendationTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -746,7 +788,7 @@ func (m *awsRestjson1_deserializeOpDeleteApp) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateRecommendationTemplate(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)} @@ -787,6 +829,9 @@ func awsRestjson1_deserializeOpErrorDeleteApp(response *smithyhttp.Response, met } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) @@ -796,6 +841,9 @@ func awsRestjson1_deserializeOpErrorDeleteApp(response *smithyhttp.Response, met case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -812,7 +860,7 @@ func awsRestjson1_deserializeOpErrorDeleteApp(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentDeleteAppOutput(v **DeleteAppOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateRecommendationTemplateOutput(v **CreateRecommendationTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -825,22 +873,18 @@ func awsRestjson1_deserializeOpDocumentDeleteAppOutput(v **DeleteAppOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteAppOutput + var sv *CreateRecommendationTemplateOutput if *v == nil { - sv = &DeleteAppOutput{} + sv = &CreateRecommendationTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.AppArn = ptr.String(jtv) + case "recommendationTemplate": + if err := awsRestjson1_deserializeDocumentRecommendationTemplate(&sv.RecommendationTemplate, value); err != nil { + return err } default: @@ -852,14 +896,14 @@ func awsRestjson1_deserializeOpDocumentDeleteAppOutput(v **DeleteAppOutput, valu return nil } -type awsRestjson1_deserializeOpDeleteAppAssessment struct { +type awsRestjson1_deserializeOpCreateResiliencyPolicy struct { } -func (*awsRestjson1_deserializeOpDeleteAppAssessment) ID() string { +func (*awsRestjson1_deserializeOpCreateResiliencyPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAppAssessment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateResiliencyPolicy) 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) @@ -873,9 +917,9 @@ func (m *awsRestjson1_deserializeOpDeleteAppAssessment) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAppAssessment(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateResiliencyPolicy(response, &metadata) } - output := &DeleteAppAssessmentOutput{} + output := &CreateResiliencyPolicyOutput{} out.Result = output var buff [1024]byte @@ -896,7 +940,7 @@ func (m *awsRestjson1_deserializeOpDeleteAppAssessment) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteAppAssessmentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateResiliencyPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -909,7 +953,7 @@ func (m *awsRestjson1_deserializeOpDeleteAppAssessment) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAppAssessment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateResiliencyPolicy(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)} @@ -959,8 +1003,8 @@ func awsRestjson1_deserializeOpErrorDeleteAppAssessment(response *smithyhttp.Res case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -978,7 +1022,7 @@ func awsRestjson1_deserializeOpErrorDeleteAppAssessment(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentDeleteAppAssessmentOutput(v **DeleteAppAssessmentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateResiliencyPolicyOutput(v **CreateResiliencyPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -991,31 +1035,18 @@ func awsRestjson1_deserializeOpDocumentDeleteAppAssessmentOutput(v **DeleteAppAs return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteAppAssessmentOutput + var sv *CreateResiliencyPolicyOutput if *v == nil { - sv = &DeleteAppAssessmentOutput{} + sv = &CreateResiliencyPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assessmentArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.AssessmentArn = ptr.String(jtv) - } - - case "assessmentStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AssessmentStatus to be of type string, got %T instead", value) - } - sv.AssessmentStatus = types.AssessmentStatus(jtv) + case "policy": + if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&sv.Policy, value); err != nil { + return err } default: @@ -1027,14 +1058,14 @@ func awsRestjson1_deserializeOpDocumentDeleteAppAssessmentOutput(v **DeleteAppAs return nil } -type awsRestjson1_deserializeOpDeleteRecommendationTemplate struct { +type awsRestjson1_deserializeOpDeleteApp struct { } -func (*awsRestjson1_deserializeOpDeleteRecommendationTemplate) ID() string { +func (*awsRestjson1_deserializeOpDeleteApp) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteRecommendationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteApp) 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) @@ -1048,9 +1079,9 @@ func (m *awsRestjson1_deserializeOpDeleteRecommendationTemplate) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteRecommendationTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteApp(response, &metadata) } - output := &DeleteRecommendationTemplateOutput{} + output := &DeleteAppOutput{} out.Result = output var buff [1024]byte @@ -1071,7 +1102,7 @@ func (m *awsRestjson1_deserializeOpDeleteRecommendationTemplate) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteRecommendationTemplateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1084,7 +1115,7 @@ func (m *awsRestjson1_deserializeOpDeleteRecommendationTemplate) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteRecommendationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteApp(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)} @@ -1125,8 +1156,8 @@ func awsRestjson1_deserializeOpErrorDeleteRecommendationTemplate(response *smith } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -1150,7 +1181,7 @@ func awsRestjson1_deserializeOpErrorDeleteRecommendationTemplate(response *smith } } -func awsRestjson1_deserializeOpDocumentDeleteRecommendationTemplateOutput(v **DeleteRecommendationTemplateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAppOutput(v **DeleteAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1163,31 +1194,22 @@ func awsRestjson1_deserializeOpDocumentDeleteRecommendationTemplateOutput(v **De return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteRecommendationTemplateOutput + var sv *DeleteAppOutput if *v == nil { - sv = &DeleteRecommendationTemplateOutput{} + sv = &DeleteAppOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "recommendationTemplateArn": + case "appArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.RecommendationTemplateArn = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RecommendationTemplateStatus to be of type string, got %T instead", value) - } - sv.Status = types.RecommendationTemplateStatus(jtv) + sv.AppArn = ptr.String(jtv) } default: @@ -1199,14 +1221,14 @@ func awsRestjson1_deserializeOpDocumentDeleteRecommendationTemplateOutput(v **De return nil } -type awsRestjson1_deserializeOpDeleteResiliencyPolicy struct { +type awsRestjson1_deserializeOpDeleteAppAssessment struct { } -func (*awsRestjson1_deserializeOpDeleteResiliencyPolicy) ID() string { +func (*awsRestjson1_deserializeOpDeleteAppAssessment) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteResiliencyPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAppAssessment) 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) @@ -1220,9 +1242,9 @@ func (m *awsRestjson1_deserializeOpDeleteResiliencyPolicy) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteResiliencyPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAppAssessment(response, &metadata) } - output := &DeleteResiliencyPolicyOutput{} + output := &DeleteAppAssessmentOutput{} out.Result = output var buff [1024]byte @@ -1243,7 +1265,7 @@ func (m *awsRestjson1_deserializeOpDeleteResiliencyPolicy) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteResiliencyPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAppAssessmentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1256,7 +1278,7 @@ func (m *awsRestjson1_deserializeOpDeleteResiliencyPolicy) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteResiliencyPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAppAssessment(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)} @@ -1325,7 +1347,7 @@ func awsRestjson1_deserializeOpErrorDeleteResiliencyPolicy(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentDeleteResiliencyPolicyOutput(v **DeleteResiliencyPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAppAssessmentOutput(v **DeleteAppAssessmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1338,22 +1360,31 @@ func awsRestjson1_deserializeOpDocumentDeleteResiliencyPolicyOutput(v **DeleteRe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteResiliencyPolicyOutput + var sv *DeleteAppAssessmentOutput if *v == nil { - sv = &DeleteResiliencyPolicyOutput{} + sv = &DeleteAppAssessmentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "policyArn": + case "assessmentArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.PolicyArn = ptr.String(jtv) + sv.AssessmentArn = ptr.String(jtv) + } + + case "assessmentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssessmentStatus to be of type string, got %T instead", value) + } + sv.AssessmentStatus = types.AssessmentStatus(jtv) } default: @@ -1365,14 +1396,14 @@ func awsRestjson1_deserializeOpDocumentDeleteResiliencyPolicyOutput(v **DeleteRe return nil } -type awsRestjson1_deserializeOpDescribeApp struct { +type awsRestjson1_deserializeOpDeleteAppInputSource struct { } -func (*awsRestjson1_deserializeOpDescribeApp) ID() string { +func (*awsRestjson1_deserializeOpDeleteAppInputSource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAppInputSource) 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) @@ -1386,9 +1417,9 @@ func (m *awsRestjson1_deserializeOpDescribeApp) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeApp(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAppInputSource(response, &metadata) } - output := &DescribeAppOutput{} + output := &DeleteAppInputSourceOutput{} out.Result = output var buff [1024]byte @@ -1409,7 +1440,7 @@ func (m *awsRestjson1_deserializeOpDescribeApp) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAppOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAppInputSourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1422,7 +1453,7 @@ func (m *awsRestjson1_deserializeOpDescribeApp) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAppInputSource(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)} @@ -1466,6 +1497,9 @@ func awsRestjson1_deserializeOpErrorDescribeApp(response *smithyhttp.Response, m case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -1488,7 +1522,7 @@ func awsRestjson1_deserializeOpErrorDescribeApp(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentDescribeAppOutput(v **DescribeAppOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAppInputSourceOutput(v **DeleteAppInputSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1501,17 +1535,26 @@ func awsRestjson1_deserializeOpDocumentDescribeAppOutput(v **DescribeAppOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAppOutput + var sv *DeleteAppInputSourceOutput if *v == nil { - sv = &DescribeAppOutput{} + sv = &DeleteAppInputSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "app": - if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appInputSource": + if err := awsRestjson1_deserializeDocumentAppInputSource(&sv.AppInputSource, value); err != nil { return err } @@ -1524,14 +1567,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAppOutput(v **DescribeAppOutput, return nil } -type awsRestjson1_deserializeOpDescribeAppAssessment struct { +type awsRestjson1_deserializeOpDeleteAppVersionAppComponent struct { } -func (*awsRestjson1_deserializeOpDescribeAppAssessment) ID() string { +func (*awsRestjson1_deserializeOpDeleteAppVersionAppComponent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAppAssessment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAppVersionAppComponent) 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) @@ -1545,9 +1588,9 @@ func (m *awsRestjson1_deserializeOpDescribeAppAssessment) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppAssessment(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAppVersionAppComponent(response, &metadata) } - output := &DescribeAppAssessmentOutput{} + output := &DeleteAppVersionAppComponentOutput{} out.Result = output var buff [1024]byte @@ -1568,7 +1611,7 @@ func (m *awsRestjson1_deserializeOpDescribeAppAssessment) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAppAssessmentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAppVersionAppComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1581,7 +1624,7 @@ func (m *awsRestjson1_deserializeOpDescribeAppAssessment) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAppAssessment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAppVersionAppComponent(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)} @@ -1625,6 +1668,9 @@ func awsRestjson1_deserializeOpErrorDescribeAppAssessment(response *smithyhttp.R case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -1647,7 +1693,7 @@ func awsRestjson1_deserializeOpErrorDescribeAppAssessment(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentDescribeAppAssessmentOutput(v **DescribeAppAssessmentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAppVersionAppComponentOutput(v **DeleteAppVersionAppComponentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1660,19 +1706,37 @@ func awsRestjson1_deserializeOpDocumentDescribeAppAssessmentOutput(v **DescribeA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAppAssessmentOutput + var sv *DeleteAppVersionAppComponentOutput if *v == nil { - sv = &DescribeAppAssessmentOutput{} + sv = &DeleteAppVersionAppComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assessment": - if err := awsRestjson1_deserializeDocumentAppAssessment(&sv.Assessment, value); err != nil { - return err - } + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appComponent": + if err := awsRestjson1_deserializeDocumentAppComponent(&sv.AppComponent, value); err != nil { + return err + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } default: _, _ = key, value @@ -1683,14 +1747,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAppAssessmentOutput(v **DescribeA return nil } -type awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus struct { +type awsRestjson1_deserializeOpDeleteAppVersionResource struct { } -func (*awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) ID() string { +func (*awsRestjson1_deserializeOpDeleteAppVersionResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAppVersionResource) 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) @@ -1704,9 +1768,9 @@ func (m *awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppVersionResourcesResolutionStatus(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAppVersionResource(response, &metadata) } - output := &DescribeAppVersionResourcesResolutionStatusOutput{} + output := &DeleteAppVersionResourceOutput{} out.Result = output var buff [1024]byte @@ -1727,7 +1791,7 @@ func (m *awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAppVersionResourcesResolutionStatusOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAppVersionResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1740,7 +1804,7 @@ func (m *awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAppVersionResourcesResolutionStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAppVersionResource(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)} @@ -1784,6 +1848,9 @@ func awsRestjson1_deserializeOpErrorDescribeAppVersionResourcesResolutionStatus( case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -1806,7 +1873,7 @@ func awsRestjson1_deserializeOpErrorDescribeAppVersionResourcesResolutionStatus( } } -func awsRestjson1_deserializeOpDocumentDescribeAppVersionResourcesResolutionStatusOutput(v **DescribeAppVersionResourcesResolutionStatusOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAppVersionResourceOutput(v **DeleteAppVersionResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1819,9 +1886,9 @@ func awsRestjson1_deserializeOpDocumentDescribeAppVersionResourcesResolutionStat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAppVersionResourcesResolutionStatusOutput + var sv *DeleteAppVersionResourceOutput if *v == nil { - sv = &DescribeAppVersionResourcesResolutionStatusOutput{} + sv = &DeleteAppVersionResourceOutput{} } else { sv = *v } @@ -1846,31 +1913,9 @@ func awsRestjson1_deserializeOpDocumentDescribeAppVersionResourcesResolutionStat sv.AppVersion = ptr.String(jtv) } - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String500 to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - case "resolutionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String255 to be of type string, got %T instead", value) - } - sv.ResolutionId = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceResolutionStatusType to be of type string, got %T instead", value) - } - sv.Status = types.ResourceResolutionStatusType(jtv) + case "physicalResource": + if err := awsRestjson1_deserializeDocumentPhysicalResource(&sv.PhysicalResource, value); err != nil { + return err } default: @@ -1882,14 +1927,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAppVersionResourcesResolutionStat return nil } -type awsRestjson1_deserializeOpDescribeAppVersionTemplate struct { +type awsRestjson1_deserializeOpDeleteRecommendationTemplate struct { } -func (*awsRestjson1_deserializeOpDescribeAppVersionTemplate) ID() string { +func (*awsRestjson1_deserializeOpDeleteRecommendationTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAppVersionTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteRecommendationTemplate) 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) @@ -1903,9 +1948,9 @@ func (m *awsRestjson1_deserializeOpDescribeAppVersionTemplate) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppVersionTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteRecommendationTemplate(response, &metadata) } - output := &DescribeAppVersionTemplateOutput{} + output := &DeleteRecommendationTemplateOutput{} out.Result = output var buff [1024]byte @@ -1926,7 +1971,7 @@ func (m *awsRestjson1_deserializeOpDescribeAppVersionTemplate) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAppVersionTemplateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteRecommendationTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1939,7 +1984,7 @@ func (m *awsRestjson1_deserializeOpDescribeAppVersionTemplate) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAppVersionTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteRecommendationTemplate(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)} @@ -2005,7 +2050,7 @@ func awsRestjson1_deserializeOpErrorDescribeAppVersionTemplate(response *smithyh } } -func awsRestjson1_deserializeOpDocumentDescribeAppVersionTemplateOutput(v **DescribeAppVersionTemplateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteRecommendationTemplateOutput(v **DeleteRecommendationTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2018,40 +2063,31 @@ func awsRestjson1_deserializeOpDocumentDescribeAppVersionTemplateOutput(v **Desc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAppVersionTemplateOutput + var sv *DeleteRecommendationTemplateOutput if *v == nil { - sv = &DescribeAppVersionTemplateOutput{} + sv = &DeleteRecommendationTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appArn": + case "recommendationTemplateArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.AppArn = ptr.String(jtv) - } - - case "appTemplateBody": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AppTemplateBody to be of type string, got %T instead", value) - } - sv.AppTemplateBody = ptr.String(jtv) + sv.RecommendationTemplateArn = ptr.String(jtv) } - case "appVersion": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationTemplateStatus to be of type string, got %T instead", value) } - sv.AppVersion = ptr.String(jtv) + sv.Status = types.RecommendationTemplateStatus(jtv) } default: @@ -2063,14 +2099,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAppVersionTemplateOutput(v **Desc return nil } -type awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus struct { +type awsRestjson1_deserializeOpDeleteResiliencyPolicy struct { } -func (*awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) ID() string { +func (*awsRestjson1_deserializeOpDeleteResiliencyPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteResiliencyPolicy) 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) @@ -2084,9 +2120,9 @@ func (m *awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDraftAppVersionResourcesImportStatus(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteResiliencyPolicy(response, &metadata) } - output := &DescribeDraftAppVersionResourcesImportStatusOutput{} + output := &DeleteResiliencyPolicyOutput{} out.Result = output var buff [1024]byte @@ -2107,7 +2143,7 @@ func (m *awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeDraftAppVersionResourcesImportStatusOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteResiliencyPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2120,7 +2156,7 @@ func (m *awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeDraftAppVersionResourcesImportStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteResiliencyPolicy(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)} @@ -2164,6 +2200,9 @@ func awsRestjson1_deserializeOpErrorDescribeDraftAppVersionResourcesImportStatus case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2186,7 +2225,7 @@ func awsRestjson1_deserializeOpErrorDescribeDraftAppVersionResourcesImportStatus } } -func awsRestjson1_deserializeOpDocumentDescribeDraftAppVersionResourcesImportStatusOutput(v **DescribeDraftAppVersionResourcesImportStatusOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteResiliencyPolicyOutput(v **DeleteResiliencyPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2199,65 +2238,22 @@ func awsRestjson1_deserializeOpDocumentDescribeDraftAppVersionResourcesImportSta return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeDraftAppVersionResourcesImportStatusOutput + var sv *DeleteResiliencyPolicyOutput if *v == nil { - sv = &DescribeDraftAppVersionResourcesImportStatusOutput{} + sv = &DeleteResiliencyPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appArn": + case "policyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.AppArn = ptr.String(jtv) - } - - case "appVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) - } - sv.AppVersion = ptr.String(jtv) - } - - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String500 to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceImportStatusType to be of type string, got %T instead", value) - } - sv.Status = types.ResourceImportStatusType(jtv) - } - - case "statusChangeTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.StatusChangeTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value) - - } + sv.PolicyArn = ptr.String(jtv) } default: @@ -2269,14 +2265,14 @@ func awsRestjson1_deserializeOpDocumentDescribeDraftAppVersionResourcesImportSta return nil } -type awsRestjson1_deserializeOpDescribeResiliencyPolicy struct { +type awsRestjson1_deserializeOpDescribeApp struct { } -func (*awsRestjson1_deserializeOpDescribeResiliencyPolicy) ID() string { +func (*awsRestjson1_deserializeOpDescribeApp) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeResiliencyPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeApp) 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) @@ -2290,9 +2286,9 @@ func (m *awsRestjson1_deserializeOpDescribeResiliencyPolicy) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeResiliencyPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeApp(response, &metadata) } - output := &DescribeResiliencyPolicyOutput{} + output := &DescribeAppOutput{} out.Result = output var buff [1024]byte @@ -2313,7 +2309,7 @@ func (m *awsRestjson1_deserializeOpDescribeResiliencyPolicy) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeResiliencyPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2326,7 +2322,7 @@ func (m *awsRestjson1_deserializeOpDescribeResiliencyPolicy) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeResiliencyPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeApp(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)} @@ -2392,7 +2388,7 @@ func awsRestjson1_deserializeOpErrorDescribeResiliencyPolicy(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentDescribeResiliencyPolicyOutput(v **DescribeResiliencyPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAppOutput(v **DescribeAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2405,17 +2401,17 @@ func awsRestjson1_deserializeOpDocumentDescribeResiliencyPolicyOutput(v **Descri return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeResiliencyPolicyOutput + var sv *DescribeAppOutput if *v == nil { - sv = &DescribeResiliencyPolicyOutput{} + sv = &DescribeAppOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "policy": - if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&sv.Policy, value); err != nil { + case "app": + if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil { return err } @@ -2428,14 +2424,14 @@ func awsRestjson1_deserializeOpDocumentDescribeResiliencyPolicyOutput(v **Descri return nil } -type awsRestjson1_deserializeOpImportResourcesToDraftAppVersion struct { +type awsRestjson1_deserializeOpDescribeAppAssessment struct { } -func (*awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) ID() string { +func (*awsRestjson1_deserializeOpDescribeAppAssessment) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAppAssessment) 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) @@ -2449,9 +2445,9 @@ func (m *awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorImportResourcesToDraftAppVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppAssessment(response, &metadata) } - output := &ImportResourcesToDraftAppVersionOutput{} + output := &DescribeAppAssessmentOutput{} out.Result = output var buff [1024]byte @@ -2472,7 +2468,7 @@ func (m *awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentImportResourcesToDraftAppVersionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAppAssessmentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2485,7 +2481,7 @@ func (m *awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorImportResourcesToDraftAppVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAppAssessment(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)} @@ -2529,9 +2525,6 @@ func awsRestjson1_deserializeOpErrorImportResourcesToDraftAppVersion(response *s case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2554,7 +2547,7 @@ func awsRestjson1_deserializeOpErrorImportResourcesToDraftAppVersion(response *s } } -func awsRestjson1_deserializeOpDocumentImportResourcesToDraftAppVersionOutput(v **ImportResourcesToDraftAppVersionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAppAssessmentOutput(v **DescribeAppAssessmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2567,49 +2560,17 @@ func awsRestjson1_deserializeOpDocumentImportResourcesToDraftAppVersionOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ImportResourcesToDraftAppVersionOutput + var sv *DescribeAppAssessmentOutput if *v == nil { - sv = &ImportResourcesToDraftAppVersionOutput{} + sv = &DescribeAppAssessmentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.AppArn = ptr.String(jtv) - } - - case "appVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) - } - sv.AppVersion = ptr.String(jtv) - } - - case "sourceArns": - if err := awsRestjson1_deserializeDocumentArnList(&sv.SourceArns, value); err != nil { - return err - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceImportStatusType to be of type string, got %T instead", value) - } - sv.Status = types.ResourceImportStatusType(jtv) - } - - case "terraformSources": - if err := awsRestjson1_deserializeDocumentTerraformSourceList(&sv.TerraformSources, value); err != nil { + case "assessment": + if err := awsRestjson1_deserializeDocumentAppAssessment(&sv.Assessment, value); err != nil { return err } @@ -2622,14 +2583,14 @@ func awsRestjson1_deserializeOpDocumentImportResourcesToDraftAppVersionOutput(v return nil } -type awsRestjson1_deserializeOpListAlarmRecommendations struct { +type awsRestjson1_deserializeOpDescribeAppVersion struct { } -func (*awsRestjson1_deserializeOpListAlarmRecommendations) ID() string { +func (*awsRestjson1_deserializeOpDescribeAppVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAlarmRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAppVersion) 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) @@ -2643,9 +2604,9 @@ func (m *awsRestjson1_deserializeOpListAlarmRecommendations) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAlarmRecommendations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppVersion(response, &metadata) } - output := &ListAlarmRecommendationsOutput{} + output := &DescribeAppVersionOutput{} out.Result = output var buff [1024]byte @@ -2666,7 +2627,7 @@ func (m *awsRestjson1_deserializeOpListAlarmRecommendations) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAlarmRecommendationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAppVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2679,7 +2640,7 @@ func (m *awsRestjson1_deserializeOpListAlarmRecommendations) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAlarmRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAppVersion(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)} @@ -2745,7 +2706,7 @@ func awsRestjson1_deserializeOpErrorListAlarmRecommendations(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListAlarmRecommendationsOutput(v **ListAlarmRecommendationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAppVersionOutput(v **DescribeAppVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2758,27 +2719,36 @@ func awsRestjson1_deserializeOpDocumentListAlarmRecommendationsOutput(v **ListAl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAlarmRecommendationsOutput + var sv *DescribeAppVersionOutput if *v == nil { - sv = &ListAlarmRecommendationsOutput{} + sv = &DescribeAppVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "alarmRecommendations": - if err := awsRestjson1_deserializeDocumentAlarmRecommendationList(&sv.AlarmRecommendations, value); err != nil { + case "additionalInfo": + if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil { return err } - case "nextToken": + case "appArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) } default: @@ -2790,14 +2760,14 @@ func awsRestjson1_deserializeOpDocumentListAlarmRecommendationsOutput(v **ListAl return nil } -type awsRestjson1_deserializeOpListAppAssessments struct { +type awsRestjson1_deserializeOpDescribeAppVersionAppComponent struct { } -func (*awsRestjson1_deserializeOpListAppAssessments) ID() string { +func (*awsRestjson1_deserializeOpDescribeAppVersionAppComponent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAppAssessments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAppVersionAppComponent) 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) @@ -2811,9 +2781,9 @@ func (m *awsRestjson1_deserializeOpListAppAssessments) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAppAssessments(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppVersionAppComponent(response, &metadata) } - output := &ListAppAssessmentsOutput{} + output := &DescribeAppVersionAppComponentOutput{} out.Result = output var buff [1024]byte @@ -2834,7 +2804,7 @@ func (m *awsRestjson1_deserializeOpListAppAssessments) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppAssessmentsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAppVersionAppComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2847,7 +2817,7 @@ func (m *awsRestjson1_deserializeOpListAppAssessments) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAppAssessments(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAppVersionAppComponent(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)} @@ -2891,6 +2861,9 @@ func awsRestjson1_deserializeOpErrorListAppAssessments(response *smithyhttp.Resp case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2913,7 +2886,7 @@ func awsRestjson1_deserializeOpErrorListAppAssessments(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListAppAssessmentsOutput(v **ListAppAssessmentsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAppVersionAppComponentOutput(v **DescribeAppVersionAppComponentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2926,27 +2899,36 @@ func awsRestjson1_deserializeOpDocumentListAppAssessmentsOutput(v **ListAppAsses return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppAssessmentsOutput + var sv *DescribeAppVersionAppComponentOutput if *v == nil { - sv = &ListAppAssessmentsOutput{} + sv = &DescribeAppVersionAppComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assessmentSummaries": - if err := awsRestjson1_deserializeDocumentAppAssessmentSummaryList(&sv.AssessmentSummaries, value); err != nil { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appComponent": + if err := awsRestjson1_deserializeDocumentAppComponent(&sv.AppComponent, value); err != nil { return err } - case "nextToken": + case "appVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AppVersion = ptr.String(jtv) } default: @@ -2958,14 +2940,14 @@ func awsRestjson1_deserializeOpDocumentListAppAssessmentsOutput(v **ListAppAsses return nil } -type awsRestjson1_deserializeOpListAppComponentCompliances struct { +type awsRestjson1_deserializeOpDescribeAppVersionResource struct { } -func (*awsRestjson1_deserializeOpListAppComponentCompliances) ID() string { +func (*awsRestjson1_deserializeOpDescribeAppVersionResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAppComponentCompliances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAppVersionResource) 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) @@ -2979,9 +2961,9 @@ func (m *awsRestjson1_deserializeOpListAppComponentCompliances) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAppComponentCompliances(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppVersionResource(response, &metadata) } - output := &ListAppComponentCompliancesOutput{} + output := &DescribeAppVersionResourceOutput{} out.Result = output var buff [1024]byte @@ -3002,7 +2984,7 @@ func (m *awsRestjson1_deserializeOpListAppComponentCompliances) HandleDeserializ return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppComponentCompliancesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAppVersionResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3015,7 +2997,7 @@ func (m *awsRestjson1_deserializeOpListAppComponentCompliances) HandleDeserializ return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAppComponentCompliances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAppVersionResource(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)} @@ -3059,6 +3041,9 @@ func awsRestjson1_deserializeOpErrorListAppComponentCompliances(response *smithy case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3081,7 +3066,7 @@ func awsRestjson1_deserializeOpErrorListAppComponentCompliances(response *smithy } } -func awsRestjson1_deserializeOpDocumentListAppComponentCompliancesOutput(v **ListAppComponentCompliancesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAppVersionResourceOutput(v **DescribeAppVersionResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3094,27 +3079,36 @@ func awsRestjson1_deserializeOpDocumentListAppComponentCompliancesOutput(v **Lis return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppComponentCompliancesOutput + var sv *DescribeAppVersionResourceOutput if *v == nil { - sv = &ListAppComponentCompliancesOutput{} + sv = &DescribeAppVersionResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentCompliances": - if err := awsRestjson1_deserializeDocumentComponentCompliancesList(&sv.ComponentCompliances, value); err != nil { - return err + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) } - case "nextToken": + case "appVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AppVersion = ptr.String(jtv) + } + + case "physicalResource": + if err := awsRestjson1_deserializeDocumentPhysicalResource(&sv.PhysicalResource, value); err != nil { + return err } default: @@ -3126,14 +3120,14 @@ func awsRestjson1_deserializeOpDocumentListAppComponentCompliancesOutput(v **Lis return nil } -type awsRestjson1_deserializeOpListAppComponentRecommendations struct { +type awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus struct { } -func (*awsRestjson1_deserializeOpListAppComponentRecommendations) ID() string { +func (*awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAppComponentRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) 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) @@ -3147,9 +3141,9 @@ func (m *awsRestjson1_deserializeOpListAppComponentRecommendations) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAppComponentRecommendations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppVersionResourcesResolutionStatus(response, &metadata) } - output := &ListAppComponentRecommendationsOutput{} + output := &DescribeAppVersionResourcesResolutionStatusOutput{} out.Result = output var buff [1024]byte @@ -3170,7 +3164,7 @@ func (m *awsRestjson1_deserializeOpListAppComponentRecommendations) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppComponentRecommendationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAppVersionResourcesResolutionStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3183,7 +3177,7 @@ func (m *awsRestjson1_deserializeOpListAppComponentRecommendations) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAppComponentRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAppVersionResourcesResolutionStatus(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)} @@ -3249,7 +3243,7 @@ func awsRestjson1_deserializeOpErrorListAppComponentRecommendations(response *sm } } -func awsRestjson1_deserializeOpDocumentListAppComponentRecommendationsOutput(v **ListAppComponentRecommendationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAppVersionResourcesResolutionStatusOutput(v **DescribeAppVersionResourcesResolutionStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3262,27 +3256,58 @@ func awsRestjson1_deserializeOpDocumentListAppComponentRecommendationsOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppComponentRecommendationsOutput + var sv *DescribeAppVersionResourcesResolutionStatusOutput if *v == nil { - sv = &ListAppComponentRecommendationsOutput{} + sv = &DescribeAppVersionResourcesResolutionStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentRecommendations": - if err := awsRestjson1_deserializeDocumentComponentRecommendationList(&sv.ComponentRecommendations, value); err != nil { - return err + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) } - case "nextToken": + case "appVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AppVersion = ptr.String(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String500 to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "resolutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.ResolutionId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceResolutionStatusType to be of type string, got %T instead", value) + } + sv.Status = types.ResourceResolutionStatusType(jtv) } default: @@ -3294,14 +3319,14 @@ func awsRestjson1_deserializeOpDocumentListAppComponentRecommendationsOutput(v * return nil } -type awsRestjson1_deserializeOpListApps struct { +type awsRestjson1_deserializeOpDescribeAppVersionTemplate struct { } -func (*awsRestjson1_deserializeOpListApps) ID() string { +func (*awsRestjson1_deserializeOpDescribeAppVersionTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListApps) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAppVersionTemplate) 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) @@ -3315,9 +3340,9 @@ func (m *awsRestjson1_deserializeOpListApps) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListApps(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAppVersionTemplate(response, &metadata) } - output := &ListAppsOutput{} + output := &DescribeAppVersionTemplateOutput{} out.Result = output var buff [1024]byte @@ -3338,7 +3363,7 @@ func (m *awsRestjson1_deserializeOpListApps) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAppVersionTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3351,7 +3376,7 @@ func (m *awsRestjson1_deserializeOpListApps) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListApps(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAppVersionTemplate(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)} @@ -3398,6 +3423,9 @@ func awsRestjson1_deserializeOpErrorListApps(response *smithyhttp.Response, meta case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -3414,7 +3442,7 @@ func awsRestjson1_deserializeOpErrorListApps(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentListAppsOutput(v **ListAppsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAppVersionTemplateOutput(v **DescribeAppVersionTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3427,27 +3455,40 @@ func awsRestjson1_deserializeOpDocumentListAppsOutput(v **ListAppsOutput, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppsOutput + var sv *DescribeAppVersionTemplateOutput if *v == nil { - sv = &ListAppsOutput{} + sv = &DescribeAppVersionTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appSummaries": - if err := awsRestjson1_deserializeDocumentAppSummaryList(&sv.AppSummaries, value); err != nil { - return err + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) } - case "nextToken": + case "appTemplateBody": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected AppTemplateBody to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AppTemplateBody = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) } default: @@ -3459,14 +3500,14 @@ func awsRestjson1_deserializeOpDocumentListAppsOutput(v **ListAppsOutput, value return nil } -type awsRestjson1_deserializeOpListAppVersionResourceMappings struct { +type awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus struct { } -func (*awsRestjson1_deserializeOpListAppVersionResourceMappings) ID() string { +func (*awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAppVersionResourceMappings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) 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) @@ -3480,9 +3521,9 @@ func (m *awsRestjson1_deserializeOpListAppVersionResourceMappings) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAppVersionResourceMappings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeDraftAppVersionResourcesImportStatus(response, &metadata) } - output := &ListAppVersionResourceMappingsOutput{} + output := &DescribeDraftAppVersionResourcesImportStatusOutput{} out.Result = output var buff [1024]byte @@ -3503,7 +3544,7 @@ func (m *awsRestjson1_deserializeOpListAppVersionResourceMappings) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppVersionResourceMappingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeDraftAppVersionResourcesImportStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3516,7 +3557,7 @@ func (m *awsRestjson1_deserializeOpListAppVersionResourceMappings) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAppVersionResourceMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeDraftAppVersionResourcesImportStatus(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)} @@ -3582,7 +3623,7 @@ func awsRestjson1_deserializeOpErrorListAppVersionResourceMappings(response *smi } } -func awsRestjson1_deserializeOpDocumentListAppVersionResourceMappingsOutput(v **ListAppVersionResourceMappingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeDraftAppVersionResourcesImportStatusOutput(v **DescribeDraftAppVersionResourcesImportStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3595,46 +3636,84 @@ func awsRestjson1_deserializeOpDocumentListAppVersionResourceMappingsOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppVersionResourceMappingsOutput + var sv *DescribeDraftAppVersionResourcesImportStatusOutput if *v == nil { - sv = &ListAppVersionResourceMappingsOutput{} + sv = &DescribeDraftAppVersionResourcesImportStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "appArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AppArn = ptr.String(jtv) } - case "resourceMappings": - if err := awsRestjson1_deserializeDocumentResourceMappingList(&sv.ResourceMappings, value); err != nil { - return err + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) } - default: - _, _ = key, value + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String500 to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } - } - } - *v = sv - return nil -} + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceImportStatusType to be of type string, got %T instead", value) + } + sv.Status = types.ResourceImportStatusType(jtv) + } -type awsRestjson1_deserializeOpListAppVersionResources struct { -} + case "statusChangeTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StatusChangeTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) -func (*awsRestjson1_deserializeOpListAppVersionResources) ID() string { + default: + return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeResiliencyPolicy struct { +} + +func (*awsRestjson1_deserializeOpDescribeResiliencyPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAppVersionResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeResiliencyPolicy) 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) @@ -3648,9 +3727,9 @@ func (m *awsRestjson1_deserializeOpListAppVersionResources) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAppVersionResources(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeResiliencyPolicy(response, &metadata) } - output := &ListAppVersionResourcesOutput{} + output := &DescribeResiliencyPolicyOutput{} out.Result = output var buff [1024]byte @@ -3671,7 +3750,7 @@ func (m *awsRestjson1_deserializeOpListAppVersionResources) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeResiliencyPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3684,7 +3763,7 @@ func (m *awsRestjson1_deserializeOpListAppVersionResources) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAppVersionResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeResiliencyPolicy(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)} @@ -3728,9 +3807,6 @@ func awsRestjson1_deserializeOpErrorListAppVersionResources(response *smithyhttp case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3753,7 +3829,7 @@ func awsRestjson1_deserializeOpErrorListAppVersionResources(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(v **ListAppVersionResourcesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeResiliencyPolicyOutput(v **DescribeResiliencyPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3766,38 +3842,20 @@ func awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(v **ListApp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppVersionResourcesOutput + var sv *DescribeResiliencyPolicyOutput if *v == nil { - sv = &ListAppVersionResourcesOutput{} + sv = &DescribeResiliencyPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - 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) - } - - case "physicalResources": - if err := awsRestjson1_deserializeDocumentPhysicalResourceList(&sv.PhysicalResources, value); err != nil { + case "policy": + if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&sv.Policy, value); err != nil { return err } - case "resolutionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String255 to be of type string, got %T instead", value) - } - sv.ResolutionId = ptr.String(jtv) - } - default: _, _ = key, value @@ -3807,14 +3865,14 @@ func awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(v **ListApp return nil } -type awsRestjson1_deserializeOpListAppVersions struct { +type awsRestjson1_deserializeOpImportResourcesToDraftAppVersion struct { } -func (*awsRestjson1_deserializeOpListAppVersions) ID() string { +func (*awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) 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) @@ -3828,9 +3886,9 @@ func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAppVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorImportResourcesToDraftAppVersion(response, &metadata) } - output := &ListAppVersionsOutput{} + output := &ImportResourcesToDraftAppVersionOutput{} out.Result = output var buff [1024]byte @@ -3851,7 +3909,7 @@ func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentImportResourcesToDraftAppVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3864,7 +3922,7 @@ func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAppVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorImportResourcesToDraftAppVersion(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)} @@ -3908,12 +3966,18 @@ func awsRestjson1_deserializeOpErrorListAppVersions(response *smithyhttp.Respons case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3927,7 +3991,7 @@ func awsRestjson1_deserializeOpErrorListAppVersions(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentImportResourcesToDraftAppVersionOutput(v **ImportResourcesToDraftAppVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3940,27 +4004,50 @@ func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersions return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppVersionsOutput + var sv *ImportResourcesToDraftAppVersionOutput if *v == nil { - sv = &ListAppVersionsOutput{} + sv = &ImportResourcesToDraftAppVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appVersions": - if err := awsRestjson1_deserializeDocumentAppVersionList(&sv.AppVersions, value); err != nil { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + case "sourceArns": + if err := awsRestjson1_deserializeDocumentArnList(&sv.SourceArns, value); err != nil { return err } - case "nextToken": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceImportStatusType to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Status = types.ResourceImportStatusType(jtv) + } + + case "terraformSources": + if err := awsRestjson1_deserializeDocumentTerraformSourceList(&sv.TerraformSources, value); err != nil { + return err } default: @@ -3972,14 +4059,14 @@ func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersions return nil } -type awsRestjson1_deserializeOpListRecommendationTemplates struct { +type awsRestjson1_deserializeOpListAlarmRecommendations struct { } -func (*awsRestjson1_deserializeOpListRecommendationTemplates) ID() string { +func (*awsRestjson1_deserializeOpListAlarmRecommendations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRecommendationTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAlarmRecommendations) 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) @@ -3993,9 +4080,9 @@ func (m *awsRestjson1_deserializeOpListRecommendationTemplates) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRecommendationTemplates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAlarmRecommendations(response, &metadata) } - output := &ListRecommendationTemplatesOutput{} + output := &ListAlarmRecommendationsOutput{} out.Result = output var buff [1024]byte @@ -4016,7 +4103,7 @@ func (m *awsRestjson1_deserializeOpListRecommendationTemplates) HandleDeserializ return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRecommendationTemplatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAlarmRecommendationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4029,7 +4116,7 @@ func (m *awsRestjson1_deserializeOpListRecommendationTemplates) HandleDeserializ return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRecommendationTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAlarmRecommendations(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)} @@ -4076,6 +4163,9 @@ func awsRestjson1_deserializeOpErrorListRecommendationTemplates(response *smithy case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4092,7 +4182,7 @@ func awsRestjson1_deserializeOpErrorListRecommendationTemplates(response *smithy } } -func awsRestjson1_deserializeOpDocumentListRecommendationTemplatesOutput(v **ListRecommendationTemplatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAlarmRecommendationsOutput(v **ListAlarmRecommendationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4105,15 +4195,20 @@ func awsRestjson1_deserializeOpDocumentListRecommendationTemplatesOutput(v **Lis return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRecommendationTemplatesOutput + var sv *ListAlarmRecommendationsOutput if *v == nil { - sv = &ListRecommendationTemplatesOutput{} + sv = &ListAlarmRecommendationsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "alarmRecommendations": + if err := awsRestjson1_deserializeDocumentAlarmRecommendationList(&sv.AlarmRecommendations, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4123,11 +4218,6 @@ func awsRestjson1_deserializeOpDocumentListRecommendationTemplatesOutput(v **Lis sv.NextToken = ptr.String(jtv) } - case "recommendationTemplates": - if err := awsRestjson1_deserializeDocumentRecommendationTemplateList(&sv.RecommendationTemplates, value); err != nil { - return err - } - default: _, _ = key, value @@ -4137,14 +4227,14 @@ func awsRestjson1_deserializeOpDocumentListRecommendationTemplatesOutput(v **Lis return nil } -type awsRestjson1_deserializeOpListResiliencyPolicies struct { +type awsRestjson1_deserializeOpListAppAssessments struct { } -func (*awsRestjson1_deserializeOpListResiliencyPolicies) ID() string { +func (*awsRestjson1_deserializeOpListAppAssessments) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListResiliencyPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppAssessments) 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) @@ -4158,9 +4248,9 @@ func (m *awsRestjson1_deserializeOpListResiliencyPolicies) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListResiliencyPolicies(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppAssessments(response, &metadata) } - output := &ListResiliencyPoliciesOutput{} + output := &ListAppAssessmentsOutput{} out.Result = output var buff [1024]byte @@ -4181,7 +4271,7 @@ func (m *awsRestjson1_deserializeOpListResiliencyPolicies) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListResiliencyPoliciesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppAssessmentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4194,7 +4284,7 @@ func (m *awsRestjson1_deserializeOpListResiliencyPolicies) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListResiliencyPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAppAssessments(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)} @@ -4260,7 +4350,7 @@ func awsRestjson1_deserializeOpErrorListResiliencyPolicies(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListResiliencyPoliciesOutput(v **ListResiliencyPoliciesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppAssessmentsOutput(v **ListAppAssessmentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4273,15 +4363,20 @@ func awsRestjson1_deserializeOpDocumentListResiliencyPoliciesOutput(v **ListResi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListResiliencyPoliciesOutput + var sv *ListAppAssessmentsOutput if *v == nil { - sv = &ListResiliencyPoliciesOutput{} + sv = &ListAppAssessmentsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "assessmentSummaries": + if err := awsRestjson1_deserializeDocumentAppAssessmentSummaryList(&sv.AssessmentSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4291,11 +4386,6 @@ func awsRestjson1_deserializeOpDocumentListResiliencyPoliciesOutput(v **ListResi sv.NextToken = ptr.String(jtv) } - case "resiliencyPolicies": - if err := awsRestjson1_deserializeDocumentResiliencyPolicies(&sv.ResiliencyPolicies, value); err != nil { - return err - } - default: _, _ = key, value @@ -4305,14 +4395,14 @@ func awsRestjson1_deserializeOpDocumentListResiliencyPoliciesOutput(v **ListResi return nil } -type awsRestjson1_deserializeOpListSopRecommendations struct { +type awsRestjson1_deserializeOpListAppComponentCompliances struct { } -func (*awsRestjson1_deserializeOpListSopRecommendations) ID() string { +func (*awsRestjson1_deserializeOpListAppComponentCompliances) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSopRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppComponentCompliances) 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) @@ -4326,9 +4416,9 @@ func (m *awsRestjson1_deserializeOpListSopRecommendations) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSopRecommendations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppComponentCompliances(response, &metadata) } - output := &ListSopRecommendationsOutput{} + output := &ListAppComponentCompliancesOutput{} out.Result = output var buff [1024]byte @@ -4349,7 +4439,7 @@ func (m *awsRestjson1_deserializeOpListSopRecommendations) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSopRecommendationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppComponentCompliancesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4362,7 +4452,7 @@ func (m *awsRestjson1_deserializeOpListSopRecommendations) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSopRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAppComponentCompliances(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)} @@ -4406,9 +4496,6 @@ func awsRestjson1_deserializeOpErrorListSopRecommendations(response *smithyhttp. case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -4431,7 +4518,7 @@ func awsRestjson1_deserializeOpErrorListSopRecommendations(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListSopRecommendationsOutput(v **ListSopRecommendationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppComponentCompliancesOutput(v **ListAppComponentCompliancesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4444,15 +4531,20 @@ func awsRestjson1_deserializeOpDocumentListSopRecommendationsOutput(v **ListSopR return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSopRecommendationsOutput + var sv *ListAppComponentCompliancesOutput if *v == nil { - sv = &ListSopRecommendationsOutput{} + sv = &ListAppComponentCompliancesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "componentCompliances": + if err := awsRestjson1_deserializeDocumentComponentCompliancesList(&sv.ComponentCompliances, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4462,11 +4554,6 @@ func awsRestjson1_deserializeOpDocumentListSopRecommendationsOutput(v **ListSopR sv.NextToken = ptr.String(jtv) } - case "sopRecommendations": - if err := awsRestjson1_deserializeDocumentSopRecommendationList(&sv.SopRecommendations, value); err != nil { - return err - } - default: _, _ = key, value @@ -4476,14 +4563,14 @@ func awsRestjson1_deserializeOpDocumentListSopRecommendationsOutput(v **ListSopR return nil } -type awsRestjson1_deserializeOpListSuggestedResiliencyPolicies struct { +type awsRestjson1_deserializeOpListAppComponentRecommendations struct { } -func (*awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) ID() string { +func (*awsRestjson1_deserializeOpListAppComponentRecommendations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppComponentRecommendations) 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) @@ -4497,9 +4584,9 @@ func (m *awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSuggestedResiliencyPolicies(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppComponentRecommendations(response, &metadata) } - output := &ListSuggestedResiliencyPoliciesOutput{} + output := &ListAppComponentRecommendationsOutput{} out.Result = output var buff [1024]byte @@ -4520,7 +4607,7 @@ func (m *awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppComponentRecommendationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4533,7 +4620,7 @@ func (m *awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSuggestedResiliencyPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAppComponentRecommendations(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)} @@ -4599,7 +4686,7 @@ func awsRestjson1_deserializeOpErrorListSuggestedResiliencyPolicies(response *sm } } -func awsRestjson1_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(v **ListSuggestedResiliencyPoliciesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppComponentRecommendationsOutput(v **ListAppComponentRecommendationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4612,15 +4699,20 @@ func awsRestjson1_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSuggestedResiliencyPoliciesOutput + var sv *ListAppComponentRecommendationsOutput if *v == nil { - sv = &ListSuggestedResiliencyPoliciesOutput{} + sv = &ListAppComponentRecommendationsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "componentRecommendations": + if err := awsRestjson1_deserializeDocumentComponentRecommendationList(&sv.ComponentRecommendations, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4630,11 +4722,6 @@ func awsRestjson1_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(v * sv.NextToken = ptr.String(jtv) } - case "resiliencyPolicies": - if err := awsRestjson1_deserializeDocumentResiliencyPolicies(&sv.ResiliencyPolicies, value); err != nil { - return err - } - default: _, _ = key, value @@ -4644,14 +4731,14 @@ func awsRestjson1_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(v * return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListAppInputSources struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListAppInputSources) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppInputSources) 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) @@ -4665,9 +4752,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppInputSources(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListAppInputSourcesOutput{} out.Result = output var buff [1024]byte @@ -4688,7 +4775,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppInputSourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4701,7 +4788,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAppInputSources(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)} @@ -4767,7 +4854,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppInputSourcesOutput(v **ListAppInputSourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4780,20 +4867,29 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListAppInputSourcesOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListAppInputSourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "appInputSources": + if err := awsRestjson1_deserializeDocumentAppInputSourceList(&sv.AppInputSources, 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 @@ -4803,14 +4899,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListTestRecommendations struct { +type awsRestjson1_deserializeOpListApps struct { } -func (*awsRestjson1_deserializeOpListTestRecommendations) ID() string { +func (*awsRestjson1_deserializeOpListApps) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTestRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListApps) 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) @@ -4824,9 +4920,9 @@ func (m *awsRestjson1_deserializeOpListTestRecommendations) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTestRecommendations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListApps(response, &metadata) } - output := &ListTestRecommendationsOutput{} + output := &ListAppsOutput{} out.Result = output var buff [1024]byte @@ -4847,7 +4943,7 @@ func (m *awsRestjson1_deserializeOpListTestRecommendations) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTestRecommendationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4860,7 +4956,7 @@ func (m *awsRestjson1_deserializeOpListTestRecommendations) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTestRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListApps(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)} @@ -4904,15 +5000,9 @@ func awsRestjson1_deserializeOpErrorListTestRecommendations(response *smithyhttp case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4929,7 +5019,7 @@ func awsRestjson1_deserializeOpErrorListTestRecommendations(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListTestRecommendationsOutput(v **ListTestRecommendationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppsOutput(v **ListAppsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4942,15 +5032,20 @@ func awsRestjson1_deserializeOpDocumentListTestRecommendationsOutput(v **ListTes return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTestRecommendationsOutput + var sv *ListAppsOutput if *v == nil { - sv = &ListTestRecommendationsOutput{} + sv = &ListAppsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "appSummaries": + if err := awsRestjson1_deserializeDocumentAppSummaryList(&sv.AppSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4960,11 +5055,6 @@ func awsRestjson1_deserializeOpDocumentListTestRecommendationsOutput(v **ListTes sv.NextToken = ptr.String(jtv) } - case "testRecommendations": - if err := awsRestjson1_deserializeDocumentTestRecommendationList(&sv.TestRecommendations, value); err != nil { - return err - } - default: _, _ = key, value @@ -4974,14 +5064,14 @@ func awsRestjson1_deserializeOpDocumentListTestRecommendationsOutput(v **ListTes return nil } -type awsRestjson1_deserializeOpListUnsupportedAppVersionResources struct { +type awsRestjson1_deserializeOpListAppVersionAppComponents struct { } -func (*awsRestjson1_deserializeOpListUnsupportedAppVersionResources) ID() string { +func (*awsRestjson1_deserializeOpListAppVersionAppComponents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListUnsupportedAppVersionResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppVersionAppComponents) 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) @@ -4995,9 +5085,9 @@ func (m *awsRestjson1_deserializeOpListUnsupportedAppVersionResources) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListUnsupportedAppVersionResources(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppVersionAppComponents(response, &metadata) } - output := &ListUnsupportedAppVersionResourcesOutput{} + output := &ListAppVersionAppComponentsOutput{} out.Result = output var buff [1024]byte @@ -5018,7 +5108,7 @@ func (m *awsRestjson1_deserializeOpListUnsupportedAppVersionResources) HandleDes return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListUnsupportedAppVersionResourcesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppVersionAppComponentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5031,7 +5121,7 @@ func (m *awsRestjson1_deserializeOpListUnsupportedAppVersionResources) HandleDes return out, metadata, err } -func awsRestjson1_deserializeOpErrorListUnsupportedAppVersionResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAppVersionAppComponents(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)} @@ -5100,7 +5190,7 @@ func awsRestjson1_deserializeOpErrorListUnsupportedAppVersionResources(response } } -func awsRestjson1_deserializeOpDocumentListUnsupportedAppVersionResourcesOutput(v **ListUnsupportedAppVersionResourcesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppVersionAppComponentsOutput(v **ListAppVersionAppComponentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5113,36 +5203,45 @@ func awsRestjson1_deserializeOpDocumentListUnsupportedAppVersionResourcesOutput( return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListUnsupportedAppVersionResourcesOutput + var sv *ListAppVersionAppComponentsOutput if *v == nil { - sv = &ListUnsupportedAppVersionResourcesOutput{} + sv = &ListAppVersionAppComponentsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "appArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AppArn = ptr.String(jtv) } - case "resolutionId": + case "appComponents": + if err := awsRestjson1_deserializeDocumentAppComponentList(&sv.AppComponents, value); err != nil { + return err + } + + case "appVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) } - sv.ResolutionId = ptr.String(jtv) + sv.AppVersion = ptr.String(jtv) } - case "unsupportedResources": - if err := awsRestjson1_deserializeDocumentUnsupportedResourceList(&sv.UnsupportedResources, 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: @@ -5154,14 +5253,14 @@ func awsRestjson1_deserializeOpDocumentListUnsupportedAppVersionResourcesOutput( return nil } -type awsRestjson1_deserializeOpPublishAppVersion struct { +type awsRestjson1_deserializeOpListAppVersionResourceMappings struct { } -func (*awsRestjson1_deserializeOpPublishAppVersion) ID() string { +func (*awsRestjson1_deserializeOpListAppVersionResourceMappings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPublishAppVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppVersionResourceMappings) 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) @@ -5175,9 +5274,9 @@ func (m *awsRestjson1_deserializeOpPublishAppVersion) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPublishAppVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppVersionResourceMappings(response, &metadata) } - output := &PublishAppVersionOutput{} + output := &ListAppVersionResourceMappingsOutput{} out.Result = output var buff [1024]byte @@ -5198,7 +5297,7 @@ func (m *awsRestjson1_deserializeOpPublishAppVersion) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPublishAppVersionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppVersionResourceMappingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5211,7 +5310,7 @@ func (m *awsRestjson1_deserializeOpPublishAppVersion) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorPublishAppVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAppVersionResourceMappings(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)} @@ -5255,9 +5354,6 @@ func awsRestjson1_deserializeOpErrorPublishAppVersion(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -5280,7 +5376,7 @@ func awsRestjson1_deserializeOpErrorPublishAppVersion(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentPublishAppVersionOutput(v **PublishAppVersionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppVersionResourceMappingsOutput(v **ListAppVersionResourceMappingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5293,31 +5389,27 @@ func awsRestjson1_deserializeOpDocumentPublishAppVersionOutput(v **PublishAppVer return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PublishAppVersionOutput + var sv *ListAppVersionResourceMappingsOutput if *v == nil { - sv = &PublishAppVersionOutput{} + sv = &ListAppVersionResourceMappingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appArn": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.AppArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "appVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) - } - sv.AppVersion = ptr.String(jtv) + case "resourceMappings": + if err := awsRestjson1_deserializeDocumentResourceMappingList(&sv.ResourceMappings, value); err != nil { + return err } default: @@ -5329,14 +5421,14 @@ func awsRestjson1_deserializeOpDocumentPublishAppVersionOutput(v **PublishAppVer return nil } -type awsRestjson1_deserializeOpPutDraftAppVersionTemplate struct { +type awsRestjson1_deserializeOpListAppVersionResources struct { } -func (*awsRestjson1_deserializeOpPutDraftAppVersionTemplate) ID() string { +func (*awsRestjson1_deserializeOpListAppVersionResources) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutDraftAppVersionTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppVersionResources) 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) @@ -5350,9 +5442,9 @@ func (m *awsRestjson1_deserializeOpPutDraftAppVersionTemplate) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutDraftAppVersionTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppVersionResources(response, &metadata) } - output := &PutDraftAppVersionTemplateOutput{} + output := &ListAppVersionResourcesOutput{} out.Result = output var buff [1024]byte @@ -5373,7 +5465,7 @@ func (m *awsRestjson1_deserializeOpPutDraftAppVersionTemplate) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutDraftAppVersionTemplateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5386,7 +5478,7 @@ func (m *awsRestjson1_deserializeOpPutDraftAppVersionTemplate) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutDraftAppVersionTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAppVersionResources(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)} @@ -5455,7 +5547,7 @@ func awsRestjson1_deserializeOpErrorPutDraftAppVersionTemplate(response *smithyh } } -func awsRestjson1_deserializeOpDocumentPutDraftAppVersionTemplateOutput(v **PutDraftAppVersionTemplateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(v **ListAppVersionResourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5468,31 +5560,36 @@ func awsRestjson1_deserializeOpDocumentPutDraftAppVersionTemplateOutput(v **PutD return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutDraftAppVersionTemplateOutput + var sv *ListAppVersionResourcesOutput if *v == nil { - sv = &PutDraftAppVersionTemplateOutput{} + sv = &ListAppVersionResourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appArn": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.AppArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "appVersion": + case "physicalResources": + if err := awsRestjson1_deserializeDocumentPhysicalResourceList(&sv.PhysicalResources, value); err != nil { + return err + } + + case "resolutionId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) } - sv.AppVersion = ptr.String(jtv) + sv.ResolutionId = ptr.String(jtv) } default: @@ -5504,14 +5601,14 @@ func awsRestjson1_deserializeOpDocumentPutDraftAppVersionTemplateOutput(v **PutD return nil } -type awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings struct { +type awsRestjson1_deserializeOpListAppVersions struct { } -func (*awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) ID() string { +func (*awsRestjson1_deserializeOpListAppVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppVersions) 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) @@ -5525,9 +5622,9 @@ func (m *awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRemoveDraftAppVersionResourceMappings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppVersions(response, &metadata) } - output := &RemoveDraftAppVersionResourceMappingsOutput{} + output := &ListAppVersionsOutput{} out.Result = output var buff [1024]byte @@ -5548,7 +5645,7 @@ func (m *awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) Handle return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentRemoveDraftAppVersionResourceMappingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAppVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5561,7 +5658,7 @@ func (m *awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) Handle return out, metadata, err } -func awsRestjson1_deserializeOpErrorRemoveDraftAppVersionResourceMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAppVersions(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)} @@ -5605,18 +5702,12 @@ func awsRestjson1_deserializeOpErrorRemoveDraftAppVersionResourceMappings(respon case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -5630,7 +5721,7 @@ func awsRestjson1_deserializeOpErrorRemoveDraftAppVersionResourceMappings(respon } } -func awsRestjson1_deserializeOpDocumentRemoveDraftAppVersionResourceMappingsOutput(v **RemoveDraftAppVersionResourceMappingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5643,31 +5734,27 @@ func awsRestjson1_deserializeOpDocumentRemoveDraftAppVersionResourceMappingsOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *RemoveDraftAppVersionResourceMappingsOutput + var sv *ListAppVersionsOutput if *v == nil { - sv = &RemoveDraftAppVersionResourceMappingsOutput{} + sv = &ListAppVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.AppArn = ptr.String(jtv) + case "appVersions": + if err := awsRestjson1_deserializeDocumentAppVersionList(&sv.AppVersions, value); err != nil { + return err } - case "appVersion": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.AppVersion = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -5679,14 +5766,14 @@ func awsRestjson1_deserializeOpDocumentRemoveDraftAppVersionResourceMappingsOutp return nil } -type awsRestjson1_deserializeOpResolveAppVersionResources struct { +type awsRestjson1_deserializeOpListRecommendationTemplates struct { } -func (*awsRestjson1_deserializeOpResolveAppVersionResources) ID() string { +func (*awsRestjson1_deserializeOpListRecommendationTemplates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpResolveAppVersionResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRecommendationTemplates) 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) @@ -5700,9 +5787,9 @@ func (m *awsRestjson1_deserializeOpResolveAppVersionResources) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorResolveAppVersionResources(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRecommendationTemplates(response, &metadata) } - output := &ResolveAppVersionResourcesOutput{} + output := &ListRecommendationTemplatesOutput{} out.Result = output var buff [1024]byte @@ -5723,7 +5810,7 @@ func (m *awsRestjson1_deserializeOpResolveAppVersionResources) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentResolveAppVersionResourcesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRecommendationTemplatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5736,7 +5823,7 @@ func (m *awsRestjson1_deserializeOpResolveAppVersionResources) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorResolveAppVersionResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRecommendationTemplates(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)} @@ -5780,15 +5867,9 @@ func awsRestjson1_deserializeOpErrorResolveAppVersionResources(response *smithyh case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5805,7 +5886,7 @@ func awsRestjson1_deserializeOpErrorResolveAppVersionResources(response *smithyh } } -func awsRestjson1_deserializeOpDocumentResolveAppVersionResourcesOutput(v **ResolveAppVersionResourcesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRecommendationTemplatesOutput(v **ListRecommendationTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5818,68 +5899,2136 @@ func awsRestjson1_deserializeOpDocumentResolveAppVersionResourcesOutput(v **Reso return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ResolveAppVersionResourcesOutput + var sv *ListRecommendationTemplatesOutput if *v == nil { - sv = &ResolveAppVersionResourcesOutput{} + sv = &ListRecommendationTemplatesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appArn": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.AppArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "appVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) - } - sv.AppVersion = ptr.String(jtv) + case "recommendationTemplates": + if err := awsRestjson1_deserializeDocumentRecommendationTemplateList(&sv.RecommendationTemplates, value); err != nil { + return err } - case "resolutionId": - if value != nil { - jtv, ok := value.(string) + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListResiliencyPolicies struct { +} + +func (*awsRestjson1_deserializeOpListResiliencyPolicies) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListResiliencyPolicies) 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_deserializeOpErrorListResiliencyPolicies(response, &metadata) + } + output := &ListResiliencyPoliciesOutput{} + 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_deserializeOpDocumentListResiliencyPoliciesOutput(&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_deserializeOpErrorListResiliencyPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListResiliencyPoliciesOutput(v **ListResiliencyPoliciesOutput, 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 *ListResiliencyPoliciesOutput + if *v == nil { + sv = &ListResiliencyPoliciesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.ResolutionId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) + } + + case "resiliencyPolicies": + if err := awsRestjson1_deserializeDocumentResiliencyPolicies(&sv.ResiliencyPolicies, value); err != nil { + return err } - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceResolutionStatusType to be of type string, got %T instead", value) - } - sv.Status = types.ResourceResolutionStatusType(jtv) - } + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSopRecommendations struct { +} + +func (*awsRestjson1_deserializeOpListSopRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSopRecommendations) 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_deserializeOpErrorListSopRecommendations(response, &metadata) + } + output := &ListSopRecommendationsOutput{} + 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_deserializeOpDocumentListSopRecommendationsOutput(&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_deserializeOpErrorListSopRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSopRecommendationsOutput(v **ListSopRecommendationsOutput, 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 *ListSopRecommendationsOutput + if *v == nil { + sv = &ListSopRecommendationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + case "sopRecommendations": + if err := awsRestjson1_deserializeDocumentSopRecommendationList(&sv.SopRecommendations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSuggestedResiliencyPolicies struct { +} + +func (*awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) 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_deserializeOpErrorListSuggestedResiliencyPolicies(response, &metadata) + } + output := &ListSuggestedResiliencyPoliciesOutput{} + 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_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(&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_deserializeOpErrorListSuggestedResiliencyPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(v **ListSuggestedResiliencyPoliciesOutput, 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 *ListSuggestedResiliencyPoliciesOutput + if *v == nil { + sv = &ListSuggestedResiliencyPoliciesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + case "resiliencyPolicies": + if err := awsRestjson1_deserializeDocumentResiliencyPolicies(&sv.ResiliencyPolicies, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) 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_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + 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_deserializeOpDocumentListTagsForResourceOutput(&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_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, 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 *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTestRecommendations struct { +} + +func (*awsRestjson1_deserializeOpListTestRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTestRecommendations) 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_deserializeOpErrorListTestRecommendations(response, &metadata) + } + output := &ListTestRecommendationsOutput{} + 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_deserializeOpDocumentListTestRecommendationsOutput(&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_deserializeOpErrorListTestRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTestRecommendationsOutput(v **ListTestRecommendationsOutput, 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 *ListTestRecommendationsOutput + if *v == nil { + sv = &ListTestRecommendationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + case "testRecommendations": + if err := awsRestjson1_deserializeDocumentTestRecommendationList(&sv.TestRecommendations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListUnsupportedAppVersionResources struct { +} + +func (*awsRestjson1_deserializeOpListUnsupportedAppVersionResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListUnsupportedAppVersionResources) 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_deserializeOpErrorListUnsupportedAppVersionResources(response, &metadata) + } + output := &ListUnsupportedAppVersionResourcesOutput{} + 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_deserializeOpDocumentListUnsupportedAppVersionResourcesOutput(&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_deserializeOpErrorListUnsupportedAppVersionResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListUnsupportedAppVersionResourcesOutput(v **ListUnsupportedAppVersionResourcesOutput, 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 *ListUnsupportedAppVersionResourcesOutput + if *v == nil { + sv = &ListUnsupportedAppVersionResourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + case "resolutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.ResolutionId = ptr.String(jtv) + } + + case "unsupportedResources": + if err := awsRestjson1_deserializeDocumentUnsupportedResourceList(&sv.UnsupportedResources, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPublishAppVersion struct { +} + +func (*awsRestjson1_deserializeOpPublishAppVersion) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPublishAppVersion) 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_deserializeOpErrorPublishAppVersion(response, &metadata) + } + output := &PublishAppVersionOutput{} + 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_deserializeOpDocumentPublishAppVersionOutput(&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_deserializeOpErrorPublishAppVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPublishAppVersionOutput(v **PublishAppVersionOutput, 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 *PublishAppVersionOutput + if *v == nil { + sv = &PublishAppVersionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutDraftAppVersionTemplate struct { +} + +func (*awsRestjson1_deserializeOpPutDraftAppVersionTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutDraftAppVersionTemplate) 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_deserializeOpErrorPutDraftAppVersionTemplate(response, &metadata) + } + output := &PutDraftAppVersionTemplateOutput{} + 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_deserializeOpDocumentPutDraftAppVersionTemplateOutput(&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_deserializeOpErrorPutDraftAppVersionTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutDraftAppVersionTemplateOutput(v **PutDraftAppVersionTemplateOutput, 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 *PutDraftAppVersionTemplateOutput + if *v == nil { + sv = &PutDraftAppVersionTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings struct { +} + +func (*awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) 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_deserializeOpErrorRemoveDraftAppVersionResourceMappings(response, &metadata) + } + output := &RemoveDraftAppVersionResourceMappingsOutput{} + 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_deserializeOpDocumentRemoveDraftAppVersionResourceMappingsOutput(&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_deserializeOpErrorRemoveDraftAppVersionResourceMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRemoveDraftAppVersionResourceMappingsOutput(v **RemoveDraftAppVersionResourceMappingsOutput, 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 *RemoveDraftAppVersionResourceMappingsOutput + if *v == nil { + sv = &RemoveDraftAppVersionResourceMappingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpResolveAppVersionResources struct { +} + +func (*awsRestjson1_deserializeOpResolveAppVersionResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpResolveAppVersionResources) 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_deserializeOpErrorResolveAppVersionResources(response, &metadata) + } + output := &ResolveAppVersionResourcesOutput{} + 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_deserializeOpDocumentResolveAppVersionResourcesOutput(&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_deserializeOpErrorResolveAppVersionResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentResolveAppVersionResourcesOutput(v **ResolveAppVersionResourcesOutput, 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 *ResolveAppVersionResourcesOutput + if *v == nil { + sv = &ResolveAppVersionResourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + case "resolutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.ResolutionId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceResolutionStatusType to be of type string, got %T instead", value) + } + sv.Status = types.ResourceResolutionStatusType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartAppAssessment struct { +} + +func (*awsRestjson1_deserializeOpStartAppAssessment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartAppAssessment) 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_deserializeOpErrorStartAppAssessment(response, &metadata) + } + output := &StartAppAssessmentOutput{} + 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_deserializeOpDocumentStartAppAssessmentOutput(&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_deserializeOpErrorStartAppAssessment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartAppAssessmentOutput(v **StartAppAssessmentOutput, 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 *StartAppAssessmentOutput + if *v == nil { + sv = &StartAppAssessmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assessment": + if err := awsRestjson1_deserializeDocumentAppAssessment(&sv.Assessment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) 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_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} - default: - _, _ = key, value +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) 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_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } - *v = sv - return nil } -type awsRestjson1_deserializeOpStartAppAssessment struct { +type awsRestjson1_deserializeOpUpdateApp struct { } -func (*awsRestjson1_deserializeOpStartAppAssessment) ID() string { +func (*awsRestjson1_deserializeOpUpdateApp) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartAppAssessment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateApp) 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) @@ -5893,9 +8042,9 @@ func (m *awsRestjson1_deserializeOpStartAppAssessment) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartAppAssessment(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateApp(response, &metadata) } - output := &StartAppAssessmentOutput{} + output := &UpdateAppOutput{} out.Result = output var buff [1024]byte @@ -5916,7 +8065,7 @@ func (m *awsRestjson1_deserializeOpStartAppAssessment) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartAppAssessmentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5929,7 +8078,7 @@ func (m *awsRestjson1_deserializeOpStartAppAssessment) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartAppAssessment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateApp(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)} @@ -5982,9 +8131,6 @@ func awsRestjson1_deserializeOpErrorStartAppAssessment(response *smithyhttp.Resp case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -6001,7 +8147,7 @@ func awsRestjson1_deserializeOpErrorStartAppAssessment(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentStartAppAssessmentOutput(v **StartAppAssessmentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateAppOutput(v **UpdateAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6014,17 +8160,17 @@ func awsRestjson1_deserializeOpDocumentStartAppAssessmentOutput(v **StartAppAsse return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartAppAssessmentOutput + var sv *UpdateAppOutput if *v == nil { - sv = &StartAppAssessmentOutput{} + sv = &UpdateAppOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assessment": - if err := awsRestjson1_deserializeDocumentAppAssessment(&sv.Assessment, value); err != nil { + case "app": + if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil { return err } @@ -6037,14 +8183,14 @@ func awsRestjson1_deserializeOpDocumentStartAppAssessmentOutput(v **StartAppAsse return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpUpdateAppVersion struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpUpdateAppVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateAppVersion) 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) @@ -6058,15 +8204,43 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAppVersion(response, &metadata) } - output := &TagResourceOutput{} + output := &UpdateAppVersionOutput{} 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_deserializeOpDocumentUpdateAppVersionOutput(&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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateAppVersion(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)} @@ -6110,6 +8284,9 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -6132,14 +8309,68 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentUpdateAppVersionOutput(v **UpdateAppVersionOutput, 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 *UpdateAppVersionOutput + if *v == nil { + sv = &UpdateAppVersionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalInfo": + if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil { + return err + } + + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpUpdateAppVersionAppComponent struct { +} + +func (*awsRestjson1_deserializeOpUpdateAppVersionAppComponent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateAppVersionAppComponent) 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) @@ -6153,15 +8384,43 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAppVersionAppComponent(response, &metadata) } - output := &UntagResourceOutput{} + output := &UpdateAppVersionAppComponentOutput{} 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_deserializeOpDocumentUpdateAppVersionAppComponentOutput(&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_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateAppVersionAppComponent(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)} @@ -6205,6 +8464,9 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -6227,14 +8489,68 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateApp struct { +func awsRestjson1_deserializeOpDocumentUpdateAppVersionAppComponentOutput(v **UpdateAppVersionAppComponentOutput, 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 *UpdateAppVersionAppComponentOutput + if *v == nil { + sv = &UpdateAppVersionAppComponentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appComponent": + if err := awsRestjson1_deserializeDocumentAppComponent(&sv.AppComponent, value); err != nil { + return err + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateApp) ID() string { +type awsRestjson1_deserializeOpUpdateAppVersionResource struct { +} + +func (*awsRestjson1_deserializeOpUpdateAppVersionResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateAppVersionResource) 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) @@ -6248,9 +8564,9 @@ func (m *awsRestjson1_deserializeOpUpdateApp) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateApp(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAppVersionResource(response, &metadata) } - output := &UpdateAppOutput{} + output := &UpdateAppVersionResourceOutput{} out.Result = output var buff [1024]byte @@ -6271,7 +8587,7 @@ func (m *awsRestjson1_deserializeOpUpdateApp) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAppOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateAppVersionResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6284,7 +8600,7 @@ func (m *awsRestjson1_deserializeOpUpdateApp) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateAppVersionResource(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)} @@ -6337,6 +8653,9 @@ func awsRestjson1_deserializeOpErrorUpdateApp(response *smithyhttp.Response, met case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -6353,7 +8672,7 @@ func awsRestjson1_deserializeOpErrorUpdateApp(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentUpdateAppOutput(v **UpdateAppOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateAppVersionResourceOutput(v **UpdateAppVersionResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6366,17 +8685,35 @@ func awsRestjson1_deserializeOpDocumentUpdateAppOutput(v **UpdateAppOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAppOutput + var sv *UpdateAppVersionResourceOutput if *v == nil { - sv = &UpdateAppOutput{} + sv = &UpdateAppVersionResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "app": - if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + case "physicalResource": + if err := awsRestjson1_deserializeDocumentPhysicalResource(&sv.PhysicalResource, value); err != nil { return err } @@ -6843,6 +9180,76 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } +func awsRestjson1_deserializeDocumentAdditionalInfoMap(v *map[string][]string, 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 mv map[string][]string + if *v == nil { + mv = map[string][]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal []string + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentAdditionalInfoValueList(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentAdditionalInfoValueList(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 String1024 to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAlarmRecommendation(v **types.AlarmRecommendation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7588,6 +9995,20 @@ func awsRestjson1_deserializeDocumentAppComponent(v **types.AppComponent, value for key, value := range shape { switch key { + case "additionalInfo": + if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + case "name": if value != nil { jtv, ok := value.(string) @@ -7722,6 +10143,116 @@ func awsRestjson1_deserializeDocumentAppComponentList(v *[]types.AppComponent, v return nil } +func awsRestjson1_deserializeDocumentAppInputSource(v **types.AppInputSource, 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.AppInputSource + if *v == nil { + sv = &types.AppInputSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "importType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceMappingType to be of type string, got %T instead", value) + } + sv.ImportType = types.ResourceMappingType(jtv) + } + + case "resourceCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ResourceCount = int32(i64) + } + + case "sourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.SourceArn = ptr.String(jtv) + } + + case "sourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.SourceName = ptr.String(jtv) + } + + case "terraformSource": + if err := awsRestjson1_deserializeDocumentTerraformSource(&sv.TerraformSource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAppInputSourceList(v *[]types.AppInputSource, 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.AppInputSource + if *v == nil { + cv = []types.AppInputSource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AppInputSource + destAddr := &col + if err := awsRestjson1_deserializeDocumentAppInputSource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAppSummary(v **types.AppSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8857,11 +11388,25 @@ func awsRestjson1_deserializeDocumentPhysicalResource(v **types.PhysicalResource for key, value := range shape { switch key { + case "additionalInfo": + if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil { + return err + } + case "appComponents": if err := awsRestjson1_deserializeDocumentAppComponentList(&sv.AppComponents, value); err != nil { return err } + case "excluded": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value) + } + sv.Excluded = ptr.Bool(jtv) + } + case "logicalResourceId": if err := awsRestjson1_deserializeDocumentLogicalResourceId(&sv.LogicalResourceId, value); err != nil { return err diff --git a/service/resiliencehub/generated.json b/service/resiliencehub/generated.json index 3c3568058d6..382aaeefbc1 100644 --- a/service/resiliencehub/generated.json +++ b/service/resiliencehub/generated.json @@ -10,14 +10,22 @@ "api_client_test.go", "api_op_AddDraftAppVersionResourceMappings.go", "api_op_CreateApp.go", + "api_op_CreateAppVersionAppComponent.go", + "api_op_CreateAppVersionResource.go", "api_op_CreateRecommendationTemplate.go", "api_op_CreateResiliencyPolicy.go", "api_op_DeleteApp.go", "api_op_DeleteAppAssessment.go", + "api_op_DeleteAppInputSource.go", + "api_op_DeleteAppVersionAppComponent.go", + "api_op_DeleteAppVersionResource.go", "api_op_DeleteRecommendationTemplate.go", "api_op_DeleteResiliencyPolicy.go", "api_op_DescribeApp.go", "api_op_DescribeAppAssessment.go", + "api_op_DescribeAppVersion.go", + "api_op_DescribeAppVersionAppComponent.go", + "api_op_DescribeAppVersionResource.go", "api_op_DescribeAppVersionResourcesResolutionStatus.go", "api_op_DescribeAppVersionTemplate.go", "api_op_DescribeDraftAppVersionResourcesImportStatus.go", @@ -27,6 +35,8 @@ "api_op_ListAppAssessments.go", "api_op_ListAppComponentCompliances.go", "api_op_ListAppComponentRecommendations.go", + "api_op_ListAppInputSources.go", + "api_op_ListAppVersionAppComponents.go", "api_op_ListAppVersionResourceMappings.go", "api_op_ListAppVersionResources.go", "api_op_ListAppVersions.go", @@ -46,6 +56,9 @@ "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateApp.go", + "api_op_UpdateAppVersion.go", + "api_op_UpdateAppVersionAppComponent.go", + "api_op_UpdateAppVersionResource.go", "api_op_UpdateResiliencyPolicy.go", "deserializers.go", "doc.go", diff --git a/service/resiliencehub/serializers.go b/service/resiliencehub/serializers.go index 0eb9c694b7d..edf5cccf7d5 100644 --- a/service/resiliencehub/serializers.go +++ b/service/resiliencehub/serializers.go @@ -184,6 +184,220 @@ func awsRestjson1_serializeOpDocumentCreateAppInput(v *CreateAppInput, value smi return nil } +type awsRestjson1_serializeOpCreateAppVersionAppComponent struct { +} + +func (*awsRestjson1_serializeOpCreateAppVersionAppComponent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateAppVersionAppComponent) 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.(*CreateAppVersionAppComponentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/create-app-version-app-component") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateAppVersionAppComponentInput(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_serializeOpHttpBindingsCreateAppVersionAppComponentInput(v *CreateAppVersionAppComponentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateAppVersionAppComponentInput(v *CreateAppVersionAppComponentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalInfo != nil { + ok := object.Key("additionalInfo") + if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil { + return err + } + } + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Type != nil { + ok := object.Key("type") + ok.String(*v.Type) + } + + return nil +} + +type awsRestjson1_serializeOpCreateAppVersionResource struct { +} + +func (*awsRestjson1_serializeOpCreateAppVersionResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateAppVersionResource) 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.(*CreateAppVersionResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/create-app-version-resource") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateAppVersionResourceInput(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_serializeOpHttpBindingsCreateAppVersionResourceInput(v *CreateAppVersionResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateAppVersionResourceInput(v *CreateAppVersionResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalInfo != nil { + ok := object.Key("additionalInfo") + if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil { + return err + } + } + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.AppComponents != nil { + ok := object.Key("appComponents") + if err := awsRestjson1_serializeDocumentAppComponentNameList(v.AppComponents, ok); err != nil { + return err + } + } + + if v.AwsAccountId != nil { + ok := object.Key("awsAccountId") + ok.String(*v.AwsAccountId) + } + + if v.AwsRegion != nil { + ok := object.Key("awsRegion") + ok.String(*v.AwsRegion) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.LogicalResourceId != nil { + ok := object.Key("logicalResourceId") + if err := awsRestjson1_serializeDocumentLogicalResourceId(v.LogicalResourceId, ok); err != nil { + return err + } + } + + if v.PhysicalResourceId != nil { + ok := object.Key("physicalResourceId") + ok.String(*v.PhysicalResourceId) + } + + if v.ResourceName != nil { + ok := object.Key("resourceName") + ok.String(*v.ResourceName) + } + + if v.ResourceType != nil { + ok := object.Key("resourceType") + ok.String(*v.ResourceType) + } + + return nil +} + type awsRestjson1_serializeOpCreateRecommendationTemplate struct { } @@ -546,14 +760,14 @@ func awsRestjson1_serializeOpDocumentDeleteAppAssessmentInput(v *DeleteAppAssess return nil } -type awsRestjson1_serializeOpDeleteRecommendationTemplate struct { +type awsRestjson1_serializeOpDeleteAppInputSource struct { } -func (*awsRestjson1_serializeOpDeleteRecommendationTemplate) ID() string { +func (*awsRestjson1_serializeOpDeleteAppInputSource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteRecommendationTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteAppInputSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -561,13 +775,13 @@ func (m *awsRestjson1_serializeOpDeleteRecommendationTemplate) HandleSerialize(c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteRecommendationTemplateInput) + input, ok := in.Parameters.(*DeleteAppInputSourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/delete-recommendation-template") + opPath, opQuery := httpbinding.SplitURI("/delete-app-input-source") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -579,7 +793,7 @@ func (m *awsRestjson1_serializeOpDeleteRecommendationTemplate) HandleSerialize(c restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDeleteRecommendationTemplateInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDeleteAppInputSourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -594,7 +808,7 @@ func (m *awsRestjson1_serializeOpDeleteRecommendationTemplate) HandleSerialize(c return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteRecommendationTemplateInput(v *DeleteRecommendationTemplateInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteAppInputSourceInput(v *DeleteAppInputSourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -602,31 +816,43 @@ func awsRestjson1_serializeOpHttpBindingsDeleteRecommendationTemplateInput(v *De return nil } -func awsRestjson1_serializeOpDocumentDeleteRecommendationTemplateInput(v *DeleteRecommendationTemplateInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDeleteAppInputSourceInput(v *DeleteAppInputSourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } - if v.RecommendationTemplateArn != nil { - ok := object.Key("recommendationTemplateArn") - ok.String(*v.RecommendationTemplateArn) + if v.SourceArn != nil { + ok := object.Key("sourceArn") + ok.String(*v.SourceArn) + } + + if v.TerraformSource != nil { + ok := object.Key("terraformSource") + if err := awsRestjson1_serializeDocumentTerraformSource(v.TerraformSource, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpDeleteResiliencyPolicy struct { +type awsRestjson1_serializeOpDeleteAppVersionAppComponent struct { } -func (*awsRestjson1_serializeOpDeleteResiliencyPolicy) ID() string { +func (*awsRestjson1_serializeOpDeleteAppVersionAppComponent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteResiliencyPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteAppVersionAppComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -634,13 +860,13 @@ func (m *awsRestjson1_serializeOpDeleteResiliencyPolicy) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteResiliencyPolicyInput) + input, ok := in.Parameters.(*DeleteAppVersionAppComponentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/delete-resiliency-policy") + opPath, opQuery := httpbinding.SplitURI("/delete-app-version-app-component") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -652,7 +878,7 @@ func (m *awsRestjson1_serializeOpDeleteResiliencyPolicy) HandleSerialize(ctx con restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDeleteResiliencyPolicyInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDeleteAppVersionAppComponentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -667,7 +893,7 @@ func (m *awsRestjson1_serializeOpDeleteResiliencyPolicy) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteResiliencyPolicyInput(v *DeleteResiliencyPolicyInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteAppVersionAppComponentInput(v *DeleteAppVersionAppComponentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -675,31 +901,36 @@ func awsRestjson1_serializeOpHttpBindingsDeleteResiliencyPolicyInput(v *DeleteRe return nil } -func awsRestjson1_serializeOpDocumentDeleteResiliencyPolicyInput(v *DeleteResiliencyPolicyInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDeleteAppVersionAppComponentInput(v *DeleteAppVersionAppComponentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } - if v.PolicyArn != nil { - ok := object.Key("policyArn") - ok.String(*v.PolicyArn) + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) } return nil } -type awsRestjson1_serializeOpDescribeApp struct { +type awsRestjson1_serializeOpDeleteAppVersionResource struct { } -func (*awsRestjson1_serializeOpDescribeApp) ID() string { +func (*awsRestjson1_serializeOpDeleteAppVersionResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteAppVersionResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -707,13 +938,13 @@ func (m *awsRestjson1_serializeOpDescribeApp) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeAppInput) + input, ok := in.Parameters.(*DeleteAppVersionResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/describe-app") + opPath, opQuery := httpbinding.SplitURI("/delete-app-version-resource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -725,7 +956,7 @@ func (m *awsRestjson1_serializeOpDescribeApp) HandleSerialize(ctx context.Contex restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDescribeAppInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDeleteAppVersionResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -740,7 +971,7 @@ func (m *awsRestjson1_serializeOpDescribeApp) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeAppInput(v *DescribeAppInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteAppVersionResourceInput(v *DeleteAppVersionResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -748,7 +979,7 @@ func awsRestjson1_serializeOpHttpBindingsDescribeAppInput(v *DescribeAppInput, e return nil } -func awsRestjson1_serializeOpDocumentDescribeAppInput(v *DescribeAppInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDeleteAppVersionResourceInput(v *DeleteAppVersionResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -757,17 +988,49 @@ func awsRestjson1_serializeOpDocumentDescribeAppInput(v *DescribeAppInput, value ok.String(*v.AppArn) } + if v.AwsAccountId != nil { + ok := object.Key("awsAccountId") + ok.String(*v.AwsAccountId) + } + + if v.AwsRegion != nil { + ok := object.Key("awsRegion") + ok.String(*v.AwsRegion) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.LogicalResourceId != nil { + ok := object.Key("logicalResourceId") + if err := awsRestjson1_serializeDocumentLogicalResourceId(v.LogicalResourceId, ok); err != nil { + return err + } + } + + if v.PhysicalResourceId != nil { + ok := object.Key("physicalResourceId") + ok.String(*v.PhysicalResourceId) + } + + if v.ResourceName != nil { + ok := object.Key("resourceName") + ok.String(*v.ResourceName) + } + return nil } -type awsRestjson1_serializeOpDescribeAppAssessment struct { +type awsRestjson1_serializeOpDeleteRecommendationTemplate struct { } -func (*awsRestjson1_serializeOpDescribeAppAssessment) ID() string { +func (*awsRestjson1_serializeOpDeleteRecommendationTemplate) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeAppAssessment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteRecommendationTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -775,13 +1038,13 @@ func (m *awsRestjson1_serializeOpDescribeAppAssessment) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeAppAssessmentInput) + input, ok := in.Parameters.(*DeleteRecommendationTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/describe-app-assessment") + opPath, opQuery := httpbinding.SplitURI("/delete-recommendation-template") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -793,7 +1056,7 @@ func (m *awsRestjson1_serializeOpDescribeAppAssessment) HandleSerialize(ctx cont restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDescribeAppAssessmentInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDeleteRecommendationTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -808,7 +1071,7 @@ func (m *awsRestjson1_serializeOpDescribeAppAssessment) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeAppAssessmentInput(v *DescribeAppAssessmentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteRecommendationTemplateInput(v *DeleteRecommendationTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -816,26 +1079,31 @@ func awsRestjson1_serializeOpHttpBindingsDescribeAppAssessmentInput(v *DescribeA return nil } -func awsRestjson1_serializeOpDocumentDescribeAppAssessmentInput(v *DescribeAppAssessmentInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDeleteRecommendationTemplateInput(v *DeleteRecommendationTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AssessmentArn != nil { - ok := object.Key("assessmentArn") - ok.String(*v.AssessmentArn) + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.RecommendationTemplateArn != nil { + ok := object.Key("recommendationTemplateArn") + ok.String(*v.RecommendationTemplateArn) } return nil } -type awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus struct { +type awsRestjson1_serializeOpDeleteResiliencyPolicy struct { } -func (*awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) ID() string { +func (*awsRestjson1_serializeOpDeleteResiliencyPolicy) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteResiliencyPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -843,13 +1111,13 @@ func (m *awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) Ha return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeAppVersionResourcesResolutionStatusInput) + input, ok := in.Parameters.(*DeleteResiliencyPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/describe-app-version-resources-resolution-status") + opPath, opQuery := httpbinding.SplitURI("/delete-resiliency-policy") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -861,7 +1129,7 @@ func (m *awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) Ha restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDescribeAppVersionResourcesResolutionStatusInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDeleteResiliencyPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -876,7 +1144,7 @@ func (m *awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) Ha return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionResourcesResolutionStatusInput(v *DescribeAppVersionResourcesResolutionStatusInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteResiliencyPolicyInput(v *DeleteResiliencyPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -884,36 +1152,31 @@ func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionResourcesResolutionSt return nil } -func awsRestjson1_serializeOpDocumentDescribeAppVersionResourcesResolutionStatusInput(v *DescribeAppVersionResourcesResolutionStatusInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDeleteResiliencyPolicyInput(v *DeleteResiliencyPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AppArn != nil { - ok := object.Key("appArn") - ok.String(*v.AppArn) - } - - if v.AppVersion != nil { - ok := object.Key("appVersion") - ok.String(*v.AppVersion) + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) } - if v.ResolutionId != nil { - ok := object.Key("resolutionId") - ok.String(*v.ResolutionId) + if v.PolicyArn != nil { + ok := object.Key("policyArn") + ok.String(*v.PolicyArn) } return nil } -type awsRestjson1_serializeOpDescribeAppVersionTemplate struct { +type awsRestjson1_serializeOpDescribeApp struct { } -func (*awsRestjson1_serializeOpDescribeAppVersionTemplate) ID() string { +func (*awsRestjson1_serializeOpDescribeApp) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeAppVersionTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -921,13 +1184,13 @@ func (m *awsRestjson1_serializeOpDescribeAppVersionTemplate) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeAppVersionTemplateInput) + input, ok := in.Parameters.(*DescribeAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/describe-app-version-template") + opPath, opQuery := httpbinding.SplitURI("/describe-app") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -939,7 +1202,7 @@ func (m *awsRestjson1_serializeOpDescribeAppVersionTemplate) HandleSerialize(ctx restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDescribeAppVersionTemplateInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDescribeAppInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -954,7 +1217,7 @@ func (m *awsRestjson1_serializeOpDescribeAppVersionTemplate) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionTemplateInput(v *DescribeAppVersionTemplateInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAppInput(v *DescribeAppInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -962,7 +1225,7 @@ func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionTemplateInput(v *Desc return nil } -func awsRestjson1_serializeOpDocumentDescribeAppVersionTemplateInput(v *DescribeAppVersionTemplateInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDescribeAppInput(v *DescribeAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -971,22 +1234,17 @@ func awsRestjson1_serializeOpDocumentDescribeAppVersionTemplateInput(v *Describe ok.String(*v.AppArn) } - if v.AppVersion != nil { - ok := object.Key("appVersion") - ok.String(*v.AppVersion) - } - return nil } -type awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus struct { +type awsRestjson1_serializeOpDescribeAppAssessment struct { } -func (*awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) ID() string { +func (*awsRestjson1_serializeOpDescribeAppAssessment) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAppAssessment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -994,13 +1252,13 @@ func (m *awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) H return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeDraftAppVersionResourcesImportStatusInput) + input, ok := in.Parameters.(*DescribeAppAssessmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/describe-draft-app-version-resources-import-status") + opPath, opQuery := httpbinding.SplitURI("/describe-app-assessment") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1012,7 +1270,7 @@ func (m *awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) H restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDescribeDraftAppVersionResourcesImportStatusInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDescribeAppAssessmentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1027,7 +1285,7 @@ func (m *awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) H return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeDraftAppVersionResourcesImportStatusInput(v *DescribeDraftAppVersionResourcesImportStatusInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAppAssessmentInput(v *DescribeAppAssessmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1035,26 +1293,26 @@ func awsRestjson1_serializeOpHttpBindingsDescribeDraftAppVersionResourcesImportS return nil } -func awsRestjson1_serializeOpDocumentDescribeDraftAppVersionResourcesImportStatusInput(v *DescribeDraftAppVersionResourcesImportStatusInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDescribeAppAssessmentInput(v *DescribeAppAssessmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AppArn != nil { - ok := object.Key("appArn") - ok.String(*v.AppArn) + if v.AssessmentArn != nil { + ok := object.Key("assessmentArn") + ok.String(*v.AssessmentArn) } return nil } -type awsRestjson1_serializeOpDescribeResiliencyPolicy struct { +type awsRestjson1_serializeOpDescribeAppVersion struct { } -func (*awsRestjson1_serializeOpDescribeResiliencyPolicy) ID() string { +func (*awsRestjson1_serializeOpDescribeAppVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeResiliencyPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAppVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1062,13 +1320,13 @@ func (m *awsRestjson1_serializeOpDescribeResiliencyPolicy) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeResiliencyPolicyInput) + input, ok := in.Parameters.(*DescribeAppVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/describe-resiliency-policy") + opPath, opQuery := httpbinding.SplitURI("/describe-app-version") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1080,7 +1338,7 @@ func (m *awsRestjson1_serializeOpDescribeResiliencyPolicy) HandleSerialize(ctx c restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDescribeResiliencyPolicyInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDescribeAppVersionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1095,7 +1353,7 @@ func (m *awsRestjson1_serializeOpDescribeResiliencyPolicy) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeResiliencyPolicyInput(v *DescribeResiliencyPolicyInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionInput(v *DescribeAppVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1103,26 +1361,31 @@ func awsRestjson1_serializeOpHttpBindingsDescribeResiliencyPolicyInput(v *Descri return nil } -func awsRestjson1_serializeOpDocumentDescribeResiliencyPolicyInput(v *DescribeResiliencyPolicyInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDescribeAppVersionInput(v *DescribeAppVersionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.PolicyArn != nil { - ok := object.Key("policyArn") - ok.String(*v.PolicyArn) + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) } return nil } -type awsRestjson1_serializeOpImportResourcesToDraftAppVersion struct { +type awsRestjson1_serializeOpDescribeAppVersionAppComponent struct { } -func (*awsRestjson1_serializeOpImportResourcesToDraftAppVersion) ID() string { +func (*awsRestjson1_serializeOpDescribeAppVersionAppComponent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpImportResourcesToDraftAppVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAppVersionAppComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1130,13 +1393,13 @@ func (m *awsRestjson1_serializeOpImportResourcesToDraftAppVersion) HandleSeriali return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ImportResourcesToDraftAppVersionInput) + input, ok := in.Parameters.(*DescribeAppVersionAppComponentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/import-resources-to-draft-app-version") + opPath, opQuery := httpbinding.SplitURI("/describe-app-version-app-component") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1148,7 +1411,7 @@ func (m *awsRestjson1_serializeOpImportResourcesToDraftAppVersion) HandleSeriali restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentImportResourcesToDraftAppVersionInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDescribeAppVersionAppComponentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1163,7 +1426,7 @@ func (m *awsRestjson1_serializeOpImportResourcesToDraftAppVersion) HandleSeriali return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsImportResourcesToDraftAppVersionInput(v *ImportResourcesToDraftAppVersionInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionAppComponentInput(v *DescribeAppVersionAppComponentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1171,7 +1434,7 @@ func awsRestjson1_serializeOpHttpBindingsImportResourcesToDraftAppVersionInput(v return nil } -func awsRestjson1_serializeOpDocumentImportResourcesToDraftAppVersionInput(v *ImportResourcesToDraftAppVersionInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDescribeAppVersionAppComponentInput(v *DescribeAppVersionAppComponentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1180,31 +1443,27 @@ func awsRestjson1_serializeOpDocumentImportResourcesToDraftAppVersionInput(v *Im ok.String(*v.AppArn) } - if v.SourceArns != nil { - ok := object.Key("sourceArns") - if err := awsRestjson1_serializeDocumentArnList(v.SourceArns, ok); err != nil { - return err - } + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) } - if v.TerraformSources != nil { - ok := object.Key("terraformSources") - if err := awsRestjson1_serializeDocumentTerraformSourceList(v.TerraformSources, ok); err != nil { - return err - } + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) } return nil } -type awsRestjson1_serializeOpListAlarmRecommendations struct { +type awsRestjson1_serializeOpDescribeAppVersionResource struct { } -func (*awsRestjson1_serializeOpListAlarmRecommendations) ID() string { +func (*awsRestjson1_serializeOpDescribeAppVersionResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAlarmRecommendations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAppVersionResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1212,13 +1471,13 @@ func (m *awsRestjson1_serializeOpListAlarmRecommendations) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAlarmRecommendationsInput) + input, ok := in.Parameters.(*DescribeAppVersionResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/list-alarm-recommendations") + opPath, opQuery := httpbinding.SplitURI("/describe-app-version-resource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1230,7 +1489,7 @@ func (m *awsRestjson1_serializeOpListAlarmRecommendations) HandleSerialize(ctx c restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListAlarmRecommendationsInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDescribeAppVersionResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1245,7 +1504,7 @@ func (m *awsRestjson1_serializeOpListAlarmRecommendations) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAlarmRecommendationsInput(v *ListAlarmRecommendationsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionResourceInput(v *DescribeAppVersionResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1253,36 +1512,58 @@ func awsRestjson1_serializeOpHttpBindingsListAlarmRecommendationsInput(v *ListAl return nil } -func awsRestjson1_serializeOpDocumentListAlarmRecommendationsInput(v *ListAlarmRecommendationsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDescribeAppVersionResourceInput(v *DescribeAppVersionResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AssessmentArn != nil { - ok := object.Key("assessmentArn") - ok.String(*v.AssessmentArn) + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) } - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) } - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) + if v.AwsAccountId != nil { + ok := object.Key("awsAccountId") + ok.String(*v.AwsAccountId) + } + + if v.AwsRegion != nil { + ok := object.Key("awsRegion") + ok.String(*v.AwsRegion) + } + + if v.LogicalResourceId != nil { + ok := object.Key("logicalResourceId") + if err := awsRestjson1_serializeDocumentLogicalResourceId(v.LogicalResourceId, ok); err != nil { + return err + } + } + + if v.PhysicalResourceId != nil { + ok := object.Key("physicalResourceId") + ok.String(*v.PhysicalResourceId) + } + + if v.ResourceName != nil { + ok := object.Key("resourceName") + ok.String(*v.ResourceName) } return nil } -type awsRestjson1_serializeOpListAppAssessments struct { +type awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus struct { } -func (*awsRestjson1_serializeOpListAppAssessments) ID() string { +func (*awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAppAssessments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1290,22 +1571,29 @@ func (m *awsRestjson1_serializeOpListAppAssessments) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAppAssessmentsInput) + input, ok := in.Parameters.(*DescribeAppVersionResourcesResolutionStatusInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/list-app-assessments") + opPath, opQuery := httpbinding.SplitURI("/describe-app-version-resources-resolution-status") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAppAssessmentsInput(input, restEncoder); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDescribeAppVersionResourcesResolutionStatusInput(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} } @@ -1316,56 +1604,44 @@ func (m *awsRestjson1_serializeOpListAppAssessments) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAppAssessmentsInput(v *ListAppAssessmentsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionResourcesResolutionStatusInput(v *DescribeAppVersionResourcesResolutionStatusInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AppArn != nil { - encoder.SetQuery("appArn").String(*v.AppArn) - } - - if v.AssessmentName != nil { - encoder.SetQuery("assessmentName").String(*v.AssessmentName) - } - - if v.AssessmentStatus != nil { - for i := range v.AssessmentStatus { - encoder.AddQuery("assessmentStatus").String(string(v.AssessmentStatus[i])) - } - } - - if len(v.ComplianceStatus) > 0 { - encoder.SetQuery("complianceStatus").String(string(v.ComplianceStatus)) - } + return nil +} - if len(v.Invoker) > 0 { - encoder.SetQuery("invoker").String(string(v.Invoker)) - } +func awsRestjson1_serializeOpDocumentDescribeAppVersionResourcesResolutionStatusInput(v *DescribeAppVersionResourcesResolutionStatusInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) } - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) } - if v.ReverseOrder != nil { - encoder.SetQuery("reverseOrder").Boolean(*v.ReverseOrder) + if v.ResolutionId != nil { + ok := object.Key("resolutionId") + ok.String(*v.ResolutionId) } return nil } -type awsRestjson1_serializeOpListAppComponentCompliances struct { +type awsRestjson1_serializeOpDescribeAppVersionTemplate struct { } -func (*awsRestjson1_serializeOpListAppComponentCompliances) ID() string { +func (*awsRestjson1_serializeOpDescribeAppVersionTemplate) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAppComponentCompliances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAppVersionTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1373,13 +1649,13 @@ func (m *awsRestjson1_serializeOpListAppComponentCompliances) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAppComponentCompliancesInput) + input, ok := in.Parameters.(*DescribeAppVersionTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/list-app-component-compliances") + opPath, opQuery := httpbinding.SplitURI("/describe-app-version-template") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1391,7 +1667,7 @@ func (m *awsRestjson1_serializeOpListAppComponentCompliances) HandleSerialize(ct restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListAppComponentCompliancesInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDescribeAppVersionTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1406,7 +1682,464 @@ func (m *awsRestjson1_serializeOpListAppComponentCompliances) HandleSerialize(ct return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAppComponentCompliancesInput(v *ListAppComponentCompliancesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAppVersionTemplateInput(v *DescribeAppVersionTemplateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDescribeAppVersionTemplateInput(v *DescribeAppVersionTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) + } + + return nil +} + +type awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus struct { +} + +func (*awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) 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.(*DescribeDraftAppVersionResourcesImportStatusInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/describe-draft-app-version-resources-import-status") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDescribeDraftAppVersionResourcesImportStatusInput(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_serializeOpHttpBindingsDescribeDraftAppVersionResourcesImportStatusInput(v *DescribeDraftAppVersionResourcesImportStatusInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDescribeDraftAppVersionResourcesImportStatusInput(v *DescribeDraftAppVersionResourcesImportStatusInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + return nil +} + +type awsRestjson1_serializeOpDescribeResiliencyPolicy struct { +} + +func (*awsRestjson1_serializeOpDescribeResiliencyPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeResiliencyPolicy) 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.(*DescribeResiliencyPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/describe-resiliency-policy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDescribeResiliencyPolicyInput(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_serializeOpHttpBindingsDescribeResiliencyPolicyInput(v *DescribeResiliencyPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDescribeResiliencyPolicyInput(v *DescribeResiliencyPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyArn != nil { + ok := object.Key("policyArn") + ok.String(*v.PolicyArn) + } + + return nil +} + +type awsRestjson1_serializeOpImportResourcesToDraftAppVersion struct { +} + +func (*awsRestjson1_serializeOpImportResourcesToDraftAppVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpImportResourcesToDraftAppVersion) 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.(*ImportResourcesToDraftAppVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/import-resources-to-draft-app-version") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentImportResourcesToDraftAppVersionInput(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_serializeOpHttpBindingsImportResourcesToDraftAppVersionInput(v *ImportResourcesToDraftAppVersionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentImportResourcesToDraftAppVersionInput(v *ImportResourcesToDraftAppVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if len(v.ImportStrategy) > 0 { + ok := object.Key("importStrategy") + ok.String(string(v.ImportStrategy)) + } + + if v.SourceArns != nil { + ok := object.Key("sourceArns") + if err := awsRestjson1_serializeDocumentArnList(v.SourceArns, ok); err != nil { + return err + } + } + + if v.TerraformSources != nil { + ok := object.Key("terraformSources") + if err := awsRestjson1_serializeDocumentTerraformSourceList(v.TerraformSources, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListAlarmRecommendations struct { +} + +func (*awsRestjson1_serializeOpListAlarmRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAlarmRecommendations) 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.(*ListAlarmRecommendationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-alarm-recommendations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListAlarmRecommendationsInput(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_serializeOpHttpBindingsListAlarmRecommendationsInput(v *ListAlarmRecommendationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListAlarmRecommendationsInput(v *ListAlarmRecommendationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssessmentArn != nil { + ok := object.Key("assessmentArn") + ok.String(*v.AssessmentArn) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListAppAssessments struct { +} + +func (*awsRestjson1_serializeOpListAppAssessments) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAppAssessments) 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.(*ListAppAssessmentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-app-assessments") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAppAssessmentsInput(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_serializeOpHttpBindingsListAppAssessmentsInput(v *ListAppAssessmentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AppArn != nil { + encoder.SetQuery("appArn").String(*v.AppArn) + } + + if v.AssessmentName != nil { + encoder.SetQuery("assessmentName").String(*v.AssessmentName) + } + + if v.AssessmentStatus != nil { + for i := range v.AssessmentStatus { + encoder.AddQuery("assessmentStatus").String(string(v.AssessmentStatus[i])) + } + } + + if len(v.ComplianceStatus) > 0 { + encoder.SetQuery("complianceStatus").String(string(v.ComplianceStatus)) + } + + if len(v.Invoker) > 0 { + encoder.SetQuery("invoker").String(string(v.Invoker)) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ReverseOrder != nil { + encoder.SetQuery("reverseOrder").Boolean(*v.ReverseOrder) + } + + return nil +} + +type awsRestjson1_serializeOpListAppComponentCompliances struct { +} + +func (*awsRestjson1_serializeOpListAppComponentCompliances) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAppComponentCompliances) 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.(*ListAppComponentCompliancesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-app-component-compliances") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListAppComponentCompliancesInput(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_serializeOpHttpBindingsListAppComponentCompliancesInput(v *ListAppComponentCompliancesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1514,6 +2247,89 @@ func awsRestjson1_serializeOpDocumentListAppComponentRecommendationsInput(v *Lis return nil } +type awsRestjson1_serializeOpListAppInputSources struct { +} + +func (*awsRestjson1_serializeOpListAppInputSources) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAppInputSources) 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.(*ListAppInputSourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-app-input-sources") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListAppInputSourcesInput(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_serializeOpHttpBindingsListAppInputSourcesInput(v *ListAppInputSourcesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListAppInputSourcesInput(v *ListAppInputSourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListApps struct { } @@ -1565,15 +2381,98 @@ func awsRestjson1_serializeOpHttpBindingsListAppsInput(v *ListAppsInput, encoder } if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.Name != nil { - encoder.SetQuery("name").String(*v.Name) + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.Name != nil { + encoder.SetQuery("name").String(*v.Name) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListAppVersionAppComponents struct { +} + +func (*awsRestjson1_serializeOpListAppVersionAppComponents) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAppVersionAppComponents) 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.(*ListAppVersionAppComponentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-app-version-app-components") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListAppVersionAppComponentsInput(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_serializeOpHttpBindingsListAppVersionAppComponentsInput(v *ListAppVersionAppComponentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListAppVersionAppComponentsInput(v *ListAppVersionAppComponentsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) + ok := object.Key("nextToken") + ok.String(*v.NextToken) } return nil @@ -2601,14 +3500,253 @@ func (m *awsRestjson1_serializeOpResolveAppVersionResources) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentResolveAppVersionResourcesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentResolveAppVersionResourcesInput(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_serializeOpHttpBindingsResolveAppVersionResourcesInput(v *ResolveAppVersionResourcesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentResolveAppVersionResourcesInput(v *ResolveAppVersionResourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) + } + + return nil +} + +type awsRestjson1_serializeOpStartAppAssessment struct { +} + +func (*awsRestjson1_serializeOpStartAppAssessment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartAppAssessment) 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.(*StartAppAssessmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/start-app-assessment") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartAppAssessmentInput(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_serializeOpHttpBindingsStartAppAssessmentInput(v *StartAppAssessmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartAppAssessmentInput(v *StartAppAssessmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.AppVersion != nil { + ok := object.Key("appVersion") + ok.String(*v.AppVersion) + } + + if v.AssessmentName != nil { + ok := object.Key("assessmentName") + ok.String(*v.AssessmentName) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) 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.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(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_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) 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.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2619,39 +3757,37 @@ func (m *awsRestjson1_serializeOpResolveAppVersionResources) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsResolveAppVersionResourcesInput(v *ResolveAppVersionResourcesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} - -func awsRestjson1_serializeOpDocumentResolveAppVersionResourcesInput(v *ResolveAppVersionResourcesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AppArn != nil { - ok := object.Key("appArn") - ok.String(*v.AppArn) + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } } - if v.AppVersion != nil { - ok := object.Key("appVersion") - ok.String(*v.AppVersion) + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } } return nil } -type awsRestjson1_serializeOpStartAppAssessment struct { +type awsRestjson1_serializeOpUpdateApp struct { } -func (*awsRestjson1_serializeOpStartAppAssessment) ID() string { +func (*awsRestjson1_serializeOpUpdateApp) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpStartAppAssessment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2659,13 +3795,13 @@ func (m *awsRestjson1_serializeOpStartAppAssessment) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartAppAssessmentInput) + input, ok := in.Parameters.(*UpdateAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/start-app-assessment") + opPath, opQuery := httpbinding.SplitURI("/update-app") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2677,7 +3813,7 @@ func (m *awsRestjson1_serializeOpStartAppAssessment) HandleSerialize(ctx context restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentStartAppAssessmentInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateAppInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2692,7 +3828,7 @@ func (m *awsRestjson1_serializeOpStartAppAssessment) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsStartAppAssessmentInput(v *StartAppAssessmentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateAppInput(v *UpdateAppInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2700,7 +3836,7 @@ func awsRestjson1_serializeOpHttpBindingsStartAppAssessmentInput(v *StartAppAsse return nil } -func awsRestjson1_serializeOpDocumentStartAppAssessmentInput(v *StartAppAssessmentInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateAppInput(v *UpdateAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2709,39 +3845,37 @@ func awsRestjson1_serializeOpDocumentStartAppAssessmentInput(v *StartAppAssessme ok.String(*v.AppArn) } - if v.AppVersion != nil { - ok := object.Key("appVersion") - ok.String(*v.AppVersion) + if len(v.AssessmentSchedule) > 0 { + ok := object.Key("assessmentSchedule") + ok.String(string(v.AssessmentSchedule)) } - if v.AssessmentName != nil { - ok := object.Key("assessmentName") - ok.String(*v.AssessmentName) + if v.ClearResiliencyPolicyArn != nil { + ok := object.Key("clearResiliencyPolicyArn") + ok.Boolean(*v.ClearResiliencyPolicyArn) } - 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.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } + if v.PolicyArn != nil { + ok := object.Key("policyArn") + ok.String(*v.PolicyArn) } return nil } -type awsRestjson1_serializeOpTagResource struct { +type awsRestjson1_serializeOpUpdateAppVersion struct { } -func (*awsRestjson1_serializeOpTagResource) ID() string { +func (*awsRestjson1_serializeOpUpdateAppVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateAppVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2749,13 +3883,13 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*TagResourceInput) + input, ok := in.Parameters.(*UpdateAppVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + opPath, opQuery := httpbinding.SplitURI("/update-app-version") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2764,14 +3898,10 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateAppVersionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2786,45 +3916,41 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateAppVersionInput(v *UpdateAppVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - return nil } -func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateAppVersionInput(v *UpdateAppVersionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + if v.AdditionalInfo != nil { + ok := object.Key("additionalInfo") + if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil { return err } } + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + return nil } -type awsRestjson1_serializeOpUntagResource struct { +type awsRestjson1_serializeOpUpdateAppVersionAppComponent struct { } -func (*awsRestjson1_serializeOpUntagResource) ID() string { +func (*awsRestjson1_serializeOpUpdateAppVersionAppComponent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateAppVersionAppComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2832,22 +3958,29 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UntagResourceInput) + input, ok := in.Parameters.(*UpdateAppVersionAppComponentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + opPath, opQuery := httpbinding.SplitURI("/update-app-version-app-component") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAppVersionAppComponentInput(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} } @@ -2858,37 +3991,56 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateAppVersionAppComponentInput(v *UpdateAppVersionAppComponentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAppVersionAppComponentInput(v *UpdateAppVersionAppComponentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalInfo != nil { + ok := object.Key("additionalInfo") + if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil { return err } } - if v.TagKeys != nil { - for i := range v.TagKeys { - encoder.AddQuery("tagKeys").String(v.TagKeys[i]) - } + if v.AppArn != nil { + ok := object.Key("appArn") + ok.String(*v.AppArn) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Type != nil { + ok := object.Key("type") + ok.String(*v.Type) } return nil } -type awsRestjson1_serializeOpUpdateApp struct { +type awsRestjson1_serializeOpUpdateAppVersionResource struct { } -func (*awsRestjson1_serializeOpUpdateApp) ID() string { +func (*awsRestjson1_serializeOpUpdateAppVersionResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateAppVersionResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2896,13 +4048,13 @@ func (m *awsRestjson1_serializeOpUpdateApp) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateAppInput) + input, ok := in.Parameters.(*UpdateAppVersionResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/update-app") + opPath, opQuery := httpbinding.SplitURI("/update-app-version-resource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2914,7 +4066,7 @@ func (m *awsRestjson1_serializeOpUpdateApp) HandleSerialize(ctx context.Context, restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateAppInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateAppVersionResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2929,7 +4081,7 @@ func (m *awsRestjson1_serializeOpUpdateApp) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateAppInput(v *UpdateAppInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateAppVersionResourceInput(v *UpdateAppVersionResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2937,33 +4089,64 @@ func awsRestjson1_serializeOpHttpBindingsUpdateAppInput(v *UpdateAppInput, encod return nil } -func awsRestjson1_serializeOpDocumentUpdateAppInput(v *UpdateAppInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateAppVersionResourceInput(v *UpdateAppVersionResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AdditionalInfo != nil { + ok := object.Key("additionalInfo") + if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil { + return err + } + } + if v.AppArn != nil { ok := object.Key("appArn") ok.String(*v.AppArn) } - if len(v.AssessmentSchedule) > 0 { - ok := object.Key("assessmentSchedule") - ok.String(string(v.AssessmentSchedule)) + if v.AppComponents != nil { + ok := object.Key("appComponents") + if err := awsRestjson1_serializeDocumentAppComponentNameList(v.AppComponents, ok); err != nil { + return err + } } - if v.ClearResiliencyPolicyArn != nil { - ok := object.Key("clearResiliencyPolicyArn") - ok.Boolean(*v.ClearResiliencyPolicyArn) + if v.AwsAccountId != nil { + ok := object.Key("awsAccountId") + ok.String(*v.AwsAccountId) } - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) + if v.AwsRegion != nil { + ok := object.Key("awsRegion") + ok.String(*v.AwsRegion) } - if v.PolicyArn != nil { - ok := object.Key("policyArn") - ok.String(*v.PolicyArn) + if v.Excluded != nil { + ok := object.Key("excluded") + ok.Boolean(*v.Excluded) + } + + if v.LogicalResourceId != nil { + ok := object.Key("logicalResourceId") + if err := awsRestjson1_serializeDocumentLogicalResourceId(v.LogicalResourceId, ok); err != nil { + return err + } + } + + if v.PhysicalResourceId != nil { + ok := object.Key("physicalResourceId") + ok.String(*v.PhysicalResourceId) + } + + if v.ResourceName != nil { + ok := object.Key("resourceName") + ok.String(*v.ResourceName) + } + + if v.ResourceType != nil { + ok := object.Key("resourceType") + ok.String(*v.ResourceType) } return nil @@ -3064,6 +4247,44 @@ func awsRestjson1_serializeOpDocumentUpdateResiliencyPolicyInput(v *UpdateResili return nil } +func awsRestjson1_serializeDocumentAdditionalInfoMap(v map[string][]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentAdditionalInfoValueList(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAdditionalInfoValueList(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_serializeDocumentAppComponentNameList(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_serializeDocumentArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3117,6 +4338,33 @@ func awsRestjson1_serializeDocumentFailurePolicy(v *types.FailurePolicy, value s return nil } +func awsRestjson1_serializeDocumentLogicalResourceId(v *types.LogicalResourceId, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("identifier") + ok.String(*v.Identifier) + } + + if v.LogicalStackName != nil { + ok := object.Key("logicalStackName") + ok.String(*v.LogicalStackName) + } + + if v.ResourceGroupName != nil { + ok := object.Key("resourceGroupName") + ok.String(*v.ResourceGroupName) + } + + if v.TerraformSourceName != nil { + ok := object.Key("terraformSourceName") + ok.String(*v.TerraformSourceName) + } + + return nil +} + func awsRestjson1_serializeDocumentPhysicalResourceId(v *types.PhysicalResourceId, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/resiliencehub/types/enums.go b/service/resiliencehub/types/enums.go index aff0945833a..4247bfbbf5a 100644 --- a/service/resiliencehub/types/enums.go +++ b/service/resiliencehub/types/enums.go @@ -406,6 +406,24 @@ func (ResourceImportStatusType) Values() []ResourceImportStatusType { } } +type ResourceImportStrategyType string + +// Enum values for ResourceImportStrategyType +const ( + ResourceImportStrategyTypeAddOnly ResourceImportStrategyType = "AddOnly" + ResourceImportStrategyTypeReplaceAll ResourceImportStrategyType = "ReplaceAll" +) + +// Values returns all known values for ResourceImportStrategyType. 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 (ResourceImportStrategyType) Values() []ResourceImportStrategyType { + return []ResourceImportStrategyType{ + "AddOnly", + "ReplaceAll", + } +} + type ResourceMappingType string // Enum values for ResourceMappingType diff --git a/service/resiliencehub/types/errors.go b/service/resiliencehub/types/errors.go index 3d49051438e..06d140e771c 100644 --- a/service/resiliencehub/types/errors.go +++ b/service/resiliencehub/types/errors.go @@ -35,10 +35,10 @@ func (e *AccessDeniedException) ErrorCode() string { } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to the -// host serving the current request. A retry (with appropriate backoff logic) is -// the recommended response to this exception. +// This exception occurs when a conflict with a previous successful write is +// detected. This generally occurs when the previous write did not have time to +// propagate to the host serving the current request. A retry (with appropriate +// backoff logic) is the recommended response to this exception. type ConflictException struct { Message *string @@ -94,7 +94,7 @@ func (e *InternalServerException) ErrorCode() string { } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } -// The specified resource could not be found. +// This exception occurs when the specified resource could not be found. type ResourceNotFoundException struct { Message *string @@ -123,9 +123,9 @@ func (e *ResourceNotFoundException) ErrorCode() string { } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You have exceeded your service quota. To perform the requested action, remove -// some of the relevant resources, or use Service Quotas to request a service quota -// increase. +// This exception occurs when you have exceeded your service quota. To perform the +// requested action, remove some of the relevant resources, or use Service Quotas +// to request a service quota increase. type ServiceQuotaExceededException struct { Message *string @@ -151,7 +151,8 @@ func (e *ServiceQuotaExceededException) ErrorCode() string { } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The limit on the number of requests per second was exceeded. +// This exception occurs when you have exceeded the limit on the number of requests +// per second. type ThrottlingException struct { Message *string @@ -179,7 +180,7 @@ func (e *ThrottlingException) ErrorCode() string { } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Indicates that a request was not valid. +// This exception occurs when a request is not valid. type ValidationException struct { Message *string diff --git a/service/resiliencehub/types/types.go b/service/resiliencehub/types/types.go index 204fc1fe2d9..48fb2ea1ab7 100644 --- a/service/resiliencehub/types/types.go +++ b/service/resiliencehub/types/types.go @@ -30,7 +30,7 @@ type AlarmRecommendation struct { // This member is required. Type AlarmType - // The application component for the CloudWatch alarm recommendation. + // The Application Component for the CloudWatch alarm recommendation. AppComponentName *string // The description of the recommendation. @@ -45,14 +45,14 @@ type AlarmRecommendation struct { noSmithyDocumentSerde } -// Defines a Resilience Hub application. +// Defines an AWS Resilience Hub application. type App struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -86,7 +86,7 @@ type App struct { // is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For // more information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. PolicyArn *string // The current resiliency score for the application. @@ -109,7 +109,7 @@ type AppAssessment struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -124,11 +124,11 @@ type AppAssessment struct { // This member is required. Invoker AssessmentInvoker - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. AppArn *string // The version of the application. @@ -179,7 +179,7 @@ type AppAssessmentSummary struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -189,11 +189,11 @@ type AppAssessmentSummary struct { // This member is required. AssessmentStatus AssessmentStatus - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. AppArn *string // The version of the application. @@ -226,30 +226,39 @@ type AppAssessmentSummary struct { noSmithyDocumentSerde } -// Defines an application component. +// Defines an Application Component. type AppComponent struct { - // The name of the application component. + // The name of the Application Component. // // This member is required. Name *string - // The type of application component. + // The type of Application Component. // // This member is required. Type *string + // Additional configuration parameters for an AWS Resilience Hub application. + // Currently, this parameter accepts a key-value mapping (in a string format) of + // only one failover region and one associated account. Key: "failover-regions" + // Value: "[{"region":"", "accounts":[{"id":""}]}]" + AdditionalInfo map[string][]string + + // Unique identifier of the Application Component. + Id *string + noSmithyDocumentSerde } -// Defines the compliance of an application component against the resiliency +// Defines the compliance of an Application Component against the resiliency // policy. type AppComponentCompliance struct { - // The name of the application component. + // The name of the Application Component. AppComponentName *string - // The compliance of the application component against the resiliency policy. + // The compliance of the Application Component against the resiliency policy. Compliance map[string]DisruptionCompliance // The cost for the application. @@ -267,14 +276,40 @@ type AppComponentCompliance struct { noSmithyDocumentSerde } +// The list of AWS Resilience Hub application input sources. +type AppInputSource struct { + + // The resource type of the input source. + // + // This member is required. + ImportType ResourceMappingType + + // The number of resources that were imported. + ResourceCount int32 + + // The Amazon Resource Name (ARN) of the input source. For more information about + // ARNs, see Amazon Resource Names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in + // the AWS General Reference guide. + SourceArn *string + + // The name of the input source. + SourceName *string + + // The name of the Terraform s3 state file. + TerraformSource *TerraformSource + + noSmithyDocumentSerde +} + // Defines an application summary. type AppSummary struct { - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AppArn *string @@ -318,12 +353,12 @@ type AppVersionSummary struct { noSmithyDocumentSerde } -// Defines recommendations for a Resilience Hub application component, returned as -// an object. This object contains component names, configuration recommendations, -// and recommendation statuses. +// Defines recommendations for an AWS Resilience Hub Application Component, +// returned as an object. This object contains component names, configuration +// recommendations, and recommendation statuses. type ComponentRecommendation struct { - // The name of the application component. + // The name of the Application Component. // // This member is required. AppComponentName *string @@ -359,7 +394,7 @@ type ConfigRecommendation struct { // This member is required. ReferenceId *string - // The application component name. + // The name of the Application Component. AppComponentName *string // The current compliance against the resiliency policy before applying the @@ -481,7 +516,7 @@ type LogicalResourceId struct { } // Defines a physical resource. A physical resource is a resource that exists in -// your account. It can be identified using an Amazon Resource Name (ARN) or a +// your account. It can be identified using an Amazon Resource Name (ARN) or an AWS // Resilience Hub-native identifier. type PhysicalResource struct { @@ -500,9 +535,18 @@ type PhysicalResource struct { // This member is required. ResourceType *string + // Additional configuration parameters for an AWS Resilience Hub application. + // Currently, this parameter accepts a key-value mapping (in a string format) of + // only one failover region and one associated account. Key: "failover-regions" + // Value: "[{"region":"", "accounts":[{"id":""}]}]" + AdditionalInfo map[string][]string + // The application components that belong to this resource. AppComponents []AppComponent + // Indicates if a resource is included or excluded from the assessment. + Excluded *bool + // The name of the resource. ResourceName *string @@ -518,7 +562,7 @@ type PhysicalResourceId struct { Identifier *string // Specifies the type of physical resource identifier. Arn The resource identifier - // is an Amazon Resource Name (ARN) . Native The resource identifier is a + // is an Amazon Resource Name (ARN) . Native The resource identifier is an AWS // Resilience Hub-native identifier. // // This member is required. @@ -585,7 +629,7 @@ type RecommendationTemplate struct { // arn:partition:resiliencehub:region:account:app-assessment/app-id. For more // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. // // This member is required. AssessmentArn *string @@ -618,11 +662,11 @@ type RecommendationTemplate struct { // This member is required. Status RecommendationTemplateStatus - // The Amazon Resource Name (ARN) of the application. The format for this ARN is: - // arn:partition:resiliencehub:region:account:app/app-id. For more information - // about ARNs, see Amazon Resource Names (ARNs) + // The Amazon Resource Name (ARN) of the AWS Resilience Hub application. The format + // for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more + // information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. AppArn *string // The end time for the action. @@ -670,7 +714,7 @@ type ResiliencyPolicy struct { // is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For // more information about ARNs, see Amazon Resource Names (ARNs) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // the AWS General Reference guide. PolicyArn *string // The description for the policy. @@ -802,7 +846,7 @@ type SopRecommendation struct { // This member is required. ServiceType SopServiceType - // The application component name. + // The name of the Application Component. AppComponentName *string // The description of the SOP recommendation. @@ -839,7 +883,7 @@ type TestRecommendation struct { // This member is required. ReferenceId *string - // The name of the application component. + // The name of the Application Component. AppComponentName *string // A list of recommended alarms that are used in the test and must be exported @@ -873,7 +917,7 @@ type TestRecommendation struct { noSmithyDocumentSerde } -// Defines a resource that is not supported by Resilience Hub. +// Defines a resource that is not supported by AWS Resilience Hub. type UnsupportedResource struct { // The logical resource identifier for the unsupported resource. diff --git a/service/resiliencehub/validators.go b/service/resiliencehub/validators.go index c9413bb2b98..2c897709430 100644 --- a/service/resiliencehub/validators.go +++ b/service/resiliencehub/validators.go @@ -50,6 +50,46 @@ func (m *validateOpCreateApp) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpCreateAppVersionAppComponent struct { +} + +func (*validateOpCreateAppVersionAppComponent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAppVersionAppComponentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAppVersionAppComponentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAppVersionResource struct { +} + +func (*validateOpCreateAppVersionResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAppVersionResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAppVersionResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateRecommendationTemplate struct { } @@ -130,6 +170,66 @@ func (m *validateOpDeleteApp) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpDeleteAppInputSource struct { +} + +func (*validateOpDeleteAppInputSource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAppInputSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAppInputSourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAppInputSourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAppVersionAppComponent struct { +} + +func (*validateOpDeleteAppVersionAppComponent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAppVersionAppComponentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAppVersionAppComponentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAppVersionResource struct { +} + +func (*validateOpDeleteAppVersionResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAppVersionResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAppVersionResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteRecommendationTemplate struct { } @@ -210,6 +310,66 @@ func (m *validateOpDescribeApp) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpDescribeAppVersionAppComponent struct { +} + +func (*validateOpDescribeAppVersionAppComponent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeAppVersionAppComponentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeAppVersionAppComponentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeAppVersion struct { +} + +func (*validateOpDescribeAppVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeAppVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeAppVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeAppVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeAppVersionResource struct { +} + +func (*validateOpDescribeAppVersionResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeAppVersionResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeAppVersionResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeAppVersionResourcesResolutionStatus struct { } @@ -370,6 +530,46 @@ func (m *validateOpListAppComponentRecommendations) HandleInitialize(ctx context return next.HandleInitialize(ctx, in) } +type validateOpListAppInputSources struct { +} + +func (*validateOpListAppInputSources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAppInputSources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAppInputSourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAppInputSourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAppVersionAppComponents struct { +} + +func (*validateOpListAppVersionAppComponents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAppVersionAppComponents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAppVersionAppComponentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAppVersionAppComponentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAppVersionResourceMappings struct { } @@ -690,6 +890,66 @@ func (m *validateOpUpdateApp) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpUpdateAppVersionAppComponent struct { +} + +func (*validateOpUpdateAppVersionAppComponent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAppVersionAppComponentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAppVersionAppComponentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateAppVersion struct { +} + +func (*validateOpUpdateAppVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAppVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAppVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAppVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateAppVersionResource struct { +} + +func (*validateOpUpdateAppVersionResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAppVersionResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAppVersionResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateResiliencyPolicy struct { } @@ -718,6 +978,14 @@ func addOpCreateAppValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateApp{}, middleware.After) } +func addOpCreateAppVersionAppComponentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAppVersionAppComponent{}, middleware.After) +} + +func addOpCreateAppVersionResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAppVersionResource{}, middleware.After) +} + func addOpCreateRecommendationTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRecommendationTemplate{}, middleware.After) } @@ -734,6 +1002,18 @@ func addOpDeleteAppValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteApp{}, middleware.After) } +func addOpDeleteAppInputSourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAppInputSource{}, middleware.After) +} + +func addOpDeleteAppVersionAppComponentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAppVersionAppComponent{}, middleware.After) +} + +func addOpDeleteAppVersionResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAppVersionResource{}, middleware.After) +} + func addOpDeleteRecommendationTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRecommendationTemplate{}, middleware.After) } @@ -750,6 +1030,18 @@ func addOpDescribeAppValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeApp{}, middleware.After) } +func addOpDescribeAppVersionAppComponentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeAppVersionAppComponent{}, middleware.After) +} + +func addOpDescribeAppVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeAppVersion{}, middleware.After) +} + +func addOpDescribeAppVersionResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeAppVersionResource{}, middleware.After) +} + func addOpDescribeAppVersionResourcesResolutionStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeAppVersionResourcesResolutionStatus{}, middleware.After) } @@ -782,6 +1074,14 @@ func addOpListAppComponentRecommendationsValidationMiddleware(stack *middleware. return stack.Initialize.Add(&validateOpListAppComponentRecommendations{}, middleware.After) } +func addOpListAppInputSourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAppInputSources{}, middleware.After) +} + +func addOpListAppVersionAppComponentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAppVersionAppComponents{}, middleware.After) +} + func addOpListAppVersionResourceMappingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAppVersionResourceMappings{}, middleware.After) } @@ -846,6 +1146,18 @@ func addOpUpdateAppValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateApp{}, middleware.After) } +func addOpUpdateAppVersionAppComponentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAppVersionAppComponent{}, middleware.After) +} + +func addOpUpdateAppVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAppVersion{}, middleware.After) +} + +func addOpUpdateAppVersionResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAppVersionResource{}, middleware.After) +} + func addOpUpdateResiliencyPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateResiliencyPolicy{}, middleware.After) } @@ -880,6 +1192,21 @@ func validateFailurePolicy(v *types.FailurePolicy) error { } } +func validateLogicalResourceId(v *types.LogicalResourceId) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LogicalResourceId"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validatePhysicalResourceId(v *types.PhysicalResourceId) error { if v == nil { return nil @@ -1006,6 +1333,61 @@ func validateOpCreateAppInput(v *CreateAppInput) error { } } +func validateOpCreateAppVersionAppComponentInput(v *CreateAppVersionAppComponentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAppVersionAppComponentInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Type == nil { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAppVersionResourceInput(v *CreateAppVersionResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAppVersionResourceInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if v.LogicalResourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogicalResourceId")) + } else if v.LogicalResourceId != nil { + if err := validateLogicalResourceId(v.LogicalResourceId); err != nil { + invalidParams.AddNested("LogicalResourceId", err.(smithy.InvalidParamsError)) + } + } + if v.PhysicalResourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhysicalResourceId")) + } + if v.ResourceType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) + } + if v.AppComponents == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppComponents")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateRecommendationTemplateInput(v *CreateRecommendationTemplateInput) error { if v == nil { return nil @@ -1079,6 +1461,64 @@ func validateOpDeleteAppInput(v *DeleteAppInput) error { } } +func validateOpDeleteAppInputSourceInput(v *DeleteAppInputSourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAppInputSourceInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.TerraformSource != nil { + if err := validateTerraformSource(v.TerraformSource); err != nil { + invalidParams.AddNested("TerraformSource", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAppVersionAppComponentInput(v *DeleteAppVersionAppComponentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAppVersionAppComponentInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAppVersionResourceInput(v *DeleteAppVersionResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAppVersionResourceInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.LogicalResourceId != nil { + if err := validateLogicalResourceId(v.LogicalResourceId); err != nil { + invalidParams.AddNested("LogicalResourceId", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteRecommendationTemplateInput(v *DeleteRecommendationTemplateInput) error { if v == nil { return nil @@ -1139,6 +1579,68 @@ func validateOpDescribeAppInput(v *DescribeAppInput) error { } } +func validateOpDescribeAppVersionAppComponentInput(v *DescribeAppVersionAppComponentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeAppVersionAppComponentInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.AppVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppVersion")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeAppVersionInput(v *DescribeAppVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeAppVersionInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.AppVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeAppVersionResourceInput(v *DescribeAppVersionResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeAppVersionResourceInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.AppVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppVersion")) + } + if v.LogicalResourceId != nil { + if err := validateLogicalResourceId(v.LogicalResourceId); err != nil { + invalidParams.AddNested("LogicalResourceId", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeAppVersionResourcesResolutionStatusInput(v *DescribeAppVersionResourcesResolutionStatusInput) error { if v == nil { return nil @@ -1270,6 +1772,42 @@ func validateOpListAppComponentRecommendationsInput(v *ListAppComponentRecommend } } +func validateOpListAppInputSourcesInput(v *ListAppInputSourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAppInputSourcesInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.AppVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAppVersionAppComponentsInput(v *ListAppVersionAppComponentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAppVersionAppComponentsInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.AppVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAppVersionResourceMappingsInput(v *ListAppVersionResourceMappingsInput) error { if v == nil { return nil @@ -1537,6 +2075,59 @@ func validateOpUpdateAppInput(v *UpdateAppInput) error { } } +func validateOpUpdateAppVersionAppComponentInput(v *UpdateAppVersionAppComponentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAppVersionAppComponentInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateAppVersionInput(v *UpdateAppVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAppVersionInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateAppVersionResourceInput(v *UpdateAppVersionResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAppVersionResourceInput"} + if v.AppArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppArn")) + } + if v.LogicalResourceId != nil { + if err := validateLogicalResourceId(v.LogicalResourceId); err != nil { + invalidParams.AddNested("LogicalResourceId", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateResiliencyPolicyInput(v *UpdateResiliencyPolicyInput) error { if v == nil { return nil diff --git a/service/securityhub/api_op_EnableSecurityHub.go b/service/securityhub/api_op_EnableSecurityHub.go index 56190607622..71556aafd79 100644 --- a/service/securityhub/api_op_EnableSecurityHub.go +++ b/service/securityhub/api_op_EnableSecurityHub.go @@ -14,19 +14,20 @@ import ( // specify in the request. When you enable Security Hub, you grant to Security Hub // the permissions necessary to gather findings from other services that are // integrated with Security Hub. When you use the EnableSecurityHub operation to -// enable Security Hub, you also automatically enable the following standards. +// enable Security Hub, you also automatically enable the following standards: // // * -// CIS Amazon Web Services Foundations +// Center for Internet Security (CIS) Amazon Web Services Foundations Benchmark +// v1.2.0 // -// * Amazon Web Services Foundational Security -// Best Practices +// * Amazon Web Services Foundational Security Best Practices // -// You do not enable the Payment Card Industry Data Security -// Standard (PCI DSS) standard. To not enable the automatically enabled standards, -// set EnableDefaultStandards to false. After you enable Security Hub, to enable a -// standard, use the BatchEnableStandards operation. To disable a standard, use the -// BatchDisableStandards operation. To learn more, see the setup information +// Other +// standards are not automatically enabled. To opt out of automatically enabled +// standards, set EnableDefaultStandards to false. After you enable Security Hub, +// to enable a standard, use the BatchEnableStandards operation. To disable a +// standard, use the BatchDisableStandards operation. To learn more, see the setup +// information // (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-settingup.html) // in the Security Hub User Guide. func (c *Client) EnableSecurityHub(ctx context.Context, params *EnableSecurityHubInput, optFns ...func(*Options)) (*EnableSecurityHubOutput, error) { diff --git a/service/securityhub/types/types.go b/service/securityhub/types/types.go index 140b3d329e0..f31b53446d6 100644 --- a/service/securityhub/types/types.go +++ b/service/securityhub/types/types.go @@ -219,11 +219,17 @@ type AwsApiCallAction struct { DomainDetails *AwsApiCallActionDomainDetails // An ISO8601-formatted timestamp that indicates when the API call was first - // observed. + // observed. A correctly formatted example is 2020-05-21T20:16:34.724Z. The value + // cannot contain spaces, and date and time should be separated by T. For more + // information, see RFC 3339 section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). FirstSeen *string // An ISO8601-formatted timestamp that indicates when the API call was most - // recently observed. + // recently observed. A correctly formatted example is 2020-05-21T20:16:34.724Z. + // The value cannot contain spaces, and date and time should be separated by T. For + // more information, see RFC 3339 section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). LastSeen *string // Provided if CallerType is remoteIp. Provides information about the remote IP @@ -362,7 +368,8 @@ type AwsApiGatewayRestApiDetails struct { // Indicates when the API was created. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedDate *string // A description of the REST API. @@ -411,7 +418,8 @@ type AwsApiGatewayStageDetails struct { // Indicates when the stage was created. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedDate *string // The identifier of the deployment that the stage points to. @@ -426,7 +434,8 @@ type AwsApiGatewayStageDetails struct { // Indicates when the stage was most recently updated. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastUpdatedDate *string // Defines the method settings for the stage. @@ -477,7 +486,8 @@ type AwsApiGatewayV2ApiDetails struct { // Indicates when the API was created. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedDate *string // A description of the API. @@ -546,7 +556,8 @@ type AwsApiGatewayV2StageDetails struct { // Indicates when the stage was created. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedDate *string // Default route settings for the stage. @@ -565,7 +576,8 @@ type AwsApiGatewayV2StageDetails struct { // Indicates when the stage was most recently updated. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastUpdatedDate *string // The route settings for the stage. @@ -610,7 +622,8 @@ type AwsAutoScalingAutoScalingGroupDetails struct { // Indicates when the auto scaling group was created. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedTime *string // The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before it @@ -846,7 +859,8 @@ type AwsAutoScalingLaunchConfigurationDetails struct { // The creation date and time for the launch configuration. Uses the date-time // format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedTime *string // Whether the launch configuration is optimized for Amazon EBS I/O. @@ -1284,7 +1298,8 @@ type AwsCertificateManagerCertificateDetails struct { // Indicates when the certificate was requested. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedAt *string // The fully qualified domain name (FQDN), such as www.example.com, that is secured @@ -1312,7 +1327,8 @@ type AwsCertificateManagerCertificateDetails struct { // Indicates when the certificate was imported. Provided if the certificate type is // IMPORTED. Uses the date-time format specified in RFC 3339 section 5.6, Internet // Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6). The value - // cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. + // cannot contain spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. ImportedAt *string // The list of ARNs for the Amazon Web Services resources that use the certificate. @@ -1321,7 +1337,8 @@ type AwsCertificateManagerCertificateDetails struct { // Indicates when the certificate was issued. Provided if the certificate type is // AMAZON_ISSUED. Uses the date-time format specified in RFC 3339 section 5.6, // Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6). The - // value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. + // value cannot contain spaces, and date and time should be separated by T. For + // example, 2020-03-22T13:22:13.933Z. IssuedAt *string // The name of the certificate authority that issued and signed the certificate. @@ -1338,13 +1355,15 @@ type AwsCertificateManagerCertificateDetails struct { // The time after which the certificate becomes invalid. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. NotAfter *string // The time before which the certificate is not valid. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. NotBefore *string // Provides a value that specifies whether to add the certificate to a transparency @@ -1479,7 +1498,8 @@ type AwsCertificateManagerCertificateRenewalSummary struct { // Indicates when the renewal summary was last updated. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. UpdatedAt *string noSmithyDocumentSerde @@ -1658,7 +1678,8 @@ type AwsCloudFrontDistributionDetails struct { // Indicates when that the distribution was last modified. Uses the date-time // format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastModifiedTime *string // A complex type that controls whether access logs are written for the @@ -2363,7 +2384,8 @@ type AwsDynamoDbTableBillingModeSummary struct { // If the billing mode is PAY_PER_REQUEST, indicates when the billing mode was set // to that value. Uses the date-time format specified in RFC 3339 section 5.6, // Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6). The - // value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. + // value cannot contain spaces, and date and time should be separated by T. For + // example, 2020-03-22T13:22:13.933Z. LastUpdateToPayPerRequestDateTime *string noSmithyDocumentSerde @@ -2381,7 +2403,8 @@ type AwsDynamoDbTableDetails struct { // Indicates when the table was created. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreationDateTime *string // List of global secondary indexes for the table. @@ -2554,13 +2577,15 @@ type AwsDynamoDbTableProvisionedThroughput struct { // Indicates when the provisioned throughput was last decreased. Uses the date-time // format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastDecreaseDateTime *string // Indicates when the provisioned throughput was last increased. Uses the date-time // format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastIncreaseDateTime *string // The number of times during the current UTC calendar day that the provisioned @@ -2641,7 +2666,8 @@ type AwsDynamoDbTableRestoreSummary struct { // Indicates the point in time that the table was restored to. Uses the date-time // format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. RestoreDateTime *string // Whether a restore is currently in progress. @@ -2663,7 +2689,8 @@ type AwsDynamoDbTableSseDescription struct { // key was inaccessible. Uses the date-time format specified in RFC 3339 section // 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. InaccessibleEncryptionDateTime *string // The ARN of the KMS key that is used for the KMS encryption. @@ -2751,7 +2778,8 @@ type AwsEc2InstanceDetails struct { // Indicates when the instance was launched. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LaunchedAt *string // Details about the metadata options for the Amazon EC2 instance. @@ -3673,7 +3701,8 @@ type AwsEc2NetworkInterfaceAttachment struct { // Indicates when the attachment initiated. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. AttachTime *string // The identifier of the network interface attachment @@ -4014,7 +4043,8 @@ type AwsEc2VolumeDetails struct { // Indicates when the volume was created. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreateTime *string // The device name for the volume that is attached to the instance. @@ -4356,7 +4386,8 @@ type AwsEc2VpnConnectionVgwTelemetryDetails struct { // The date and time of the last change in status. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastStatusChange *string // The Internet-routable IP address of the virtual private gateway's outside @@ -4391,7 +4422,8 @@ type AwsEcrContainerImageDetails struct { // The date and time when the image was pushed to the repository. Uses the // date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. ImagePublishedAt *string // The list of tags that are associated with the image. @@ -6411,7 +6443,8 @@ type AwsElbLoadBalancerDetails struct { // Indicates when the load balancer was created. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedTime *string // The DNS name of the load balancer. @@ -6586,7 +6619,8 @@ type AwsElbv2LoadBalancerDetails struct { // Indicates when the load balancer was created. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedTime *string // The public DNS name of the load balancer. @@ -6630,7 +6664,8 @@ type AwsIamAccessKeyDetails struct { // Indicates when the IAM access key was created. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedAt *string // The ID of the principal associated with an access key. @@ -6676,7 +6711,8 @@ type AwsIamAccessKeySessionContextAttributes struct { // Indicates when the session was created. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreationDate *string // Indicates whether the session used multi-factor authentication (MFA). @@ -6728,7 +6764,8 @@ type AwsIamGroupDetails struct { // Indicates when the IAM group was created. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreateDate *string // The identifier of the IAM group. @@ -6764,7 +6801,8 @@ type AwsIamInstanceProfile struct { // Indicates when the instance profile was created. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreateDate *string // The identifier of the instance profile. @@ -6794,7 +6832,8 @@ type AwsIamInstanceProfileRole struct { // Indicates when the role was created. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreateDate *string // The path to the role. @@ -6831,7 +6870,8 @@ type AwsIamPolicyDetails struct { // When the policy was created. Uses the date-time format specified in RFC 3339 // section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreateDate *string // The identifier of the default version of the policy. @@ -6862,7 +6902,8 @@ type AwsIamPolicyDetails struct { // When the policy was most recently updated. Uses the date-time format specified // in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. UpdateDate *string noSmithyDocumentSerde @@ -6874,7 +6915,8 @@ type AwsIamPolicyVersion struct { // Indicates when the version was created. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreateDate *string // Whether the version is the default version. @@ -6898,7 +6940,8 @@ type AwsIamRoleDetails struct { // Indicates when the role was created. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreateDate *string // The list of instance profiles that contain this role. @@ -6945,7 +6988,8 @@ type AwsIamUserDetails struct { // Indicates when the user was created. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreateDate *string // A list of IAM groups that the user belongs to. @@ -7026,7 +7070,8 @@ type AwsKmsKeyDetails struct { // Indicates when the KMS key was created. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreationDate float64 // A description of the KMS key. @@ -7129,7 +7174,8 @@ type AwsLambdaFunctionDetails struct { // Indicates when the function was last updated. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastModified *string // The function's layers. @@ -7240,7 +7286,8 @@ type AwsLambdaLayerVersionDetails struct { // Indicates when the version was created. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedDate *string // The version number. @@ -7682,7 +7729,8 @@ type AwsRdsDbClusterDetails struct { // Indicates when the DB cluster was created, in Universal Coordinated Time (UTC). // Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time // Format (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot - // contain spaces. For example, 2020-03-22T13:22:13.933Z. + // contain spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. ClusterCreateTime *string // Whether tags are copied from the DB cluster to snapshots of the DB cluster. @@ -7853,7 +7901,8 @@ type AwsRdsDbClusterSnapshotDetails struct { // Indicates when the DB cluster was created, in Universal Coordinated Time (UTC). // Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time // Format (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot - // contain spaces. For example, 2020-03-22T13:22:13.933Z. + // contain spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. ClusterCreateTime *string // The DB cluster identifier. @@ -7890,7 +7939,8 @@ type AwsRdsDbClusterSnapshotDetails struct { // Indicates when the snapshot was taken. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. SnapshotCreateTime *string // The type of DB cluster snapshot. @@ -8060,7 +8110,8 @@ type AwsRdsDbInstanceDetails struct { // Indicates when the DB instance was created. Uses the date-time format specified // in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. InstanceCreateTime *string // Specifies the provisioned IOPS (I/O operations per second) for this DB instance. @@ -8073,7 +8124,8 @@ type AwsRdsDbInstanceDetails struct { // Specifies the latest time to which a database can be restored with point-in-time // restore. Uses the date-time format specified in RFC 3339 section 5.6, Internet // Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6). The value - // cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. + // cannot contain spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LatestRestorableTime *string // License model information for this DB instance. @@ -8583,7 +8635,8 @@ type AwsRdsEventSubscriptionDetails struct { // The datetime when the event notification subscription was created. Uses the // date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. SubscriptionCreationTime *string noSmithyDocumentSerde @@ -8692,7 +8745,8 @@ type AwsRedshiftClusterDeferredMaintenanceWindow struct { // The end of the time window for which maintenance was deferred. Uses the // date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. DeferMaintenanceEndTime *string // The identifier of the maintenance window. @@ -8701,7 +8755,8 @@ type AwsRedshiftClusterDeferredMaintenanceWindow struct { // The start of the time window for which maintenance was deferred. Uses the // date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. DeferMaintenanceStartTime *string noSmithyDocumentSerde @@ -8741,7 +8796,8 @@ type AwsRedshiftClusterDetails struct { // Indicates when the cluster was created. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. ClusterCreateTime *string // The unique identifier of the cluster. @@ -8809,7 +8865,8 @@ type AwsRedshiftClusterDetails struct { // a valid snapshot schedule and have backups enabled. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. ExpectedNextSnapshotScheduleTime *string // The status of the next expected snapshot. Valid values: OnTrack | Pending @@ -8847,7 +8904,8 @@ type AwsRedshiftClusterDetails struct { // Indicates the start of the next maintenance window. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. NextMaintenanceWindowStartTime *string // The node type for the nodes in the cluster. @@ -8965,13 +9023,15 @@ type AwsRedshiftClusterLoggingStatus struct { // The last time when logs failed to be delivered. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastFailureTime *string // The last time that logs were delivered successfully. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastSuccessfulDeliveryTime *string // Indicates whether logging is enabled. @@ -9134,7 +9194,8 @@ type AwsS3BucketBucketLifecycleConfigurationRulesDetails struct { // The date when objects are moved or deleted. Uses the date-time format specified // in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. ExpirationDate *string // The length in days of the lifetime for objects that are subject to the rule. @@ -9264,7 +9325,8 @@ type AwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails struct { // provide Date, you cannot provide Days. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. Date *string // The number of days after which to transition the object to the specified storage @@ -9326,7 +9388,8 @@ type AwsS3BucketDetails struct { // Indicates when the S3 bucket was created. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. CreatedAt *string // The Amazon Web Services account identifier of the account that owns the S3 @@ -9556,7 +9619,8 @@ type AwsS3ObjectDetails struct { // Indicates when the object was last modified. Uses the date-time format specified // in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastModified *string // The identifier of the KMS symmetric customer managed key that was used for the @@ -9735,7 +9799,8 @@ type AwsSecurityFinding struct { // issue that a finding captured. Uses the date-time format specified in RFC 3339 // section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. // // This member is required. CreatedAt *string @@ -9783,7 +9848,8 @@ type AwsSecurityFinding struct { // Indicates when the security-findings provider last updated the finding record. // Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time // Format (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot - // contain spaces. For example, 2020-03-22T13:22:13.933Z. + // contain spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. // // This member is required. UpdatedAt *string @@ -9824,14 +9890,16 @@ type AwsSecurityFinding struct { // security issue that a finding captured. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. FirstObservedAt *string // Indicates when the security-findings provider most recently observed the // potential security issue that a finding captured. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastObservedAt *string // A list of malware related to a finding. @@ -9962,7 +10030,11 @@ type AwsSecurityFindingFilters struct { Confidence []NumberFilter // An ISO8601-formatted timestamp that indicates when the security-findings - // provider captured the potential security issue that a finding captured. + // provider captured the potential security issue that a finding captured. A + // correctly formatted example is 2020-05-21T20:16:34.724Z. The value cannot + // contain spaces, and date and time should be separated by T. For more + // information, see RFC 3339 section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). CreatedAt []DateFilter // The level of importance assigned to the resources associated with the finding. A @@ -10007,7 +10079,11 @@ type AwsSecurityFindingFilters struct { FindingProviderFieldsTypes []StringFilter // An ISO8601-formatted timestamp that indicates when the security-findings - // provider first observed the potential security issue that a finding captured. + // provider first observed the potential security issue that a finding captured. A + // correctly formatted example is 2020-05-21T20:16:34.724Z. The value cannot + // contain spaces, and date and time should be separated by T. For more + // information, see RFC 3339 section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). FirstObservedAt []DateFilter // The identifier for the solution-specific component (a discrete unit of logic) @@ -10025,7 +10101,10 @@ type AwsSecurityFindingFilters struct { // An ISO8601-formatted timestamp that indicates when the security-findings // provider most recently observed the potential security issue that a finding - // captured. + // captured. A correctly formatted example is 2020-05-21T20:16:34.724Z. The value + // cannot contain spaces, and date and time should be separated by T. For more + // information, see RFC 3339 section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). LastObservedAt []DateFilter // The name of the malware that was observed. @@ -10083,7 +10162,11 @@ type AwsSecurityFindingFilters struct { // The principal that created a note. NoteUpdatedBy []StringFilter - // The date/time that the process was launched. + // A timestamp that identifies when the process was launched. A correctly formatted + // example is 2020-05-21T20:16:34.724Z. The value cannot contain spaces, and date + // and time should be separated by T. For more information, see RFC 3339 section + // 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). ProcessLaunchedAt []DateFilter // The name of the process. @@ -10098,7 +10181,11 @@ type AwsSecurityFindingFilters struct { // The process ID. ProcessPid []NumberFilter - // The date/time that the process was terminated. + // A timestamp that identifies when the process was terminated. A correctly + // formatted example is 2020-05-21T20:16:34.724Z. The value cannot contain spaces, + // and date and time should be separated by T. For more information, see RFC 3339 + // section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). ProcessTerminatedAt []DateFilter // The ARN generated by Security Hub that uniquely identifies a third-party company @@ -10186,7 +10273,11 @@ type AwsSecurityFindingFilters struct { // The name of the image related to a finding. ResourceContainerImageName []StringFilter - // The date/time that the container was started. + // A timestamp that identifies when the container was started. A correctly + // formatted example is 2020-05-21T20:16:34.724Z. The value cannot contain spaces, + // and date and time should be separated by T. For more information, see RFC 3339 + // section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). ResourceContainerLaunchedAt []DateFilter // The name of the container related to a finding. @@ -10239,7 +10330,8 @@ type AwsSecurityFindingFilters struct { // The category of a threat intelligence indicator. ThreatIntelIndicatorCategory []StringFilter - // The date/time of the last observation of a threat intelligence indicator. + // A timestamp that identifies the last observation of a threat intelligence + // indicator. ThreatIntelIndicatorLastObservedAt []DateFilter // The source of the threat intelligence. @@ -10262,7 +10354,10 @@ type AwsSecurityFindingFilters struct { Type []StringFilter // An ISO8601-formatted timestamp that indicates when the security-findings - // provider last updated the finding record. + // provider last updated the finding record. A correctly formatted example is + // 2020-05-21T20:16:34.724Z. The value cannot contain spaces, and date and time + // should be separated by T. For more information, see RFC 3339 section 5.6, + // Internet Date/Time Format (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). UpdatedAt []DateFilter // A list of name/value string pairs associated with the finding. These are custom, @@ -11490,7 +11585,8 @@ type ContainerDetails struct { // Indicates when the container started. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LaunchedAt *string // The name of the container related to a finding. @@ -11588,10 +11684,18 @@ type DateFilter struct { // A date range for the date filter. DateRange *DateRange - // An end date for the date filter. + // A timestamp that provides the end date for the date filter. A correctly + // formatted example is 2020-05-21T20:16:34.724Z. The value cannot contain spaces, + // and date and time should be separated by T. For more information, see RFC 3339 + // section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). End *string - // A start date for the date filter. + // A timestamp that provides the start date for the date filter. A correctly + // formatted example is 2020-05-21T20:16:34.724Z. The value cannot contain spaces, + // and date and time should be separated by T. For more information, see RFC 3339 + // section 5.6, Internet Date/Time Format + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). Start *string noSmithyDocumentSerde @@ -12210,7 +12314,8 @@ type Note struct { // The timestamp of when the note was updated. Uses the date-time format specified // in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. // // This member is required. UpdatedAt *string @@ -12338,13 +12443,15 @@ type PatchSummary struct { // Indicates when the operation completed. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. OperationEndTime *string // Indicates when the operation started. Uses the date-time format specified in RFC // 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. OperationStartTime *string // The reboot option specified for the instance. @@ -12413,7 +12520,8 @@ type ProcessDetails struct { // Indicates when the process was launched. Uses the date-time format specified in // RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LaunchedAt *string // The name of the process. @@ -12431,7 +12539,8 @@ type ProcessDetails struct { // Indicates when the process was terminated. Uses the date-time format specified // in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. TerminatedAt *string noSmithyDocumentSerde @@ -13662,7 +13771,8 @@ type ThreatIntelIndicator struct { // Indicates when the most recent instance of a threat intelligence indicator was // observed. Uses the date-time format specified in RFC 3339 section 5.6, Internet // Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6). The value - // cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. + // cannot contain spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. LastObservedAt *string // The source of the threat intelligence indicator. @@ -13785,7 +13895,8 @@ type VulnerabilityVendor struct { // Indicates when the vulnerability advisory was created. Uses the date-time format // specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. VendorCreatedAt *string // The severity that the vendor assigned to the vulnerability. @@ -13794,7 +13905,8 @@ type VulnerabilityVendor struct { // Indicates when the vulnerability advisory was last updated. Uses the date-time // format specified in RFC 3339 section 5.6, Internet Date/Time Format // (https://tools.ietf.org/html/rfc3339#section-5.6). The value cannot contain - // spaces. For example, 2020-03-22T13:22:13.933Z. + // spaces, and date and time should be separated by T. For example, + // 2020-03-22T13:22:13.933Z. VendorUpdatedAt *string noSmithyDocumentSerde diff --git a/service/tnb/LICENSE.txt b/service/tnb/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/tnb/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/tnb/api_client.go b/service/tnb/api_client.go new file mode 100644 index 00000000000..8940c69a559 --- /dev/null +++ b/service/tnb/api_client.go @@ -0,0 +1,434 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "tnb" +const ServiceAPIVersion = "2008-10-21" + +// Client provides the API client to make operations call for AWS Telco Network +// Builder. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "tnb", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/tnb/api_client_test.go b/service/tnb/api_client_test.go new file mode 100644 index 00000000000..7f03ac66783 --- /dev/null +++ b/service/tnb/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/tnb/api_op_CancelSolNetworkOperation.go b/service/tnb/api_op_CancelSolNetworkOperation.go new file mode 100644 index 00000000000..6c531661354 --- /dev/null +++ b/service/tnb/api_op_CancelSolNetworkOperation.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Cancels a network operation. A network operation is any operation that is done +// to your network, such as network instance instantiation or termination. +func (c *Client) CancelSolNetworkOperation(ctx context.Context, params *CancelSolNetworkOperationInput, optFns ...func(*Options)) (*CancelSolNetworkOperationOutput, error) { + if params == nil { + params = &CancelSolNetworkOperationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelSolNetworkOperation", params, optFns, c.addOperationCancelSolNetworkOperationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelSolNetworkOperationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelSolNetworkOperationInput struct { + + // The ID of a network operation occurrence. + // + // This member is required. + NsLcmOpOccId *string + + noSmithyDocumentSerde +} + +type CancelSolNetworkOperationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCancelSolNetworkOperationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelSolNetworkOperation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelSolNetworkOperation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCancelSolNetworkOperationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelSolNetworkOperation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCancelSolNetworkOperation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "CancelSolNetworkOperation", + } +} diff --git a/service/tnb/api_op_CreateSolFunctionPackage.go b/service/tnb/api_op_CreateSolFunctionPackage.go new file mode 100644 index 00000000000..9af3f555cae --- /dev/null +++ b/service/tnb/api_op_CreateSolFunctionPackage.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a function package. A function package is a .zip file in CSAR (Cloud +// Service Archive) format that contains a network function (an ETSI standard +// telecommunication application) and function package descriptor that uses the +// TOSCA standard to describe how the network functions should run on your network. +// For more information, see Function packages +// (https://docs.aws.amazon.com/tnb/latest/ug/function-packages.html) in the Amazon +// Web Services Telco Network Builder User Guide. Creating a function package is +// the first step for creating a network in AWS TNB. This request creates an empty +// container with an ID. The next step is to upload the actual CSAR zip file into +// that empty container. To upload function package content, see +// PutSolFunctionPackageContent +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_PutSolFunctionPackageContent.html). +func (c *Client) CreateSolFunctionPackage(ctx context.Context, params *CreateSolFunctionPackageInput, optFns ...func(*Options)) (*CreateSolFunctionPackageOutput, error) { + if params == nil { + params = &CreateSolFunctionPackageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSolFunctionPackage", params, optFns, c.addOperationCreateSolFunctionPackageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSolFunctionPackageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSolFunctionPackageInput struct { + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateSolFunctionPackageOutput struct { + + // Function package ARN. + // + // This member is required. + Arn *string + + // ID of the function package. + // + // This member is required. + Id *string + + // Onboarding state of the function package. + // + // This member is required. + OnboardingState types.OnboardingState + + // Operational state of the function package. + // + // This member is required. + OperationalState types.OperationalState + + // Usage state of the function package. + // + // This member is required. + UsageState types.UsageState + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSolFunctionPackageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSolFunctionPackage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSolFunctionPackage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSolFunctionPackage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSolFunctionPackage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "CreateSolFunctionPackage", + } +} diff --git a/service/tnb/api_op_CreateSolNetworkInstance.go b/service/tnb/api_op_CreateSolNetworkInstance.go new file mode 100644 index 00000000000..cac1d84aa2e --- /dev/null +++ b/service/tnb/api_op_CreateSolNetworkInstance.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a network instance. A network instance is a single network created in +// Amazon Web Services TNB that can be deployed and on which life-cycle operations +// (like terminate, update, and delete) can be performed. Creating a network +// instance is the third step after creating a network package. For more +// information about network instances, Network instances +// (https://docs.aws.amazon.com/tnb/latest/ug/network-instances.html) in the Amazon +// Web Services Telco Network Builder User Guide. Once you create a network +// instance, you can instantiate it. To instantiate a network, see +// InstantiateSolNetworkInstance +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_InstantiateSolNetworkInstance.html). +func (c *Client) CreateSolNetworkInstance(ctx context.Context, params *CreateSolNetworkInstanceInput, optFns ...func(*Options)) (*CreateSolNetworkInstanceOutput, error) { + if params == nil { + params = &CreateSolNetworkInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSolNetworkInstance", params, optFns, c.addOperationCreateSolNetworkInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSolNetworkInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSolNetworkInstanceInput struct { + + // Network instance name. + // + // This member is required. + NsName *string + + // ID for network service descriptor. + // + // This member is required. + NsdInfoId *string + + // Network instance description. + NsDescription *string + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateSolNetworkInstanceOutput struct { + + // Network instance ARN. + // + // This member is required. + Arn *string + + // Network instance ID. + // + // This member is required. + Id *string + + // Network instance name. + // + // This member is required. + NsInstanceName *string + + // Network service descriptor ID. + // + // This member is required. + NsdInfoId *string + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSolNetworkInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateSolNetworkInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSolNetworkInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSolNetworkInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "CreateSolNetworkInstance", + } +} diff --git a/service/tnb/api_op_CreateSolNetworkPackage.go b/service/tnb/api_op_CreateSolNetworkPackage.go new file mode 100644 index 00000000000..ee24d2783ab --- /dev/null +++ b/service/tnb/api_op_CreateSolNetworkPackage.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a network package. A network package is a .zip file in CSAR (Cloud +// Service Archive) format defines the function packages you want to deploy and the +// Amazon Web Services infrastructure you want to deploy them on. For more +// information, see Network instances +// (https://docs.aws.amazon.com/tnb/latest/ug/network-instances.html) in the Amazon +// Web Services Telco Network Builder User Guide. A network package consists of a +// network service descriptor (NSD) file (required) and any additional files +// (optional), such as scripts specific to your needs. For example, if you have +// multiple function packages in your network package, you can use the NSD to +// define which network functions should run in certain VPCs, subnets, or EKS +// clusters. This request creates an empty network package container with an ID. +// Once you create a network package, you can upload the network package content +// using PutSolNetworkPackageContent +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_PutSolNetworkPackageContent.html). +func (c *Client) CreateSolNetworkPackage(ctx context.Context, params *CreateSolNetworkPackageInput, optFns ...func(*Options)) (*CreateSolNetworkPackageOutput, error) { + if params == nil { + params = &CreateSolNetworkPackageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSolNetworkPackage", params, optFns, c.addOperationCreateSolNetworkPackageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSolNetworkPackageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSolNetworkPackageInput struct { + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateSolNetworkPackageOutput struct { + + // Network package ARN. + // + // This member is required. + Arn *string + + // ID of the network package. + // + // This member is required. + Id *string + + // Onboarding state of the network service descriptor in the network package. + // + // This member is required. + NsdOnboardingState types.NsdOnboardingState + + // Operational state of the network service descriptor in the network package. + // + // This member is required. + NsdOperationalState types.NsdOperationalState + + // Usage state of the network service descriptor in the network package. + // + // This member is required. + NsdUsageState types.NsdUsageState + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSolNetworkPackageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSolNetworkPackage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSolNetworkPackage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSolNetworkPackage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSolNetworkPackage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "CreateSolNetworkPackage", + } +} diff --git a/service/tnb/api_op_DeleteSolFunctionPackage.go b/service/tnb/api_op_DeleteSolFunctionPackage.go new file mode 100644 index 00000000000..2bf0edc32c4 --- /dev/null +++ b/service/tnb/api_op_DeleteSolFunctionPackage.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a function package. A function package is a .zip file in CSAR (Cloud +// Service Archive) format that contains a network function (an ETSI standard +// telecommunication application) and function package descriptor that uses the +// TOSCA standard to describe how the network functions should run on your network. +// To delete a function package, the package must be in a disabled state. To +// disable a function package, see UpdateSolFunctionPackage +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_UpdateSolFunctionPackage.html). +func (c *Client) DeleteSolFunctionPackage(ctx context.Context, params *DeleteSolFunctionPackageInput, optFns ...func(*Options)) (*DeleteSolFunctionPackageOutput, error) { + if params == nil { + params = &DeleteSolFunctionPackageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSolFunctionPackage", params, optFns, c.addOperationDeleteSolFunctionPackageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSolFunctionPackageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSolFunctionPackageInput struct { + + // ID of the function package. + // + // This member is required. + VnfPkgId *string + + noSmithyDocumentSerde +} + +type DeleteSolFunctionPackageOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSolFunctionPackageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSolFunctionPackage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSolFunctionPackage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSolFunctionPackageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSolFunctionPackage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSolFunctionPackage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "DeleteSolFunctionPackage", + } +} diff --git a/service/tnb/api_op_DeleteSolNetworkInstance.go b/service/tnb/api_op_DeleteSolNetworkInstance.go new file mode 100644 index 00000000000..9b4542e6aab --- /dev/null +++ b/service/tnb/api_op_DeleteSolNetworkInstance.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a network instance. A network instance is a single network created in +// Amazon Web Services TNB that can be deployed and on which life-cycle operations +// (like terminate, update, and delete) can be performed. To delete a network +// instance, the instance must be in a stopped or terminated state. To terminate a +// network instance, see TerminateSolNetworkInstance +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_TerminateSolNetworkInstance.html). +func (c *Client) DeleteSolNetworkInstance(ctx context.Context, params *DeleteSolNetworkInstanceInput, optFns ...func(*Options)) (*DeleteSolNetworkInstanceOutput, error) { + if params == nil { + params = &DeleteSolNetworkInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSolNetworkInstance", params, optFns, c.addOperationDeleteSolNetworkInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSolNetworkInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSolNetworkInstanceInput struct { + + // Network instance ID. + // + // This member is required. + NsInstanceId *string + + noSmithyDocumentSerde +} + +type DeleteSolNetworkInstanceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSolNetworkInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSolNetworkInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSolNetworkInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSolNetworkInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "DeleteSolNetworkInstance", + } +} diff --git a/service/tnb/api_op_DeleteSolNetworkPackage.go b/service/tnb/api_op_DeleteSolNetworkPackage.go new file mode 100644 index 00000000000..eac738430d9 --- /dev/null +++ b/service/tnb/api_op_DeleteSolNetworkPackage.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes network package. A network package is a .zip file in CSAR (Cloud Service +// Archive) format defines the function packages you want to deploy and the Amazon +// Web Services infrastructure you want to deploy them on. To delete a network +// package, the package must be in a disable state. To disable a network package, +// see UpdateSolNetworkPackage +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_UpdateSolNetworkPackage.html). +func (c *Client) DeleteSolNetworkPackage(ctx context.Context, params *DeleteSolNetworkPackageInput, optFns ...func(*Options)) (*DeleteSolNetworkPackageOutput, error) { + if params == nil { + params = &DeleteSolNetworkPackageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSolNetworkPackage", params, optFns, c.addOperationDeleteSolNetworkPackageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSolNetworkPackageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSolNetworkPackageInput struct { + + // ID of the network service descriptor in the network package. + // + // This member is required. + NsdInfoId *string + + noSmithyDocumentSerde +} + +type DeleteSolNetworkPackageOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSolNetworkPackageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSolNetworkPackage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSolNetworkPackage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSolNetworkPackageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSolNetworkPackage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSolNetworkPackage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "DeleteSolNetworkPackage", + } +} diff --git a/service/tnb/api_op_GetSolFunctionInstance.go b/service/tnb/api_op_GetSolFunctionInstance.go new file mode 100644 index 00000000000..12aa2620906 --- /dev/null +++ b/service/tnb/api_op_GetSolFunctionInstance.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the details of a network function instance, including the instantation +// state and metadata from the function package descriptor in the network function +// package. A network function instance is a function in a function package . +func (c *Client) GetSolFunctionInstance(ctx context.Context, params *GetSolFunctionInstanceInput, optFns ...func(*Options)) (*GetSolFunctionInstanceOutput, error) { + if params == nil { + params = &GetSolFunctionInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolFunctionInstance", params, optFns, c.addOperationGetSolFunctionInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolFunctionInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolFunctionInstanceInput struct { + + // ID of the network function. + // + // This member is required. + VnfInstanceId *string + + noSmithyDocumentSerde +} + +type GetSolFunctionInstanceOutput struct { + + // Network function instance ARN. + // + // This member is required. + Arn *string + + // Network function instance ID. + // + // This member is required. + Id *string + + // Network function instantiation state. + // + // This member is required. + InstantiationState types.VnfInstantiationState + + // The metadata of a network function instance. A network function instance is a + // function in a function package . + // + // This member is required. + Metadata *types.GetSolFunctionInstanceMetadata + + // Network instance ID. + // + // This member is required. + NsInstanceId *string + + // Function package ID. + // + // This member is required. + VnfPkgId *string + + // Function package descriptor ID. + // + // This member is required. + VnfdId *string + + // Information about the network function. A network function instance is a + // function in a function package . + InstantiatedVnfInfo *types.GetSolVnfInfo + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + // Network function product name. + VnfProductName *string + + // Network function provider. + VnfProvider *string + + // Function package descriptor version. + VnfdVersion *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolFunctionInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolFunctionInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolFunctionInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolFunctionInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolFunctionInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolFunctionInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolFunctionInstance", + } +} diff --git a/service/tnb/api_op_GetSolFunctionPackage.go b/service/tnb/api_op_GetSolFunctionPackage.go new file mode 100644 index 00000000000..93abacb829d --- /dev/null +++ b/service/tnb/api_op_GetSolFunctionPackage.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the details of an individual function package, such as the operational +// state and whether the package is in use. A function package is a .zip file in +// CSAR (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network.. +func (c *Client) GetSolFunctionPackage(ctx context.Context, params *GetSolFunctionPackageInput, optFns ...func(*Options)) (*GetSolFunctionPackageOutput, error) { + if params == nil { + params = &GetSolFunctionPackageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolFunctionPackage", params, optFns, c.addOperationGetSolFunctionPackageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolFunctionPackageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolFunctionPackageInput struct { + + // ID of the function package. + // + // This member is required. + VnfPkgId *string + + noSmithyDocumentSerde +} + +type GetSolFunctionPackageOutput struct { + + // Function package ARN. + // + // This member is required. + Arn *string + + // Function package ID. + // + // This member is required. + Id *string + + // Function package onboarding state. + // + // This member is required. + OnboardingState types.OnboardingState + + // Function package operational state. + // + // This member is required. + OperationalState types.OperationalState + + // Function package usage state. + // + // This member is required. + UsageState types.UsageState + + // Metadata related to the function package. A function package is a .zip file in + // CSAR (Cloud Service Archive) format that contains a network function (an ETSI + // standard telecommunication application) and function package descriptor that + // uses the TOSCA standard to describe how the network functions should run on your + // network. + Metadata *types.GetSolFunctionPackageMetadata + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + // Network function product name. + VnfProductName *string + + // Network function provider. + VnfProvider *string + + // Function package descriptor ID. + VnfdId *string + + // Function package descriptor version. + VnfdVersion *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolFunctionPackageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolFunctionPackage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolFunctionPackage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolFunctionPackageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolFunctionPackage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolFunctionPackage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolFunctionPackage", + } +} diff --git a/service/tnb/api_op_GetSolFunctionPackageContent.go b/service/tnb/api_op_GetSolFunctionPackageContent.go new file mode 100644 index 00000000000..1d05542fee3 --- /dev/null +++ b/service/tnb/api_op_GetSolFunctionPackageContent.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the contents of a function package. A function package is a .zip file in +// CSAR (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network. +func (c *Client) GetSolFunctionPackageContent(ctx context.Context, params *GetSolFunctionPackageContentInput, optFns ...func(*Options)) (*GetSolFunctionPackageContentOutput, error) { + if params == nil { + params = &GetSolFunctionPackageContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolFunctionPackageContent", params, optFns, c.addOperationGetSolFunctionPackageContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolFunctionPackageContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolFunctionPackageContentInput struct { + + // The format of the package that you want to download from the function packages. + // + // This member is required. + Accept types.PackageContentType + + // ID of the function package. + // + // This member is required. + VnfPkgId *string + + noSmithyDocumentSerde +} + +type GetSolFunctionPackageContentOutput struct { + + // Indicates the media type of the resource. + ContentType types.PackageContentType + + // Contents of the function package. + PackageContent []byte + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolFunctionPackageContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolFunctionPackageContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolFunctionPackageContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolFunctionPackageContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolFunctionPackageContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolFunctionPackageContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolFunctionPackageContent", + } +} diff --git a/service/tnb/api_op_GetSolFunctionPackageDescriptor.go b/service/tnb/api_op_GetSolFunctionPackageDescriptor.go new file mode 100644 index 00000000000..bb02073a88b --- /dev/null +++ b/service/tnb/api_op_GetSolFunctionPackageDescriptor.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets a function package descriptor in a function package. A function package +// descriptor is a .yaml file in a function package that uses the TOSCA standard to +// describe how the network function in the function package should run on your +// network. A function package is a .zip file in CSAR (Cloud Service Archive) +// format that contains a network function (an ETSI standard telecommunication +// application) and function package descriptor that uses the TOSCA standard to +// describe how the network functions should run on your network. +func (c *Client) GetSolFunctionPackageDescriptor(ctx context.Context, params *GetSolFunctionPackageDescriptorInput, optFns ...func(*Options)) (*GetSolFunctionPackageDescriptorOutput, error) { + if params == nil { + params = &GetSolFunctionPackageDescriptorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolFunctionPackageDescriptor", params, optFns, c.addOperationGetSolFunctionPackageDescriptorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolFunctionPackageDescriptorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolFunctionPackageDescriptorInput struct { + + // Indicates which content types, expressed as MIME types, the client is able to + // understand. + // + // This member is required. + Accept types.DescriptorContentType + + // ID of the function package. + // + // This member is required. + VnfPkgId *string + + noSmithyDocumentSerde +} + +type GetSolFunctionPackageDescriptorOutput struct { + + // Indicates the media type of the resource. + ContentType types.DescriptorContentType + + // Contents of the function package descriptor. + Vnfd []byte + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolFunctionPackageDescriptorMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolFunctionPackageDescriptor{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolFunctionPackageDescriptor{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolFunctionPackageDescriptorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolFunctionPackageDescriptor(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolFunctionPackageDescriptor(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolFunctionPackageDescriptor", + } +} diff --git a/service/tnb/api_op_GetSolNetworkInstance.go b/service/tnb/api_op_GetSolNetworkInstance.go new file mode 100644 index 00000000000..eb0abedb626 --- /dev/null +++ b/service/tnb/api_op_GetSolNetworkInstance.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the details of the network instance. A network instance is a single network +// created in Amazon Web Services TNB that can be deployed and on which life-cycle +// operations (like terminate, update, and delete) can be performed. +func (c *Client) GetSolNetworkInstance(ctx context.Context, params *GetSolNetworkInstanceInput, optFns ...func(*Options)) (*GetSolNetworkInstanceOutput, error) { + if params == nil { + params = &GetSolNetworkInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolNetworkInstance", params, optFns, c.addOperationGetSolNetworkInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolNetworkInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolNetworkInstanceInput struct { + + // ID of the network instance. + // + // This member is required. + NsInstanceId *string + + noSmithyDocumentSerde +} + +type GetSolNetworkInstanceOutput struct { + + // Network instance ARN. + // + // This member is required. + Arn *string + + // Network instance ID. + // + // This member is required. + Id *string + + // The metadata of a network instance. A network instance is a single network + // created in Amazon Web Services TNB that can be deployed and on which life-cycle + // operations (like terminate, update, and delete) can be performed. + // + // This member is required. + Metadata *types.GetSolNetworkInstanceMetadata + + // Network instance description. + // + // This member is required. + NsInstanceDescription *string + + // Network instance name. + // + // This member is required. + NsInstanceName *string + + // Network service descriptor ID. + // + // This member is required. + NsdId *string + + // Network service descriptor info ID. + // + // This member is required. + NsdInfoId *string + + // Lifecycle management operation details on the network instance. Lifecycle + // management operations are deploy, update, or delete operations. + LcmOpInfo *types.LcmOperationInfo + + // Network instance state. + NsState types.NsState + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolNetworkInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolNetworkInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolNetworkInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolNetworkInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolNetworkInstance", + } +} diff --git a/service/tnb/api_op_GetSolNetworkOperation.go b/service/tnb/api_op_GetSolNetworkOperation.go new file mode 100644 index 00000000000..9668f716d64 --- /dev/null +++ b/service/tnb/api_op_GetSolNetworkOperation.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the details of a network operation, including the tasks involved in the +// network operation and the status of the tasks. A network operation is any +// operation that is done to your network, such as network instance instantiation +// or termination. +func (c *Client) GetSolNetworkOperation(ctx context.Context, params *GetSolNetworkOperationInput, optFns ...func(*Options)) (*GetSolNetworkOperationOutput, error) { + if params == nil { + params = &GetSolNetworkOperationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolNetworkOperation", params, optFns, c.addOperationGetSolNetworkOperationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolNetworkOperationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolNetworkOperationInput struct { + + // The identifier of the operation occurrence. + // + // This member is required. + NsLcmOpOccId *string + + noSmithyDocumentSerde +} + +type GetSolNetworkOperationOutput struct { + + // Network operation ARN. + // + // This member is required. + Arn *string + + // Error related to this specific network operation occurence. + Error *types.ProblemDetails + + // ID of this network operation occurrence. + Id *string + + // Type of the operation represented by this occurrence. + LcmOperationType types.LcmOperationType + + // Metadata of this network operation occurrence. + Metadata *types.GetSolNetworkOperationMetadata + + // ID of the network operation instance. + NsInstanceId *string + + // The state of the network operation. + OperationState types.NsLcmOperationState + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + // All tasks associated with this operation occurrence. + Tasks []types.GetSolNetworkOperationTaskDetails + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolNetworkOperationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolNetworkOperation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolNetworkOperation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolNetworkOperationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolNetworkOperation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolNetworkOperation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolNetworkOperation", + } +} diff --git a/service/tnb/api_op_GetSolNetworkPackage.go b/service/tnb/api_op_GetSolNetworkPackage.go new file mode 100644 index 00000000000..57d9aee2ccc --- /dev/null +++ b/service/tnb/api_op_GetSolNetworkPackage.go @@ -0,0 +1,178 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the details of a network package. A network package is a .zip file in CSAR +// (Cloud Service Archive) format defines the function packages you want to deploy +// and the Amazon Web Services infrastructure you want to deploy them on. +func (c *Client) GetSolNetworkPackage(ctx context.Context, params *GetSolNetworkPackageInput, optFns ...func(*Options)) (*GetSolNetworkPackageOutput, error) { + if params == nil { + params = &GetSolNetworkPackageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolNetworkPackage", params, optFns, c.addOperationGetSolNetworkPackageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolNetworkPackageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolNetworkPackageInput struct { + + // ID of the network service descriptor in the network package. + // + // This member is required. + NsdInfoId *string + + noSmithyDocumentSerde +} + +type GetSolNetworkPackageOutput struct { + + // Network package ARN. + // + // This member is required. + Arn *string + + // Network package ID. + // + // This member is required. + Id *string + + // Metadata associated with a network package. A network package is a .zip file in + // CSAR (Cloud Service Archive) format defines the function packages you want to + // deploy and the Amazon Web Services infrastructure you want to deploy them on. + // + // This member is required. + Metadata *types.GetSolNetworkPackageMetadata + + // Network service descriptor ID. + // + // This member is required. + NsdId *string + + // Network service descriptor name. + // + // This member is required. + NsdName *string + + // Network service descriptor onboarding state. + // + // This member is required. + NsdOnboardingState types.NsdOnboardingState + + // Network service descriptor operational state. + // + // This member is required. + NsdOperationalState types.NsdOperationalState + + // Network service descriptor usage state. + // + // This member is required. + NsdUsageState types.NsdUsageState + + // Network service descriptor version. + // + // This member is required. + NsdVersion *string + + // Identifies the function package for the function package descriptor referenced + // by the onboarded network package. + // + // This member is required. + VnfPkgIds []string + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolNetworkPackageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolNetworkPackage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolNetworkPackage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolNetworkPackageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolNetworkPackage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolNetworkPackage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolNetworkPackage", + } +} diff --git a/service/tnb/api_op_GetSolNetworkPackageContent.go b/service/tnb/api_op_GetSolNetworkPackageContent.go new file mode 100644 index 00000000000..29117fb3098 --- /dev/null +++ b/service/tnb/api_op_GetSolNetworkPackageContent.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the contents of a network package. A network package is a .zip file in CSAR +// (Cloud Service Archive) format defines the function packages you want to deploy +// and the Amazon Web Services infrastructure you want to deploy them on. +func (c *Client) GetSolNetworkPackageContent(ctx context.Context, params *GetSolNetworkPackageContentInput, optFns ...func(*Options)) (*GetSolNetworkPackageContentOutput, error) { + if params == nil { + params = &GetSolNetworkPackageContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolNetworkPackageContent", params, optFns, c.addOperationGetSolNetworkPackageContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolNetworkPackageContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolNetworkPackageContentInput struct { + + // The format of the package you want to download from the network package. + // + // This member is required. + Accept types.PackageContentType + + // ID of the network service descriptor in the network package. + // + // This member is required. + NsdInfoId *string + + noSmithyDocumentSerde +} + +type GetSolNetworkPackageContentOutput struct { + + // Indicates the media type of the resource. + ContentType types.PackageContentType + + // Content of the network service descriptor in the network package. + NsdContent []byte + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolNetworkPackageContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolNetworkPackageContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolNetworkPackageContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolNetworkPackageContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolNetworkPackageContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolNetworkPackageContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolNetworkPackageContent", + } +} diff --git a/service/tnb/api_op_GetSolNetworkPackageDescriptor.go b/service/tnb/api_op_GetSolNetworkPackageDescriptor.go new file mode 100644 index 00000000000..fed7f53959a --- /dev/null +++ b/service/tnb/api_op_GetSolNetworkPackageDescriptor.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the content of the network service descriptor. A network service descriptor +// is a .yaml file in a network package that uses the TOSCA standard to describe +// the network functions you want to deploy and the Amazon Web Services +// infrastructure you want to deploy the network functions on. +func (c *Client) GetSolNetworkPackageDescriptor(ctx context.Context, params *GetSolNetworkPackageDescriptorInput, optFns ...func(*Options)) (*GetSolNetworkPackageDescriptorOutput, error) { + if params == nil { + params = &GetSolNetworkPackageDescriptorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSolNetworkPackageDescriptor", params, optFns, c.addOperationGetSolNetworkPackageDescriptorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSolNetworkPackageDescriptorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSolNetworkPackageDescriptorInput struct { + + // ID of the network service descriptor in the network package. + // + // This member is required. + NsdInfoId *string + + noSmithyDocumentSerde +} + +type GetSolNetworkPackageDescriptorOutput struct { + + // Indicates the media type of the resource. + ContentType types.DescriptorContentType + + // Contents of the network service descriptor in the network package. + Nsd []byte + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSolNetworkPackageDescriptorMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSolNetworkPackageDescriptor{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSolNetworkPackageDescriptor{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSolNetworkPackageDescriptorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSolNetworkPackageDescriptor(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSolNetworkPackageDescriptor(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "GetSolNetworkPackageDescriptor", + } +} diff --git a/service/tnb/api_op_InstantiateSolNetworkInstance.go b/service/tnb/api_op_InstantiateSolNetworkInstance.go new file mode 100644 index 00000000000..b140fa6ea1b --- /dev/null +++ b/service/tnb/api_op_InstantiateSolNetworkInstance.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/document" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Instantiates a network instance. A network instance is a single network created +// in Amazon Web Services TNB that can be deployed and on which life-cycle +// operations (like terminate, update, and delete) can be performed. Before you can +// instantiate a network instance, you have to create a network instance. For more +// information, see CreateSolNetworkInstance +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_CreateSolNetworkInstance.html). +func (c *Client) InstantiateSolNetworkInstance(ctx context.Context, params *InstantiateSolNetworkInstanceInput, optFns ...func(*Options)) (*InstantiateSolNetworkInstanceOutput, error) { + if params == nil { + params = &InstantiateSolNetworkInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "InstantiateSolNetworkInstance", params, optFns, c.addOperationInstantiateSolNetworkInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*InstantiateSolNetworkInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type InstantiateSolNetworkInstanceInput struct { + + // ID of the network instance. + // + // This member is required. + NsInstanceId *string + + // Provides values for the configurable properties. + AdditionalParamsForNs document.Interface + + // A check for whether you have the required permissions for the action without + // actually making the request and provides an error response. If you have the + // required permissions, the error response is DryRunOperation. Otherwise, it is + // UnauthorizedOperation. + DryRun *bool + + noSmithyDocumentSerde +} + +type InstantiateSolNetworkInstanceOutput struct { + + // The identifier of the network instance. + // + // This member is required. + NsLcmOpOccId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationInstantiateSolNetworkInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpInstantiateSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpInstantiateSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpInstantiateSolNetworkInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInstantiateSolNetworkInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opInstantiateSolNetworkInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "InstantiateSolNetworkInstance", + } +} diff --git a/service/tnb/api_op_ListSolFunctionInstances.go b/service/tnb/api_op_ListSolFunctionInstances.go new file mode 100644 index 00000000000..e9d485d6e60 --- /dev/null +++ b/service/tnb/api_op_ListSolFunctionInstances.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists network function instances. A network function instance is a function in a +// function package . +func (c *Client) ListSolFunctionInstances(ctx context.Context, params *ListSolFunctionInstancesInput, optFns ...func(*Options)) (*ListSolFunctionInstancesOutput, error) { + if params == nil { + params = &ListSolFunctionInstancesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSolFunctionInstances", params, optFns, c.addOperationListSolFunctionInstancesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSolFunctionInstancesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSolFunctionInstancesInput struct { + + // The maximum number of results to include in the response. + MaxResults *int32 + + // The token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSolFunctionInstancesOutput struct { + + // Network function instances. + FunctionInstances []types.ListSolFunctionInstanceInfo + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSolFunctionInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSolFunctionInstances{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSolFunctionInstances{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSolFunctionInstances(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSolFunctionInstancesAPIClient is a client that implements the +// ListSolFunctionInstances operation. +type ListSolFunctionInstancesAPIClient interface { + ListSolFunctionInstances(context.Context, *ListSolFunctionInstancesInput, ...func(*Options)) (*ListSolFunctionInstancesOutput, error) +} + +var _ ListSolFunctionInstancesAPIClient = (*Client)(nil) + +// ListSolFunctionInstancesPaginatorOptions is the paginator options for +// ListSolFunctionInstances +type ListSolFunctionInstancesPaginatorOptions struct { + // The maximum number of results to include in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSolFunctionInstancesPaginator is a paginator for ListSolFunctionInstances +type ListSolFunctionInstancesPaginator struct { + options ListSolFunctionInstancesPaginatorOptions + client ListSolFunctionInstancesAPIClient + params *ListSolFunctionInstancesInput + nextToken *string + firstPage bool +} + +// NewListSolFunctionInstancesPaginator returns a new +// ListSolFunctionInstancesPaginator +func NewListSolFunctionInstancesPaginator(client ListSolFunctionInstancesAPIClient, params *ListSolFunctionInstancesInput, optFns ...func(*ListSolFunctionInstancesPaginatorOptions)) *ListSolFunctionInstancesPaginator { + if params == nil { + params = &ListSolFunctionInstancesInput{} + } + + options := ListSolFunctionInstancesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSolFunctionInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolFunctionInstancesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSolFunctionInstances page. +func (p *ListSolFunctionInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolFunctionInstancesOutput, 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.ListSolFunctionInstances(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_opListSolFunctionInstances(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "ListSolFunctionInstances", + } +} diff --git a/service/tnb/api_op_ListSolFunctionPackages.go b/service/tnb/api_op_ListSolFunctionPackages.go new file mode 100644 index 00000000000..86d0629946a --- /dev/null +++ b/service/tnb/api_op_ListSolFunctionPackages.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists information about function packages. A function package is a .zip file in +// CSAR (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network. +func (c *Client) ListSolFunctionPackages(ctx context.Context, params *ListSolFunctionPackagesInput, optFns ...func(*Options)) (*ListSolFunctionPackagesOutput, error) { + if params == nil { + params = &ListSolFunctionPackagesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSolFunctionPackages", params, optFns, c.addOperationListSolFunctionPackagesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSolFunctionPackagesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSolFunctionPackagesInput struct { + + // The maximum number of results to include in the response. + MaxResults *int32 + + // The token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSolFunctionPackagesOutput struct { + + // Function packages. A function package is a .zip file in CSAR (Cloud Service + // Archive) format that contains a network function (an ETSI standard + // telecommunication application) and function package descriptor that uses the + // TOSCA standard to describe how the network functions should run on your network. + // + // This member is required. + FunctionPackages []types.ListSolFunctionPackageInfo + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSolFunctionPackagesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSolFunctionPackages{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSolFunctionPackages{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSolFunctionPackages(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSolFunctionPackagesAPIClient is a client that implements the +// ListSolFunctionPackages operation. +type ListSolFunctionPackagesAPIClient interface { + ListSolFunctionPackages(context.Context, *ListSolFunctionPackagesInput, ...func(*Options)) (*ListSolFunctionPackagesOutput, error) +} + +var _ ListSolFunctionPackagesAPIClient = (*Client)(nil) + +// ListSolFunctionPackagesPaginatorOptions is the paginator options for +// ListSolFunctionPackages +type ListSolFunctionPackagesPaginatorOptions struct { + // The maximum number of results to include in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSolFunctionPackagesPaginator is a paginator for ListSolFunctionPackages +type ListSolFunctionPackagesPaginator struct { + options ListSolFunctionPackagesPaginatorOptions + client ListSolFunctionPackagesAPIClient + params *ListSolFunctionPackagesInput + nextToken *string + firstPage bool +} + +// NewListSolFunctionPackagesPaginator returns a new +// ListSolFunctionPackagesPaginator +func NewListSolFunctionPackagesPaginator(client ListSolFunctionPackagesAPIClient, params *ListSolFunctionPackagesInput, optFns ...func(*ListSolFunctionPackagesPaginatorOptions)) *ListSolFunctionPackagesPaginator { + if params == nil { + params = &ListSolFunctionPackagesInput{} + } + + options := ListSolFunctionPackagesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSolFunctionPackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolFunctionPackagesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSolFunctionPackages page. +func (p *ListSolFunctionPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolFunctionPackagesOutput, 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.ListSolFunctionPackages(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_opListSolFunctionPackages(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "ListSolFunctionPackages", + } +} diff --git a/service/tnb/api_op_ListSolNetworkInstances.go b/service/tnb/api_op_ListSolNetworkInstances.go new file mode 100644 index 00000000000..a82c7798588 --- /dev/null +++ b/service/tnb/api_op_ListSolNetworkInstances.go @@ -0,0 +1,218 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists your network instances. A network instance is a single network created in +// Amazon Web Services TNB that can be deployed and on which life-cycle operations +// (like terminate, update, and delete) can be performed. +func (c *Client) ListSolNetworkInstances(ctx context.Context, params *ListSolNetworkInstancesInput, optFns ...func(*Options)) (*ListSolNetworkInstancesOutput, error) { + if params == nil { + params = &ListSolNetworkInstancesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSolNetworkInstances", params, optFns, c.addOperationListSolNetworkInstancesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSolNetworkInstancesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSolNetworkInstancesInput struct { + + // The maximum number of results to include in the response. + MaxResults *int32 + + // The token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSolNetworkInstancesOutput struct { + + // Lists network instances. + NetworkInstances []types.ListSolNetworkInstanceInfo + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSolNetworkInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSolNetworkInstances{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSolNetworkInstances{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSolNetworkInstances(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSolNetworkInstancesAPIClient is a client that implements the +// ListSolNetworkInstances operation. +type ListSolNetworkInstancesAPIClient interface { + ListSolNetworkInstances(context.Context, *ListSolNetworkInstancesInput, ...func(*Options)) (*ListSolNetworkInstancesOutput, error) +} + +var _ ListSolNetworkInstancesAPIClient = (*Client)(nil) + +// ListSolNetworkInstancesPaginatorOptions is the paginator options for +// ListSolNetworkInstances +type ListSolNetworkInstancesPaginatorOptions struct { + // The maximum number of results to include in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSolNetworkInstancesPaginator is a paginator for ListSolNetworkInstances +type ListSolNetworkInstancesPaginator struct { + options ListSolNetworkInstancesPaginatorOptions + client ListSolNetworkInstancesAPIClient + params *ListSolNetworkInstancesInput + nextToken *string + firstPage bool +} + +// NewListSolNetworkInstancesPaginator returns a new +// ListSolNetworkInstancesPaginator +func NewListSolNetworkInstancesPaginator(client ListSolNetworkInstancesAPIClient, params *ListSolNetworkInstancesInput, optFns ...func(*ListSolNetworkInstancesPaginatorOptions)) *ListSolNetworkInstancesPaginator { + if params == nil { + params = &ListSolNetworkInstancesInput{} + } + + options := ListSolNetworkInstancesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSolNetworkInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolNetworkInstancesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSolNetworkInstances page. +func (p *ListSolNetworkInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolNetworkInstancesOutput, 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.ListSolNetworkInstances(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_opListSolNetworkInstances(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "ListSolNetworkInstances", + } +} diff --git a/service/tnb/api_op_ListSolNetworkOperations.go b/service/tnb/api_op_ListSolNetworkOperations.go new file mode 100644 index 00000000000..4d3b2d8d5c1 --- /dev/null +++ b/service/tnb/api_op_ListSolNetworkOperations.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists details for a network operation, including when the operation started and +// the status of the operation. A network operation is any operation that is done +// to your network, such as network instance instantiation or termination. +func (c *Client) ListSolNetworkOperations(ctx context.Context, params *ListSolNetworkOperationsInput, optFns ...func(*Options)) (*ListSolNetworkOperationsOutput, error) { + if params == nil { + params = &ListSolNetworkOperationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSolNetworkOperations", params, optFns, c.addOperationListSolNetworkOperationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSolNetworkOperationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSolNetworkOperationsInput struct { + + // The maximum number of results to include in the response. + MaxResults *int32 + + // The token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSolNetworkOperationsOutput struct { + + // Lists network operation occurrences. Lifecycle management operations are deploy, + // update, or delete operations. + NetworkOperations []types.ListSolNetworkOperationsInfo + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSolNetworkOperationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSolNetworkOperations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSolNetworkOperations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSolNetworkOperations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSolNetworkOperationsAPIClient is a client that implements the +// ListSolNetworkOperations operation. +type ListSolNetworkOperationsAPIClient interface { + ListSolNetworkOperations(context.Context, *ListSolNetworkOperationsInput, ...func(*Options)) (*ListSolNetworkOperationsOutput, error) +} + +var _ ListSolNetworkOperationsAPIClient = (*Client)(nil) + +// ListSolNetworkOperationsPaginatorOptions is the paginator options for +// ListSolNetworkOperations +type ListSolNetworkOperationsPaginatorOptions struct { + // The maximum number of results to include in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSolNetworkOperationsPaginator is a paginator for ListSolNetworkOperations +type ListSolNetworkOperationsPaginator struct { + options ListSolNetworkOperationsPaginatorOptions + client ListSolNetworkOperationsAPIClient + params *ListSolNetworkOperationsInput + nextToken *string + firstPage bool +} + +// NewListSolNetworkOperationsPaginator returns a new +// ListSolNetworkOperationsPaginator +func NewListSolNetworkOperationsPaginator(client ListSolNetworkOperationsAPIClient, params *ListSolNetworkOperationsInput, optFns ...func(*ListSolNetworkOperationsPaginatorOptions)) *ListSolNetworkOperationsPaginator { + if params == nil { + params = &ListSolNetworkOperationsInput{} + } + + options := ListSolNetworkOperationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSolNetworkOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolNetworkOperationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSolNetworkOperations page. +func (p *ListSolNetworkOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolNetworkOperationsOutput, 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.ListSolNetworkOperations(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_opListSolNetworkOperations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "ListSolNetworkOperations", + } +} diff --git a/service/tnb/api_op_ListSolNetworkPackages.go b/service/tnb/api_op_ListSolNetworkPackages.go new file mode 100644 index 00000000000..96e98da8816 --- /dev/null +++ b/service/tnb/api_op_ListSolNetworkPackages.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists network packages. A network package is a .zip file in CSAR (Cloud Service +// Archive) format defines the function packages you want to deploy and the Amazon +// Web Services infrastructure you want to deploy them on. +func (c *Client) ListSolNetworkPackages(ctx context.Context, params *ListSolNetworkPackagesInput, optFns ...func(*Options)) (*ListSolNetworkPackagesOutput, error) { + if params == nil { + params = &ListSolNetworkPackagesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSolNetworkPackages", params, optFns, c.addOperationListSolNetworkPackagesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSolNetworkPackagesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSolNetworkPackagesInput struct { + + // The maximum number of results to include in the response. + MaxResults *int32 + + // The token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSolNetworkPackagesOutput struct { + + // Network packages. A network package is a .zip file in CSAR (Cloud Service + // Archive) format defines the function packages you want to deploy and the Amazon + // Web Services infrastructure you want to deploy them on. + // + // This member is required. + NetworkPackages []types.ListSolNetworkPackageInfo + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSolNetworkPackagesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSolNetworkPackages{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSolNetworkPackages{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSolNetworkPackages(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSolNetworkPackagesAPIClient is a client that implements the +// ListSolNetworkPackages operation. +type ListSolNetworkPackagesAPIClient interface { + ListSolNetworkPackages(context.Context, *ListSolNetworkPackagesInput, ...func(*Options)) (*ListSolNetworkPackagesOutput, error) +} + +var _ ListSolNetworkPackagesAPIClient = (*Client)(nil) + +// ListSolNetworkPackagesPaginatorOptions is the paginator options for +// ListSolNetworkPackages +type ListSolNetworkPackagesPaginatorOptions struct { + // The maximum number of results to include in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSolNetworkPackagesPaginator is a paginator for ListSolNetworkPackages +type ListSolNetworkPackagesPaginator struct { + options ListSolNetworkPackagesPaginatorOptions + client ListSolNetworkPackagesAPIClient + params *ListSolNetworkPackagesInput + nextToken *string + firstPage bool +} + +// NewListSolNetworkPackagesPaginator returns a new ListSolNetworkPackagesPaginator +func NewListSolNetworkPackagesPaginator(client ListSolNetworkPackagesAPIClient, params *ListSolNetworkPackagesInput, optFns ...func(*ListSolNetworkPackagesPaginatorOptions)) *ListSolNetworkPackagesPaginator { + if params == nil { + params = &ListSolNetworkPackagesInput{} + } + + options := ListSolNetworkPackagesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSolNetworkPackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolNetworkPackagesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSolNetworkPackages page. +func (p *ListSolNetworkPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolNetworkPackagesOutput, 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.ListSolNetworkPackages(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_opListSolNetworkPackages(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "ListSolNetworkPackages", + } +} diff --git a/service/tnb/api_op_ListTagsForResource.go b/service/tnb/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..2e09614c907 --- /dev/null +++ b/service/tnb/api_op_ListTagsForResource.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists tags for AWS TNB resources. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // Resource ARN. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + // + // This member is required. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "ListTagsForResource", + } +} diff --git a/service/tnb/api_op_PutSolFunctionPackageContent.go b/service/tnb/api_op_PutSolFunctionPackageContent.go new file mode 100644 index 00000000000..5d81f4fa39e --- /dev/null +++ b/service/tnb/api_op_PutSolFunctionPackageContent.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Uploads the contents of a function package. A function package is a .zip file in +// CSAR (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network. +func (c *Client) PutSolFunctionPackageContent(ctx context.Context, params *PutSolFunctionPackageContentInput, optFns ...func(*Options)) (*PutSolFunctionPackageContentOutput, error) { + if params == nil { + params = &PutSolFunctionPackageContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutSolFunctionPackageContent", params, optFns, c.addOperationPutSolFunctionPackageContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutSolFunctionPackageContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutSolFunctionPackageContentInput struct { + + // Function package file. + // + // This member is required. + File []byte + + // Function package ID. + // + // This member is required. + VnfPkgId *string + + // Function package content type. + ContentType types.PackageContentType + + noSmithyDocumentSerde +} + +type PutSolFunctionPackageContentOutput struct { + + // Function package ID. + // + // This member is required. + Id *string + + // Function package metadata. + // + // This member is required. + Metadata *types.PutSolFunctionPackageContentMetadata + + // Function product name. + // + // This member is required. + VnfProductName *string + + // Function provider. + // + // This member is required. + VnfProvider *string + + // Function package descriptor ID. + // + // This member is required. + VnfdId *string + + // Function package descriptor version. + // + // This member is required. + VnfdVersion *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutSolFunctionPackageContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSolFunctionPackageContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSolFunctionPackageContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutSolFunctionPackageContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSolFunctionPackageContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutSolFunctionPackageContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "PutSolFunctionPackageContent", + } +} diff --git a/service/tnb/api_op_PutSolNetworkPackageContent.go b/service/tnb/api_op_PutSolNetworkPackageContent.go new file mode 100644 index 00000000000..757f7f19b26 --- /dev/null +++ b/service/tnb/api_op_PutSolNetworkPackageContent.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Uploads the contents of a network package. A network package is a .zip file in +// CSAR (Cloud Service Archive) format defines the function packages you want to +// deploy and the Amazon Web Services infrastructure you want to deploy them on. +func (c *Client) PutSolNetworkPackageContent(ctx context.Context, params *PutSolNetworkPackageContentInput, optFns ...func(*Options)) (*PutSolNetworkPackageContentOutput, error) { + if params == nil { + params = &PutSolNetworkPackageContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutSolNetworkPackageContent", params, optFns, c.addOperationPutSolNetworkPackageContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutSolNetworkPackageContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutSolNetworkPackageContentInput struct { + + // Network package file. + // + // This member is required. + File []byte + + // Network service descriptor info ID. + // + // This member is required. + NsdInfoId *string + + // Network package content type. + ContentType types.PackageContentType + + noSmithyDocumentSerde +} + +type PutSolNetworkPackageContentOutput struct { + + // Network package ARN. + // + // This member is required. + Arn *string + + // Network package ID. + // + // This member is required. + Id *string + + // Network package metadata. + // + // This member is required. + Metadata *types.PutSolNetworkPackageContentMetadata + + // Network service descriptor ID. + // + // This member is required. + NsdId *string + + // Network service descriptor name. + // + // This member is required. + NsdName *string + + // Network service descriptor version. + // + // This member is required. + NsdVersion *string + + // Function package IDs. + // + // This member is required. + VnfPkgIds []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutSolNetworkPackageContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSolNetworkPackageContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSolNetworkPackageContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutSolNetworkPackageContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSolNetworkPackageContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutSolNetworkPackageContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "PutSolNetworkPackageContent", + } +} diff --git a/service/tnb/api_op_TagResource.go b/service/tnb/api_op_TagResource.go new file mode 100644 index 00000000000..710dbfc2696 --- /dev/null +++ b/service/tnb/api_op_TagResource.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Tags an AWS TNB resource. A tag is a label that you assign to an Amazon Web +// Services resource. Each tag consists of a key and an optional value. You can use +// tags to search and filter your resources or track your Amazon Web Services +// costs. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // Resource ARN. + // + // This member is required. + ResourceArn *string + + // A tag is a label that you assign to an Amazon Web Services resource. Each tag + // consists of a key and an optional value. You can use tags to search and filter + // your resources or track your Amazon Web Services costs. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "TagResource", + } +} diff --git a/service/tnb/api_op_TerminateSolNetworkInstance.go b/service/tnb/api_op_TerminateSolNetworkInstance.go new file mode 100644 index 00000000000..1f7d78af209 --- /dev/null +++ b/service/tnb/api_op_TerminateSolNetworkInstance.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Terminates a network instance. A network instance is a single network created in +// Amazon Web Services TNB that can be deployed and on which life-cycle operations +// (like terminate, update, and delete) can be performed. You must terminate a +// network instance before you can delete it. +func (c *Client) TerminateSolNetworkInstance(ctx context.Context, params *TerminateSolNetworkInstanceInput, optFns ...func(*Options)) (*TerminateSolNetworkInstanceOutput, error) { + if params == nil { + params = &TerminateSolNetworkInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TerminateSolNetworkInstance", params, optFns, c.addOperationTerminateSolNetworkInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TerminateSolNetworkInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TerminateSolNetworkInstanceInput struct { + + // ID of the network instance. + // + // This member is required. + NsInstanceId *string + + noSmithyDocumentSerde +} + +type TerminateSolNetworkInstanceOutput struct { + + // The identifier of the operation occurrence. + NsLcmOpOccId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTerminateSolNetworkInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpTerminateSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTerminateSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTerminateSolNetworkInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateSolNetworkInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTerminateSolNetworkInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "TerminateSolNetworkInstance", + } +} diff --git a/service/tnb/api_op_UntagResource.go b/service/tnb/api_op_UntagResource.go new file mode 100644 index 00000000000..030c51f10b2 --- /dev/null +++ b/service/tnb/api_op_UntagResource.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Untags an AWS TNB resource. A tag is a label that you assign to an Amazon Web +// Services resource. Each tag consists of a key and an optional value. You can use +// tags to search and filter your resources or track your Amazon Web Services +// costs. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // Resource ARN. + // + // This member is required. + ResourceArn *string + + // Tag keys. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "UntagResource", + } +} diff --git a/service/tnb/api_op_UpdateSolFunctionPackage.go b/service/tnb/api_op_UpdateSolFunctionPackage.go new file mode 100644 index 00000000000..2f81dbfd0e2 --- /dev/null +++ b/service/tnb/api_op_UpdateSolFunctionPackage.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the operational state of function package. A function package is a .zip +// file in CSAR (Cloud Service Archive) format that contains a network function (an +// ETSI standard telecommunication application) and function package descriptor +// that uses the TOSCA standard to describe how the network functions should run on +// your network. +func (c *Client) UpdateSolFunctionPackage(ctx context.Context, params *UpdateSolFunctionPackageInput, optFns ...func(*Options)) (*UpdateSolFunctionPackageOutput, error) { + if params == nil { + params = &UpdateSolFunctionPackageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSolFunctionPackage", params, optFns, c.addOperationUpdateSolFunctionPackageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSolFunctionPackageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSolFunctionPackageInput struct { + + // Operational state of the function package. + // + // This member is required. + OperationalState types.OperationalState + + // ID of the function package. + // + // This member is required. + VnfPkgId *string + + noSmithyDocumentSerde +} + +type UpdateSolFunctionPackageOutput struct { + + // Operational state of the function package. + // + // This member is required. + OperationalState types.OperationalState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSolFunctionPackageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSolFunctionPackage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSolFunctionPackage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSolFunctionPackageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSolFunctionPackage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSolFunctionPackage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "UpdateSolFunctionPackage", + } +} diff --git a/service/tnb/api_op_UpdateSolNetworkInstance.go b/service/tnb/api_op_UpdateSolNetworkInstance.go new file mode 100644 index 00000000000..b445c06f439 --- /dev/null +++ b/service/tnb/api_op_UpdateSolNetworkInstance.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a network instance. A network instance is a single network created in +// Amazon Web Services TNB that can be deployed and on which life-cycle operations +// (like terminate, update, and delete) can be performed. +func (c *Client) UpdateSolNetworkInstance(ctx context.Context, params *UpdateSolNetworkInstanceInput, optFns ...func(*Options)) (*UpdateSolNetworkInstanceOutput, error) { + if params == nil { + params = &UpdateSolNetworkInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSolNetworkInstance", params, optFns, c.addOperationUpdateSolNetworkInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSolNetworkInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSolNetworkInstanceInput struct { + + // ID of the network instance. + // + // This member is required. + NsInstanceId *string + + // The type of update. + // + // This member is required. + UpdateType types.UpdateSolNetworkType + + // Identifies the network function information parameters and/or the configurable + // properties of the network function to be modified. + ModifyVnfInfoData *types.UpdateSolNetworkModify + + noSmithyDocumentSerde +} + +type UpdateSolNetworkInstanceOutput struct { + + // The identifier of the network instance operation occurrence. + NsLcmOpOccId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSolNetworkInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSolNetworkInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSolNetworkInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSolNetworkInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSolNetworkInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "UpdateSolNetworkInstance", + } +} diff --git a/service/tnb/api_op_UpdateSolNetworkPackage.go b/service/tnb/api_op_UpdateSolNetworkPackage.go new file mode 100644 index 00000000000..d0a03a9d3a9 --- /dev/null +++ b/service/tnb/api_op_UpdateSolNetworkPackage.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the operational state of a network package. A network package is a .zip +// file in CSAR (Cloud Service Archive) format defines the function packages you +// want to deploy and the Amazon Web Services infrastructure you want to deploy +// them on. A network service descriptor is a .yaml file in a network package that +// uses the TOSCA standard to describe the network functions you want to deploy and +// the Amazon Web Services infrastructure you want to deploy the network functions +// on. +func (c *Client) UpdateSolNetworkPackage(ctx context.Context, params *UpdateSolNetworkPackageInput, optFns ...func(*Options)) (*UpdateSolNetworkPackageOutput, error) { + if params == nil { + params = &UpdateSolNetworkPackageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSolNetworkPackage", params, optFns, c.addOperationUpdateSolNetworkPackageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSolNetworkPackageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSolNetworkPackageInput struct { + + // ID of the network service descriptor in the network package. + // + // This member is required. + NsdInfoId *string + + // Operational state of the network service descriptor in the network package. + // + // This member is required. + NsdOperationalState types.NsdOperationalState + + noSmithyDocumentSerde +} + +type UpdateSolNetworkPackageOutput struct { + + // Operational state of the network service descriptor in the network package. + // + // This member is required. + NsdOperationalState types.NsdOperationalState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSolNetworkPackageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSolNetworkPackage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSolNetworkPackage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSolNetworkPackageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSolNetworkPackage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSolNetworkPackage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "UpdateSolNetworkPackage", + } +} diff --git a/service/tnb/api_op_ValidateSolFunctionPackageContent.go b/service/tnb/api_op_ValidateSolFunctionPackageContent.go new file mode 100644 index 00000000000..df40ba9bd3f --- /dev/null +++ b/service/tnb/api_op_ValidateSolFunctionPackageContent.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Validates function package content. This can be used as a dry run before +// uploading function package content with PutSolFunctionPackageContent +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_PutSolFunctionPackageContent.html). +// A function package is a .zip file in CSAR (Cloud Service Archive) format that +// contains a network function (an ETSI standard telecommunication application) and +// function package descriptor that uses the TOSCA standard to describe how the +// network functions should run on your network. +func (c *Client) ValidateSolFunctionPackageContent(ctx context.Context, params *ValidateSolFunctionPackageContentInput, optFns ...func(*Options)) (*ValidateSolFunctionPackageContentOutput, error) { + if params == nil { + params = &ValidateSolFunctionPackageContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ValidateSolFunctionPackageContent", params, optFns, c.addOperationValidateSolFunctionPackageContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ValidateSolFunctionPackageContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ValidateSolFunctionPackageContentInput struct { + + // Function package file. + // + // This member is required. + File []byte + + // Function package ID. + // + // This member is required. + VnfPkgId *string + + // Function package content type. + ContentType types.PackageContentType + + noSmithyDocumentSerde +} + +type ValidateSolFunctionPackageContentOutput struct { + + // Function package ID. + // + // This member is required. + Id *string + + // Function package metadata. + // + // This member is required. + Metadata *types.ValidateSolFunctionPackageContentMetadata + + // Network function product name. + // + // This member is required. + VnfProductName *string + + // Network function provider. + // + // This member is required. + VnfProvider *string + + // Function package descriptor ID. + // + // This member is required. + VnfdId *string + + // Function package descriptor version. + // + // This member is required. + VnfdVersion *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationValidateSolFunctionPackageContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpValidateSolFunctionPackageContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpValidateSolFunctionPackageContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpValidateSolFunctionPackageContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidateSolFunctionPackageContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opValidateSolFunctionPackageContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "ValidateSolFunctionPackageContent", + } +} diff --git a/service/tnb/api_op_ValidateSolNetworkPackageContent.go b/service/tnb/api_op_ValidateSolNetworkPackageContent.go new file mode 100644 index 00000000000..adbedb02687 --- /dev/null +++ b/service/tnb/api_op_ValidateSolNetworkPackageContent.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Validates network package content. This can be used as a dry run before +// uploading network package content with PutSolNetworkPackageContent +// (https://docs.aws.amazon.com/TNB/latest/APIReference/API_PutSolNetworkPackageContent.html). +// A network package is a .zip file in CSAR (Cloud Service Archive) format defines +// the function packages you want to deploy and the Amazon Web Services +// infrastructure you want to deploy them on. +func (c *Client) ValidateSolNetworkPackageContent(ctx context.Context, params *ValidateSolNetworkPackageContentInput, optFns ...func(*Options)) (*ValidateSolNetworkPackageContentOutput, error) { + if params == nil { + params = &ValidateSolNetworkPackageContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ValidateSolNetworkPackageContent", params, optFns, c.addOperationValidateSolNetworkPackageContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ValidateSolNetworkPackageContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ValidateSolNetworkPackageContentInput struct { + + // Network package file. + // + // This member is required. + File []byte + + // Network service descriptor file. + // + // This member is required. + NsdInfoId *string + + // Network package content type. + ContentType types.PackageContentType + + noSmithyDocumentSerde +} + +type ValidateSolNetworkPackageContentOutput struct { + + // Network package ARN. + // + // This member is required. + Arn *string + + // Network package ID. + // + // This member is required. + Id *string + + // Network package metadata. + // + // This member is required. + Metadata *types.ValidateSolNetworkPackageContentMetadata + + // Network service descriptor ID. + // + // This member is required. + NsdId *string + + // Network service descriptor name. + // + // This member is required. + NsdName *string + + // Network service descriptor version. + // + // This member is required. + NsdVersion *string + + // Function package IDs. + // + // This member is required. + VnfPkgIds []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationValidateSolNetworkPackageContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpValidateSolNetworkPackageContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpValidateSolNetworkPackageContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpValidateSolNetworkPackageContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidateSolNetworkPackageContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opValidateSolNetworkPackageContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "tnb", + OperationName: "ValidateSolNetworkPackageContent", + } +} diff --git a/service/tnb/deserializers.go b/service/tnb/deserializers.go new file mode 100644 index 00000000000..3d797ac3594 --- /dev/null +++ b/service/tnb/deserializers.go @@ -0,0 +1,8209 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + smithy "github.com/aws/smithy-go" + 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" + "io/ioutil" + "strings" +) + +type awsRestjson1_deserializeOpCancelSolNetworkOperation struct { +} + +func (*awsRestjson1_deserializeOpCancelSolNetworkOperation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCancelSolNetworkOperation) 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_deserializeOpErrorCancelSolNetworkOperation(response, &metadata) + } + output := &CancelSolNetworkOperationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCancelSolNetworkOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpCreateSolFunctionPackage struct { +} + +func (*awsRestjson1_deserializeOpCreateSolFunctionPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSolFunctionPackage) 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_deserializeOpErrorCreateSolFunctionPackage(response, &metadata) + } + output := &CreateSolFunctionPackageOutput{} + 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_deserializeOpDocumentCreateSolFunctionPackageOutput(&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_deserializeOpErrorCreateSolFunctionPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSolFunctionPackageOutput(v **CreateSolFunctionPackageOutput, 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 *CreateSolFunctionPackageOutput + if *v == nil { + sv = &CreateSolFunctionPackageOutput{} + } 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 VnfPkgArn 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 VnfPkgId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "onboardingState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OnboardingState to be of type string, got %T instead", value) + } + sv.OnboardingState = types.OnboardingState(jtv) + } + + case "operationalState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationalState to be of type string, got %T instead", value) + } + sv.OperationalState = types.OperationalState(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "usageState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UsageState to be of type string, got %T instead", value) + } + sv.UsageState = types.UsageState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateSolNetworkInstance struct { +} + +func (*awsRestjson1_deserializeOpCreateSolNetworkInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSolNetworkInstance) 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_deserializeOpErrorCreateSolNetworkInstance(response, &metadata) + } + output := &CreateSolNetworkInstanceOutput{} + 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_deserializeOpDocumentCreateSolNetworkInstanceOutput(&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_deserializeOpErrorCreateSolNetworkInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSolNetworkInstanceOutput(v **CreateSolNetworkInstanceOutput, 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 *CreateSolNetworkInstanceOutput + if *v == nil { + sv = &CreateSolNetworkInstanceOutput{} + } 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 NsInstanceArn 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 NsInstanceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "nsdInfoId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdInfoId to be of type string, got %T instead", value) + } + sv.NsdInfoId = ptr.String(jtv) + } + + case "nsInstanceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsInstanceName = 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_deserializeOpCreateSolNetworkPackage struct { +} + +func (*awsRestjson1_deserializeOpCreateSolNetworkPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSolNetworkPackage) 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_deserializeOpErrorCreateSolNetworkPackage(response, &metadata) + } + output := &CreateSolNetworkPackageOutput{} + 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_deserializeOpDocumentCreateSolNetworkPackageOutput(&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_deserializeOpErrorCreateSolNetworkPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSolNetworkPackageOutput(v **CreateSolNetworkPackageOutput, 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 *CreateSolNetworkPackageOutput + if *v == nil { + sv = &CreateSolNetworkPackageOutput{} + } 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 NsdInfoArn 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 NsdInfoId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "nsdOnboardingState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdOnboardingState to be of type string, got %T instead", value) + } + sv.NsdOnboardingState = types.NsdOnboardingState(jtv) + } + + case "nsdOperationalState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdOperationalState to be of type string, got %T instead", value) + } + sv.NsdOperationalState = types.NsdOperationalState(jtv) + } + + case "nsdUsageState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdUsageState to be of type string, got %T instead", value) + } + sv.NsdUsageState = types.NsdUsageState(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteSolFunctionPackage struct { +} + +func (*awsRestjson1_deserializeOpDeleteSolFunctionPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSolFunctionPackage) 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_deserializeOpErrorDeleteSolFunctionPackage(response, &metadata) + } + output := &DeleteSolFunctionPackageOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSolFunctionPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteSolNetworkInstance struct { +} + +func (*awsRestjson1_deserializeOpDeleteSolNetworkInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSolNetworkInstance) 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_deserializeOpErrorDeleteSolNetworkInstance(response, &metadata) + } + output := &DeleteSolNetworkInstanceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSolNetworkInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteSolNetworkPackage struct { +} + +func (*awsRestjson1_deserializeOpDeleteSolNetworkPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSolNetworkPackage) 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_deserializeOpErrorDeleteSolNetworkPackage(response, &metadata) + } + output := &DeleteSolNetworkPackageOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSolNetworkPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetSolFunctionInstance struct { +} + +func (*awsRestjson1_deserializeOpGetSolFunctionInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolFunctionInstance) 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_deserializeOpErrorGetSolFunctionInstance(response, &metadata) + } + output := &GetSolFunctionInstanceOutput{} + 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_deserializeOpDocumentGetSolFunctionInstanceOutput(&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_deserializeOpErrorGetSolFunctionInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSolFunctionInstanceOutput(v **GetSolFunctionInstanceOutput, 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 *GetSolFunctionInstanceOutput + if *v == nil { + sv = &GetSolFunctionInstanceOutput{} + } 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 VnfInstanceArn 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 VnfInstanceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "instantiatedVnfInfo": + if err := awsRestjson1_deserializeDocumentGetSolVnfInfo(&sv.InstantiatedVnfInfo, value); err != nil { + return err + } + + case "instantiationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfInstantiationState to be of type string, got %T instead", value) + } + sv.InstantiationState = types.VnfInstantiationState(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentGetSolFunctionInstanceMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsInstanceId to be of type string, got %T instead", value) + } + sv.NsInstanceId = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "vnfdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfdId to be of type string, got %T instead", value) + } + sv.VnfdId = ptr.String(jtv) + } + + case "vnfdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfdVersion = ptr.String(jtv) + } + + case "vnfPkgId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfPkgId to be of type string, got %T instead", value) + } + sv.VnfPkgId = ptr.String(jtv) + } + + case "vnfProductName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProductName = ptr.String(jtv) + } + + case "vnfProvider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProvider = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSolFunctionPackage struct { +} + +func (*awsRestjson1_deserializeOpGetSolFunctionPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolFunctionPackage) 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_deserializeOpErrorGetSolFunctionPackage(response, &metadata) + } + output := &GetSolFunctionPackageOutput{} + 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_deserializeOpDocumentGetSolFunctionPackageOutput(&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_deserializeOpErrorGetSolFunctionPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSolFunctionPackageOutput(v **GetSolFunctionPackageOutput, 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 *GetSolFunctionPackageOutput + if *v == nil { + sv = &GetSolFunctionPackageOutput{} + } 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 VnfPkgArn 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 VnfPkgId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentGetSolFunctionPackageMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "onboardingState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OnboardingState to be of type string, got %T instead", value) + } + sv.OnboardingState = types.OnboardingState(jtv) + } + + case "operationalState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationalState to be of type string, got %T instead", value) + } + sv.OperationalState = types.OperationalState(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "usageState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UsageState to be of type string, got %T instead", value) + } + sv.UsageState = types.UsageState(jtv) + } + + case "vnfdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfdId = ptr.String(jtv) + } + + case "vnfdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfdVersion = ptr.String(jtv) + } + + case "vnfProductName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProductName = ptr.String(jtv) + } + + case "vnfProvider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProvider = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSolFunctionPackageContent struct { +} + +func (*awsRestjson1_deserializeOpGetSolFunctionPackageContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolFunctionPackageContent) 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_deserializeOpErrorGetSolFunctionPackageContent(response, &metadata) + } + output := &GetSolFunctionPackageContentOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetSolFunctionPackageContentOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetSolFunctionPackageContentOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSolFunctionPackageContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsGetSolFunctionPackageContentOutput(v *GetSolFunctionPackageContentOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = types.PackageContentType(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetSolFunctionPackageContentOutput(v *GetSolFunctionPackageContentOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.PackageContent = buf.Bytes() + } + return nil +} + +type awsRestjson1_deserializeOpGetSolFunctionPackageDescriptor struct { +} + +func (*awsRestjson1_deserializeOpGetSolFunctionPackageDescriptor) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolFunctionPackageDescriptor) 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_deserializeOpErrorGetSolFunctionPackageDescriptor(response, &metadata) + } + output := &GetSolFunctionPackageDescriptorOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetSolFunctionPackageDescriptorOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetSolFunctionPackageDescriptorOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSolFunctionPackageDescriptor(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsGetSolFunctionPackageDescriptorOutput(v *GetSolFunctionPackageDescriptorOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = types.DescriptorContentType(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetSolFunctionPackageDescriptorOutput(v *GetSolFunctionPackageDescriptorOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.Vnfd = buf.Bytes() + } + return nil +} + +type awsRestjson1_deserializeOpGetSolNetworkInstance struct { +} + +func (*awsRestjson1_deserializeOpGetSolNetworkInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolNetworkInstance) 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_deserializeOpErrorGetSolNetworkInstance(response, &metadata) + } + output := &GetSolNetworkInstanceOutput{} + 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_deserializeOpDocumentGetSolNetworkInstanceOutput(&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_deserializeOpErrorGetSolNetworkInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSolNetworkInstanceOutput(v **GetSolNetworkInstanceOutput, 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 *GetSolNetworkInstanceOutput + if *v == nil { + sv = &GetSolNetworkInstanceOutput{} + } 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 NsInstanceArn 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 NsInstanceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lcmOpInfo": + if err := awsRestjson1_deserializeDocumentLcmOperationInfo(&sv.LcmOpInfo, value); err != nil { + return err + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentGetSolNetworkInstanceMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdId to be of type string, got %T instead", value) + } + sv.NsdId = ptr.String(jtv) + } + + case "nsdInfoId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdInfoId to be of type string, got %T instead", value) + } + sv.NsdInfoId = ptr.String(jtv) + } + + case "nsInstanceDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsInstanceDescription = ptr.String(jtv) + } + + case "nsInstanceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsInstanceName = ptr.String(jtv) + } + + case "nsState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsState to be of type string, got %T instead", value) + } + sv.NsState = types.NsState(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSolNetworkOperation struct { +} + +func (*awsRestjson1_deserializeOpGetSolNetworkOperation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolNetworkOperation) 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_deserializeOpErrorGetSolNetworkOperation(response, &metadata) + } + output := &GetSolNetworkOperationOutput{} + 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_deserializeOpDocumentGetSolNetworkOperationOutput(&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_deserializeOpErrorGetSolNetworkOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSolNetworkOperationOutput(v **GetSolNetworkOperationOutput, 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 *GetSolNetworkOperationOutput + if *v == nil { + sv = &GetSolNetworkOperationOutput{} + } 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 NsLcmOpOccArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "error": + if err := awsRestjson1_deserializeDocumentProblemDetails(&sv.Error, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsLcmOpOccId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lcmOperationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LcmOperationType to be of type string, got %T instead", value) + } + sv.LcmOperationType = types.LcmOperationType(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentGetSolNetworkOperationMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsInstanceId to be of type string, got %T instead", value) + } + sv.NsInstanceId = ptr.String(jtv) + } + + case "operationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsLcmOperationState to be of type string, got %T instead", value) + } + sv.OperationState = types.NsLcmOperationState(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "tasks": + if err := awsRestjson1_deserializeDocumentGetSolNetworkOperationTasksList(&sv.Tasks, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSolNetworkPackage struct { +} + +func (*awsRestjson1_deserializeOpGetSolNetworkPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolNetworkPackage) 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_deserializeOpErrorGetSolNetworkPackage(response, &metadata) + } + output := &GetSolNetworkPackageOutput{} + 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_deserializeOpDocumentGetSolNetworkPackageOutput(&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_deserializeOpErrorGetSolNetworkPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSolNetworkPackageOutput(v **GetSolNetworkPackageOutput, 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 *GetSolNetworkPackageOutput + if *v == nil { + sv = &GetSolNetworkPackageOutput{} + } 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 NsdInfoArn 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 NsdInfoId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentGetSolNetworkPackageMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdId to be of type string, got %T instead", value) + } + sv.NsdId = ptr.String(jtv) + } + + case "nsdName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdName = ptr.String(jtv) + } + + case "nsdOnboardingState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdOnboardingState to be of type string, got %T instead", value) + } + sv.NsdOnboardingState = types.NsdOnboardingState(jtv) + } + + case "nsdOperationalState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdOperationalState to be of type string, got %T instead", value) + } + sv.NsdOperationalState = types.NsdOperationalState(jtv) + } + + case "nsdUsageState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdUsageState to be of type string, got %T instead", value) + } + sv.NsdUsageState = types.NsdUsageState(jtv) + } + + case "nsdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdVersion = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "vnfPkgIds": + if err := awsRestjson1_deserializeDocumentVnfPkgIdList(&sv.VnfPkgIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSolNetworkPackageContent struct { +} + +func (*awsRestjson1_deserializeOpGetSolNetworkPackageContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolNetworkPackageContent) 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_deserializeOpErrorGetSolNetworkPackageContent(response, &metadata) + } + output := &GetSolNetworkPackageContentOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetSolNetworkPackageContentOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetSolNetworkPackageContentOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSolNetworkPackageContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsGetSolNetworkPackageContentOutput(v *GetSolNetworkPackageContentOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = types.PackageContentType(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetSolNetworkPackageContentOutput(v *GetSolNetworkPackageContentOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.NsdContent = buf.Bytes() + } + return nil +} + +type awsRestjson1_deserializeOpGetSolNetworkPackageDescriptor struct { +} + +func (*awsRestjson1_deserializeOpGetSolNetworkPackageDescriptor) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSolNetworkPackageDescriptor) 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_deserializeOpErrorGetSolNetworkPackageDescriptor(response, &metadata) + } + output := &GetSolNetworkPackageDescriptorOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetSolNetworkPackageDescriptorOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetSolNetworkPackageDescriptorOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSolNetworkPackageDescriptor(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsGetSolNetworkPackageDescriptorOutput(v *GetSolNetworkPackageDescriptorOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = types.DescriptorContentType(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetSolNetworkPackageDescriptorOutput(v *GetSolNetworkPackageDescriptorOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.Nsd = buf.Bytes() + } + return nil +} + +type awsRestjson1_deserializeOpInstantiateSolNetworkInstance struct { +} + +func (*awsRestjson1_deserializeOpInstantiateSolNetworkInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpInstantiateSolNetworkInstance) 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_deserializeOpErrorInstantiateSolNetworkInstance(response, &metadata) + } + output := &InstantiateSolNetworkInstanceOutput{} + 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_deserializeOpDocumentInstantiateSolNetworkInstanceOutput(&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_deserializeOpErrorInstantiateSolNetworkInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentInstantiateSolNetworkInstanceOutput(v **InstantiateSolNetworkInstanceOutput, 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 *InstantiateSolNetworkInstanceOutput + if *v == nil { + sv = &InstantiateSolNetworkInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nsLcmOpOccId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsLcmOpOccId to be of type string, got %T instead", value) + } + sv.NsLcmOpOccId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSolFunctionInstances struct { +} + +func (*awsRestjson1_deserializeOpListSolFunctionInstances) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSolFunctionInstances) 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_deserializeOpErrorListSolFunctionInstances(response, &metadata) + } + output := &ListSolFunctionInstancesOutput{} + 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_deserializeOpDocumentListSolFunctionInstancesOutput(&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_deserializeOpErrorListSolFunctionInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSolFunctionInstancesOutput(v **ListSolFunctionInstancesOutput, 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 *ListSolFunctionInstancesOutput + if *v == nil { + sv = &ListSolFunctionInstancesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "functionInstances": + if err := awsRestjson1_deserializeDocumentListSolFunctionInstanceResources(&sv.FunctionInstances, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSolFunctionPackages struct { +} + +func (*awsRestjson1_deserializeOpListSolFunctionPackages) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSolFunctionPackages) 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_deserializeOpErrorListSolFunctionPackages(response, &metadata) + } + output := &ListSolFunctionPackagesOutput{} + 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_deserializeOpDocumentListSolFunctionPackagesOutput(&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_deserializeOpErrorListSolFunctionPackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSolFunctionPackagesOutput(v **ListSolFunctionPackagesOutput, 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 *ListSolFunctionPackagesOutput + if *v == nil { + sv = &ListSolFunctionPackagesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "functionPackages": + if err := awsRestjson1_deserializeDocumentListSolFunctionPackageResources(&sv.FunctionPackages, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSolNetworkInstances struct { +} + +func (*awsRestjson1_deserializeOpListSolNetworkInstances) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSolNetworkInstances) 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_deserializeOpErrorListSolNetworkInstances(response, &metadata) + } + output := &ListSolNetworkInstancesOutput{} + 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_deserializeOpDocumentListSolNetworkInstancesOutput(&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_deserializeOpErrorListSolNetworkInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSolNetworkInstancesOutput(v **ListSolNetworkInstancesOutput, 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 *ListSolNetworkInstancesOutput + if *v == nil { + sv = &ListSolNetworkInstancesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "networkInstances": + if err := awsRestjson1_deserializeDocumentListSolNetworkInstanceResources(&sv.NetworkInstances, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSolNetworkOperations struct { +} + +func (*awsRestjson1_deserializeOpListSolNetworkOperations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSolNetworkOperations) 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_deserializeOpErrorListSolNetworkOperations(response, &metadata) + } + output := &ListSolNetworkOperationsOutput{} + 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_deserializeOpDocumentListSolNetworkOperationsOutput(&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_deserializeOpErrorListSolNetworkOperations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSolNetworkOperationsOutput(v **ListSolNetworkOperationsOutput, 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 *ListSolNetworkOperationsOutput + if *v == nil { + sv = &ListSolNetworkOperationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "networkOperations": + if err := awsRestjson1_deserializeDocumentListSolNetworkOperationsResources(&sv.NetworkOperations, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSolNetworkPackages struct { +} + +func (*awsRestjson1_deserializeOpListSolNetworkPackages) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSolNetworkPackages) 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_deserializeOpErrorListSolNetworkPackages(response, &metadata) + } + output := &ListSolNetworkPackagesOutput{} + 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_deserializeOpDocumentListSolNetworkPackagesOutput(&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_deserializeOpErrorListSolNetworkPackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSolNetworkPackagesOutput(v **ListSolNetworkPackagesOutput, 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 *ListSolNetworkPackagesOutput + if *v == nil { + sv = &ListSolNetworkPackagesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "networkPackages": + if err := awsRestjson1_deserializeDocumentListSolNetworkPackageResources(&sv.NetworkPackages, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) 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_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + 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_deserializeOpDocumentListTagsForResourceOutput(&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_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, 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 *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutSolFunctionPackageContent struct { +} + +func (*awsRestjson1_deserializeOpPutSolFunctionPackageContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutSolFunctionPackageContent) 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_deserializeOpErrorPutSolFunctionPackageContent(response, &metadata) + } + output := &PutSolFunctionPackageContentOutput{} + 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_deserializeOpDocumentPutSolFunctionPackageContentOutput(&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_deserializeOpErrorPutSolFunctionPackageContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutSolFunctionPackageContentOutput(v **PutSolFunctionPackageContentOutput, 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 *PutSolFunctionPackageContentOutput + if *v == nil { + sv = &PutSolFunctionPackageContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfPkgId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentPutSolFunctionPackageContentMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "vnfdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfdId to be of type string, got %T instead", value) + } + sv.VnfdId = ptr.String(jtv) + } + + case "vnfdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfdVersion = ptr.String(jtv) + } + + case "vnfProductName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProductName = ptr.String(jtv) + } + + case "vnfProvider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProvider = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutSolNetworkPackageContent struct { +} + +func (*awsRestjson1_deserializeOpPutSolNetworkPackageContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutSolNetworkPackageContent) 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_deserializeOpErrorPutSolNetworkPackageContent(response, &metadata) + } + output := &PutSolNetworkPackageContentOutput{} + 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_deserializeOpDocumentPutSolNetworkPackageContentOutput(&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_deserializeOpErrorPutSolNetworkPackageContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutSolNetworkPackageContentOutput(v **PutSolNetworkPackageContentOutput, 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 *PutSolNetworkPackageContentOutput + if *v == nil { + sv = &PutSolNetworkPackageContentOutput{} + } 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 NsdInfoArn 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 NsdInfoId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentPutSolNetworkPackageContentMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdId to be of type string, got %T instead", value) + } + sv.NsdId = ptr.String(jtv) + } + + case "nsdName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdName = ptr.String(jtv) + } + + case "nsdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdVersion = ptr.String(jtv) + } + + case "vnfPkgIds": + if err := awsRestjson1_deserializeDocumentVnfPkgIdList(&sv.VnfPkgIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) 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_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpTerminateSolNetworkInstance struct { +} + +func (*awsRestjson1_deserializeOpTerminateSolNetworkInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTerminateSolNetworkInstance) 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_deserializeOpErrorTerminateSolNetworkInstance(response, &metadata) + } + output := &TerminateSolNetworkInstanceOutput{} + 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_deserializeOpDocumentTerminateSolNetworkInstanceOutput(&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_deserializeOpErrorTerminateSolNetworkInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentTerminateSolNetworkInstanceOutput(v **TerminateSolNetworkInstanceOutput, 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 *TerminateSolNetworkInstanceOutput + if *v == nil { + sv = &TerminateSolNetworkInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nsLcmOpOccId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsLcmOpOccId to be of type string, got %T instead", value) + } + sv.NsLcmOpOccId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) 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_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateSolFunctionPackage struct { +} + +func (*awsRestjson1_deserializeOpUpdateSolFunctionPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSolFunctionPackage) 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_deserializeOpErrorUpdateSolFunctionPackage(response, &metadata) + } + output := &UpdateSolFunctionPackageOutput{} + 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_deserializeOpDocumentUpdateSolFunctionPackageOutput(&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_deserializeOpErrorUpdateSolFunctionPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSolFunctionPackageOutput(v **UpdateSolFunctionPackageOutput, 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 *UpdateSolFunctionPackageOutput + if *v == nil { + sv = &UpdateSolFunctionPackageOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "operationalState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationalState to be of type string, got %T instead", value) + } + sv.OperationalState = types.OperationalState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSolNetworkInstance struct { +} + +func (*awsRestjson1_deserializeOpUpdateSolNetworkInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSolNetworkInstance) 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_deserializeOpErrorUpdateSolNetworkInstance(response, &metadata) + } + output := &UpdateSolNetworkInstanceOutput{} + 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_deserializeOpDocumentUpdateSolNetworkInstanceOutput(&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_deserializeOpErrorUpdateSolNetworkInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSolNetworkInstanceOutput(v **UpdateSolNetworkInstanceOutput, 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 *UpdateSolNetworkInstanceOutput + if *v == nil { + sv = &UpdateSolNetworkInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nsLcmOpOccId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsLcmOpOccId to be of type string, got %T instead", value) + } + sv.NsLcmOpOccId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSolNetworkPackage struct { +} + +func (*awsRestjson1_deserializeOpUpdateSolNetworkPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSolNetworkPackage) 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_deserializeOpErrorUpdateSolNetworkPackage(response, &metadata) + } + output := &UpdateSolNetworkPackageOutput{} + 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_deserializeOpDocumentUpdateSolNetworkPackageOutput(&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_deserializeOpErrorUpdateSolNetworkPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSolNetworkPackageOutput(v **UpdateSolNetworkPackageOutput, 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 *UpdateSolNetworkPackageOutput + if *v == nil { + sv = &UpdateSolNetworkPackageOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nsdOperationalState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdOperationalState to be of type string, got %T instead", value) + } + sv.NsdOperationalState = types.NsdOperationalState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpValidateSolFunctionPackageContent struct { +} + +func (*awsRestjson1_deserializeOpValidateSolFunctionPackageContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpValidateSolFunctionPackageContent) 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_deserializeOpErrorValidateSolFunctionPackageContent(response, &metadata) + } + output := &ValidateSolFunctionPackageContentOutput{} + 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_deserializeOpDocumentValidateSolFunctionPackageContentOutput(&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_deserializeOpErrorValidateSolFunctionPackageContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentValidateSolFunctionPackageContentOutput(v **ValidateSolFunctionPackageContentOutput, 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 *ValidateSolFunctionPackageContentOutput + if *v == nil { + sv = &ValidateSolFunctionPackageContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfPkgId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentValidateSolFunctionPackageContentMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "vnfdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfdId to be of type string, got %T instead", value) + } + sv.VnfdId = ptr.String(jtv) + } + + case "vnfdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfdVersion = ptr.String(jtv) + } + + case "vnfProductName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProductName = ptr.String(jtv) + } + + case "vnfProvider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProvider = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpValidateSolNetworkPackageContent struct { +} + +func (*awsRestjson1_deserializeOpValidateSolNetworkPackageContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpValidateSolNetworkPackageContent) 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_deserializeOpErrorValidateSolNetworkPackageContent(response, &metadata) + } + output := &ValidateSolNetworkPackageContentOutput{} + 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_deserializeOpDocumentValidateSolNetworkPackageContentOutput(&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_deserializeOpErrorValidateSolNetworkPackageContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentValidateSolNetworkPackageContentOutput(v **ValidateSolNetworkPackageContentOutput, 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 *ValidateSolNetworkPackageContentOutput + if *v == nil { + sv = &ValidateSolNetworkPackageContentOutput{} + } 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 NsdInfoArn 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 NsdInfoId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentValidateSolNetworkPackageContentMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdId to be of type string, got %T instead", value) + } + sv.NsdId = ptr.String(jtv) + } + + case "nsdName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdName = ptr.String(jtv) + } + + case "nsdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdVersion = ptr.String(jtv) + } + + case "vnfPkgIds": + if err := awsRestjson1_deserializeDocumentVnfPkgIdList(&sv.VnfPkgIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + 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_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentErrorInfo(v **types.ErrorInfo, 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.ErrorInfo + if *v == nil { + sv = &types.ErrorInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cause": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCause to be of type string, got %T instead", value) + } + sv.Cause = ptr.String(jtv) + } + + case "details": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDetails to be of type string, got %T instead", value) + } + sv.Details = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFunctionArtifactMeta(v **types.FunctionArtifactMeta, 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.FunctionArtifactMeta + if *v == nil { + sv = &types.FunctionArtifactMeta{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "overrides": + if err := awsRestjson1_deserializeDocumentOverrideList(&sv.Overrides, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolFunctionInstanceMetadata(v **types.GetSolFunctionInstanceMetadata, 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.GetSolFunctionInstanceMetadata + if *v == nil { + sv = &types.GetSolFunctionInstanceMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolFunctionPackageMetadata(v **types.GetSolFunctionPackageMetadata, 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.GetSolFunctionPackageMetadata + if *v == nil { + sv = &types.GetSolFunctionPackageMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + case "vnfd": + if err := awsRestjson1_deserializeDocumentFunctionArtifactMeta(&sv.Vnfd, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolInstantiatedVnfInfo(v **types.GetSolInstantiatedVnfInfo, 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.GetSolInstantiatedVnfInfo + if *v == nil { + sv = &types.GetSolInstantiatedVnfInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "vnfState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfOperationalState to be of type string, got %T instead", value) + } + sv.VnfState = types.VnfOperationalState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolNetworkInstanceMetadata(v **types.GetSolNetworkInstanceMetadata, 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.GetSolNetworkInstanceMetadata + if *v == nil { + sv = &types.GetSolNetworkInstanceMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolNetworkOperationMetadata(v **types.GetSolNetworkOperationMetadata, 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.GetSolNetworkOperationMetadata + if *v == nil { + sv = &types.GetSolNetworkOperationMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolNetworkOperationTaskDetails(v **types.GetSolNetworkOperationTaskDetails, 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.GetSolNetworkOperationTaskDetails + if *v == nil { + sv = &types.GetSolNetworkOperationTaskDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taskContext": + if err := awsRestjson1_deserializeDocumentStringMap(&sv.TaskContext, value); err != nil { + return err + } + + case "taskEndTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.TaskEndTime = ptr.Time(t) + } + + case "taskErrorDetails": + if err := awsRestjson1_deserializeDocumentErrorInfo(&sv.TaskErrorDetails, value); err != nil { + return err + } + + case "taskName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TaskName = ptr.String(jtv) + } + + case "taskStartTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.TaskStartTime = ptr.Time(t) + } + + case "taskStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskStatus to be of type string, got %T instead", value) + } + sv.TaskStatus = types.TaskStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolNetworkOperationTasksList(v *[]types.GetSolNetworkOperationTaskDetails, 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.GetSolNetworkOperationTaskDetails + if *v == nil { + cv = []types.GetSolNetworkOperationTaskDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GetSolNetworkOperationTaskDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentGetSolNetworkOperationTaskDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolNetworkPackageMetadata(v **types.GetSolNetworkPackageMetadata, 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.GetSolNetworkPackageMetadata + if *v == nil { + sv = &types.GetSolNetworkPackageMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + case "nsd": + if err := awsRestjson1_deserializeDocumentNetworkArtifactMeta(&sv.Nsd, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolVnfcResourceInfo(v **types.GetSolVnfcResourceInfo, 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.GetSolVnfcResourceInfo + if *v == nil { + sv = &types.GetSolVnfcResourceInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "metadata": + if err := awsRestjson1_deserializeDocumentGetSolVnfcResourceInfoMetadata(&sv.Metadata, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolVnfcResourceInfoList(v *[]types.GetSolVnfcResourceInfo, 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.GetSolVnfcResourceInfo + if *v == nil { + cv = []types.GetSolVnfcResourceInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GetSolVnfcResourceInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentGetSolVnfcResourceInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolVnfcResourceInfoMetadata(v **types.GetSolVnfcResourceInfoMetadata, 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.GetSolVnfcResourceInfoMetadata + if *v == nil { + sv = &types.GetSolVnfcResourceInfoMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cluster": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Cluster = ptr.String(jtv) + } + + case "helmChart": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HelmChart = ptr.String(jtv) + } + + case "nodeGroup": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NodeGroup = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGetSolVnfInfo(v **types.GetSolVnfInfo, 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.GetSolVnfInfo + if *v == nil { + sv = &types.GetSolVnfInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "vnfcResourceInfo": + if err := awsRestjson1_deserializeDocumentGetSolVnfcResourceInfoList(&sv.VnfcResourceInfo, value); err != nil { + return err + } + + case "vnfState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfOperationalState to be of type string, got %T instead", value) + } + sv.VnfState = types.VnfOperationalState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, 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.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLcmOperationInfo(v **types.LcmOperationInfo, 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.LcmOperationInfo + if *v == nil { + sv = &types.LcmOperationInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nsLcmOpOccId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsLcmOpOccId to be of type string, got %T instead", value) + } + sv.NsLcmOpOccId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolFunctionInstanceInfo(v **types.ListSolFunctionInstanceInfo, 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.ListSolFunctionInstanceInfo + if *v == nil { + sv = &types.ListSolFunctionInstanceInfo{} + } 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 VnfInstanceArn 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 VnfInstanceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "instantiatedVnfInfo": + if err := awsRestjson1_deserializeDocumentGetSolInstantiatedVnfInfo(&sv.InstantiatedVnfInfo, value); err != nil { + return err + } + + case "instantiationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfInstantiationState to be of type string, got %T instead", value) + } + sv.InstantiationState = types.VnfInstantiationState(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentListSolFunctionInstanceMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsInstanceId to be of type string, got %T instead", value) + } + sv.NsInstanceId = ptr.String(jtv) + } + + case "vnfPkgId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VnfPkgId to be of type string, got %T instead", value) + } + sv.VnfPkgId = ptr.String(jtv) + } + + case "vnfPkgName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfPkgName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolFunctionInstanceMetadata(v **types.ListSolFunctionInstanceMetadata, 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.ListSolFunctionInstanceMetadata + if *v == nil { + sv = &types.ListSolFunctionInstanceMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolFunctionInstanceResources(v *[]types.ListSolFunctionInstanceInfo, 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.ListSolFunctionInstanceInfo + if *v == nil { + cv = []types.ListSolFunctionInstanceInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListSolFunctionInstanceInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentListSolFunctionInstanceInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListSolFunctionPackageInfo(v **types.ListSolFunctionPackageInfo, 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.ListSolFunctionPackageInfo + if *v == nil { + sv = &types.ListSolFunctionPackageInfo{} + } 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 VnfPkgArn 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 VnfPkgId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentListSolFunctionPackageMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "onboardingState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OnboardingState to be of type string, got %T instead", value) + } + sv.OnboardingState = types.OnboardingState(jtv) + } + + case "operationalState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationalState to be of type string, got %T instead", value) + } + sv.OperationalState = types.OperationalState(jtv) + } + + case "usageState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UsageState to be of type string, got %T instead", value) + } + sv.UsageState = types.UsageState(jtv) + } + + case "vnfdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfdId = ptr.String(jtv) + } + + case "vnfdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfdVersion = ptr.String(jtv) + } + + case "vnfProductName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProductName = ptr.String(jtv) + } + + case "vnfProvider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VnfProvider = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolFunctionPackageMetadata(v **types.ListSolFunctionPackageMetadata, 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.ListSolFunctionPackageMetadata + if *v == nil { + sv = &types.ListSolFunctionPackageMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolFunctionPackageResources(v *[]types.ListSolFunctionPackageInfo, 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.ListSolFunctionPackageInfo + if *v == nil { + cv = []types.ListSolFunctionPackageInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListSolFunctionPackageInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentListSolFunctionPackageInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkInstanceInfo(v **types.ListSolNetworkInstanceInfo, 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.ListSolNetworkInstanceInfo + if *v == nil { + sv = &types.ListSolNetworkInstanceInfo{} + } 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 NsInstanceArn 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 NsInstanceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentListSolNetworkInstanceMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdId to be of type string, got %T instead", value) + } + sv.NsdId = ptr.String(jtv) + } + + case "nsdInfoId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdInfoId to be of type string, got %T instead", value) + } + sv.NsdInfoId = ptr.String(jtv) + } + + case "nsInstanceDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsInstanceDescription = ptr.String(jtv) + } + + case "nsInstanceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsInstanceName = ptr.String(jtv) + } + + case "nsState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsState to be of type string, got %T instead", value) + } + sv.NsState = types.NsState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkInstanceMetadata(v **types.ListSolNetworkInstanceMetadata, 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.ListSolNetworkInstanceMetadata + if *v == nil { + sv = &types.ListSolNetworkInstanceMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkInstanceResources(v *[]types.ListSolNetworkInstanceInfo, 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.ListSolNetworkInstanceInfo + if *v == nil { + cv = []types.ListSolNetworkInstanceInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListSolNetworkInstanceInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentListSolNetworkInstanceInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkOperationsInfo(v **types.ListSolNetworkOperationsInfo, 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.ListSolNetworkOperationsInfo + if *v == nil { + sv = &types.ListSolNetworkOperationsInfo{} + } 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 NsLcmOpOccArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "error": + if err := awsRestjson1_deserializeDocumentProblemDetails(&sv.Error, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsLcmOpOccId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lcmOperationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LcmOperationType to be of type string, got %T instead", value) + } + sv.LcmOperationType = types.LcmOperationType(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentListSolNetworkOperationsMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsInstanceId to be of type string, got %T instead", value) + } + sv.NsInstanceId = ptr.String(jtv) + } + + case "operationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsLcmOperationState to be of type string, got %T instead", value) + } + sv.OperationState = types.NsLcmOperationState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkOperationsMetadata(v **types.ListSolNetworkOperationsMetadata, 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.ListSolNetworkOperationsMetadata + if *v == nil { + sv = &types.ListSolNetworkOperationsMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkOperationsResources(v *[]types.ListSolNetworkOperationsInfo, 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.ListSolNetworkOperationsInfo + if *v == nil { + cv = []types.ListSolNetworkOperationsInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListSolNetworkOperationsInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentListSolNetworkOperationsInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkPackageInfo(v **types.ListSolNetworkPackageInfo, 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.ListSolNetworkPackageInfo + if *v == nil { + sv = &types.ListSolNetworkPackageInfo{} + } 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 NsdInfoArn 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 NsdInfoId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentListSolNetworkPackageMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "nsdDesigner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdDesigner = ptr.String(jtv) + } + + case "nsdId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdId = ptr.String(jtv) + } + + case "nsdInvariantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdInvariantId = ptr.String(jtv) + } + + case "nsdName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdName = ptr.String(jtv) + } + + case "nsdOnboardingState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdOnboardingState to be of type string, got %T instead", value) + } + sv.NsdOnboardingState = types.NsdOnboardingState(jtv) + } + + case "nsdOperationalState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdOperationalState to be of type string, got %T instead", value) + } + sv.NsdOperationalState = types.NsdOperationalState(jtv) + } + + case "nsdUsageState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NsdUsageState to be of type string, got %T instead", value) + } + sv.NsdUsageState = types.NsdUsageState(jtv) + } + + case "nsdVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NsdVersion = ptr.String(jtv) + } + + case "vnfPkgIds": + if err := awsRestjson1_deserializeDocumentVnfPkgIdList(&sv.VnfPkgIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkPackageMetadata(v **types.ListSolNetworkPackageMetadata, 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.ListSolNetworkPackageMetadata + if *v == nil { + sv = &types.ListSolNetworkPackageMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModified = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSolNetworkPackageResources(v *[]types.ListSolNetworkPackageInfo, 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.ListSolNetworkPackageInfo + if *v == nil { + cv = []types.ListSolNetworkPackageInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListSolNetworkPackageInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentListSolNetworkPackageInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentNetworkArtifactMeta(v **types.NetworkArtifactMeta, 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.NetworkArtifactMeta + if *v == nil { + sv = &types.NetworkArtifactMeta{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "overrides": + if err := awsRestjson1_deserializeDocumentOverrideList(&sv.Overrides, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOverrideList(v *[]types.ToscaOverride, 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.ToscaOverride + if *v == nil { + cv = []types.ToscaOverride{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ToscaOverride + destAddr := &col + if err := awsRestjson1_deserializeDocumentToscaOverride(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProblemDetails(v **types.ProblemDetails, 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.ProblemDetails + if *v == nil { + sv = &types.ProblemDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "detail": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Detail = ptr.String(jtv) + } + + case "title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPutSolFunctionPackageContentMetadata(v **types.PutSolFunctionPackageContentMetadata, 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.PutSolFunctionPackageContentMetadata + if *v == nil { + sv = &types.PutSolFunctionPackageContentMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "vnfd": + if err := awsRestjson1_deserializeDocumentFunctionArtifactMeta(&sv.Vnfd, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPutSolNetworkPackageContentMetadata(v **types.PutSolNetworkPackageContentMetadata, 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.PutSolNetworkPackageContentMetadata + if *v == nil { + sv = &types.PutSolNetworkPackageContentMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nsd": + if err := awsRestjson1_deserializeDocumentNetworkArtifactMeta(&sv.Nsd, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStringMap(v *map[string]string, 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 mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, 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 mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentToscaOverride(v **types.ToscaOverride, 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.ToscaOverride + if *v == nil { + sv = &types.ToscaOverride{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "defaultValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DefaultValue = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidateSolFunctionPackageContentMetadata(v **types.ValidateSolFunctionPackageContentMetadata, 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.ValidateSolFunctionPackageContentMetadata + if *v == nil { + sv = &types.ValidateSolFunctionPackageContentMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "vnfd": + if err := awsRestjson1_deserializeDocumentFunctionArtifactMeta(&sv.Vnfd, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidateSolNetworkPackageContentMetadata(v **types.ValidateSolNetworkPackageContentMetadata, 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.ValidateSolNetworkPackageContentMetadata + if *v == nil { + sv = &types.ValidateSolNetworkPackageContentMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nsd": + if err := awsRestjson1_deserializeDocumentNetworkArtifactMeta(&sv.Nsd, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, 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.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVnfPkgIdList(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 VnfPkgId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/tnb/doc.go b/service/tnb/doc.go new file mode 100644 index 00000000000..393bfa96c0e --- /dev/null +++ b/service/tnb/doc.go @@ -0,0 +1,10 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package tnb provides the API client, operations, and parameter types for AWS +// Telco Network Builder. +// +// Amazon Web Services Telco Network Builder (TNB) is a network automation service +// that helps you deploy and manage telecom networks. AWS TNB helps you with the +// lifecycle management of your telecommunication network functions throughout +// planning, deployment, and post-deployment activities. +package tnb diff --git a/service/tnb/document/doc.go b/service/tnb/document/doc.go new file mode 100644 index 00000000000..2b06b14f3cd --- /dev/null +++ b/service/tnb/document/doc.go @@ -0,0 +1,66 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package document implements encoding and decoding of open-content that has a JSON-like data model. +// This data-model allows for UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a +// map of UTF-8 strings to these values. +// +// Interface defines the semantics for how a document type is marshalled and unmarshalled for requests and responses +// for the service. To send a document as input to the service you use NewLazyDocument and pass it the Go type to be +// sent to the service. NewLazyDocument returns a document Interface type that encodes the provided Go type during +// the request serialization step after you have invoked an API client operation that uses the document type. +// +// The following examples show how you can create document types using basic Go types. +// +// NewLazyDocument(map[string]interface{}{ +// "favoriteNumber": 42, +// "fruits": []string{"apple", "orange"}, +// "capitals": map[string]interface{}{ +// "Washington": "Olympia", +// "Oregon": "Salem", +// }, +// "skyIsBlue": true, +// }) +// +// NewLazyDocument(3.14159) +// +// NewLazyDocument([]interface{"One", 2, 3, 3.5, "four"}) +// +// NewLazyDocument(true) +// +// Services can send document types as part of their API responses. To retrieve the content of a response document +// you use the UnmarshalSmithyDocument method on the response document. When calling UnmarshalSmithyDocument you pass +// a reference to the Go type that you want to unmarshal and map the response to. +// +// For example, if you expect to receive key/value map from the service response: +// +// var kv map[string]interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&kv); err != nil { +// // handle error +// } +// +// If a service can return one or more data-types in the response, you can use an empty interface and type switch to +// dynamically handle the response type. +// +// var v interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&v); err != nil { +// // handle error +// } +// +// switch vv := v.(type) { +// case map[string]interface{}: +// // handle key/value map +// case []interface{}: +// // handle array of values +// case bool: +// // handle boolean +// case document.Number: +// // handle an arbitrary precision number +// case string: +// // handle string +// default: +// // handle unknown case +// } +// +// The mapping of Go types to document types is covered in more depth in https://pkg.go.dev/github.com/aws/smithy-go/document +// including more in depth examples that cover user-defined structure types. +package document diff --git a/service/tnb/document/document.go b/service/tnb/document/document.go new file mode 100644 index 00000000000..9bc08777570 --- /dev/null +++ b/service/tnb/document/document.go @@ -0,0 +1,34 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + internaldocument "github.com/aws/aws-sdk-go-v2/service/tnb/internal/document" +) + +// Interface defines a document which is a protocol-agnostic type which supports a +// JSON-like data-model. You can use this type to send UTF-8 strings, arbitrary +// precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 +// strings to these values. +// +// You create a document type using the NewLazyDocument function and passing it the +// Go type to marshal. When receiving a document in an API response, you use the +// document's UnmarshalSmithyDocument function to decode the response to your +// desired Go type. Unless documented specifically generated structure types in +// client packages or client types packages are not supported at this time. Such +// types embed a noSmithyDocumentSerde and will cause an error to be returned when +// attempting to send an API request. +// +// For more information see the accompanying package documentation and linked +// references. +type Interface = internaldocument.Interface + +// You create document type using the NewLazyDocument function and passing it the +// Go type to be marshaled and sent to the service. The document marshaler supports +// semantics similar to the encoding/json Go standard library. +// +// For more information see the accompanying package documentation and linked +// references. +func NewLazyDocument(v interface{}) Interface { + return internaldocument.NewDocumentMarshaler(v) +} diff --git a/service/tnb/endpoints.go b/service/tnb/endpoints.go new file mode 100644 index 00000000000..f2ab7b194d0 --- /dev/null +++ b/service/tnb/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/tnb/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "tnb" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} diff --git a/service/tnb/generated.json b/service/tnb/generated.json new file mode 100644 index 00000000000..bbdec7fd980 --- /dev/null +++ b/service/tnb/generated.json @@ -0,0 +1,64 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CancelSolNetworkOperation.go", + "api_op_CreateSolFunctionPackage.go", + "api_op_CreateSolNetworkInstance.go", + "api_op_CreateSolNetworkPackage.go", + "api_op_DeleteSolFunctionPackage.go", + "api_op_DeleteSolNetworkInstance.go", + "api_op_DeleteSolNetworkPackage.go", + "api_op_GetSolFunctionInstance.go", + "api_op_GetSolFunctionPackage.go", + "api_op_GetSolFunctionPackageContent.go", + "api_op_GetSolFunctionPackageDescriptor.go", + "api_op_GetSolNetworkInstance.go", + "api_op_GetSolNetworkOperation.go", + "api_op_GetSolNetworkPackage.go", + "api_op_GetSolNetworkPackageContent.go", + "api_op_GetSolNetworkPackageDescriptor.go", + "api_op_InstantiateSolNetworkInstance.go", + "api_op_ListSolFunctionInstances.go", + "api_op_ListSolFunctionPackages.go", + "api_op_ListSolNetworkInstances.go", + "api_op_ListSolNetworkOperations.go", + "api_op_ListSolNetworkPackages.go", + "api_op_ListTagsForResource.go", + "api_op_PutSolFunctionPackageContent.go", + "api_op_PutSolNetworkPackageContent.go", + "api_op_TagResource.go", + "api_op_TerminateSolNetworkInstance.go", + "api_op_UntagResource.go", + "api_op_UpdateSolFunctionPackage.go", + "api_op_UpdateSolNetworkInstance.go", + "api_op_UpdateSolNetworkPackage.go", + "api_op_ValidateSolFunctionPackageContent.go", + "api_op_ValidateSolNetworkPackageContent.go", + "deserializers.go", + "doc.go", + "document/doc.go", + "document/document.go", + "endpoints.go", + "generated.json", + "internal/document/document.go", + "internal/document/document_test.go", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/tnb", + "unstable": false +} diff --git a/service/tnb/go.mod b/service/tnb/go.mod new file mode 100644 index 00000000000..56753527bbd --- /dev/null +++ b/service/tnb/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/tnb + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.17.5 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 + github.com/aws/smithy-go v1.13.5 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/tnb/go.sum b/service/tnb/go.sum new file mode 100644 index 00000000000..6f859610e44 --- /dev/null +++ b/service/tnb/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= +github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/tnb/go_module_metadata.go b/service/tnb/go_module_metadata.go new file mode 100644 index 00000000000..523e8e18c52 --- /dev/null +++ b/service/tnb/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package tnb + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/tnb/internal/document/document.go b/service/tnb/internal/document/document.go new file mode 100644 index 00000000000..9f25dd212c4 --- /dev/null +++ b/service/tnb/internal/document/document.go @@ -0,0 +1,98 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + "bytes" + "encoding/json" + smithydocument "github.com/aws/smithy-go/document" + smithydocumentjson "github.com/aws/smithy-go/document/json" +) + +// github.com/aws/aws-sdk-go-v2/service/tnb/internal/document.smithyDocument is an +// interface which is used to bind a document type to its service client. +type smithyDocument interface { + isSmithyDocument() +} + +// github.com/aws/aws-sdk-go-v2/service/tnb/internal/document.Interface is a +// JSON-like data model type that is protocol agnostic and is usedto send +// open-content to a service. +type Interface interface { + smithyDocument + smithydocument.Marshaler + smithydocument.Unmarshaler +} + +type documentMarshaler struct { + value interface{} +} + +func (m *documentMarshaler) UnmarshalSmithyDocument(v interface{}) error { + mBytes, err := m.MarshalSmithyDocument() + if err != nil { + return err + } + + jDecoder := json.NewDecoder(bytes.NewReader(mBytes)) + jDecoder.UseNumber() + + var jv interface{} + if err := jDecoder.Decode(&v); err != nil { + return err + } + + return NewDocumentUnmarshaler(v).UnmarshalSmithyDocument(&jv) +} + +func (m *documentMarshaler) MarshalSmithyDocument() ([]byte, error) { + return smithydocumentjson.NewEncoder().Encode(m.value) +} + +func (m *documentMarshaler) isSmithyDocument() {} + +var _ Interface = (*documentMarshaler)(nil) + +type documentUnmarshaler struct { + value interface{} +} + +func (m *documentUnmarshaler) UnmarshalSmithyDocument(v interface{}) error { + decoder := smithydocumentjson.NewDecoder() + return decoder.DecodeJSONInterface(m.value, v) +} + +func (m *documentUnmarshaler) MarshalSmithyDocument() ([]byte, error) { + return json.Marshal(m.value) +} + +func (m *documentUnmarshaler) isSmithyDocument() {} + +var _ Interface = (*documentUnmarshaler)(nil) + +// NewDocumentMarshaler creates a new document marshaler for the given input type +func NewDocumentMarshaler(v interface{}) Interface { + return &documentMarshaler{ + value: v, + } +} + +// NewDocumentUnmarshaler creates a new document unmarshaler for the given service +// response +func NewDocumentUnmarshaler(v interface{}) Interface { + return &documentUnmarshaler{ + value: v, + } +} + +// github.com/aws/aws-sdk-go-v2/service/tnb/internal/document.IsInterface returns +// whether the given Interface implementation is a valid client implementation +func IsInterface(v Interface) (ok bool) { + defer func() { + if err := recover(); err != nil { + ok = false + } + }() + v.isSmithyDocument() + return true +} diff --git a/service/tnb/internal/document/document_test.go b/service/tnb/internal/document/document_test.go new file mode 100644 index 00000000000..775645dcd6e --- /dev/null +++ b/service/tnb/internal/document/document_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +var _ smithyDocument = (Interface)(nil) +var _ smithydocument.Marshaler = (Interface)(nil) +var _ smithydocument.Unmarshaler = (Interface)(nil) diff --git a/service/tnb/internal/endpoints/endpoints.go b/service/tnb/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..5d4016dfd68 --- /dev/null +++ b/service/tnb/internal/endpoints/endpoints.go @@ -0,0 +1,250 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver tnb endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tnb.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tnb-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tnb-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tnb.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tnb.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tnb-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tnb-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tnb.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tnb-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tnb.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tnb-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tnb.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tnb.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tnb-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tnb-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tnb.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/tnb/internal/endpoints/endpoints_test.go b/service/tnb/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/tnb/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/tnb/protocol_test.go b/service/tnb/protocol_test.go new file mode 100644 index 00000000000..b9db16f8192 --- /dev/null +++ b/service/tnb/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb diff --git a/service/tnb/serializers.go b/service/tnb/serializers.go new file mode 100644 index 00000000000..760224be8af --- /dev/null +++ b/service/tnb/serializers.go @@ -0,0 +1,2241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/tnb/document" + internaldocument "github.com/aws/aws-sdk-go-v2/service/tnb/internal/document" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCancelSolNetworkOperation struct { +} + +func (*awsRestjson1_serializeOpCancelSolNetworkOperation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCancelSolNetworkOperation) 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.(*CancelSolNetworkOperationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_lcm_op_occs/{nsLcmOpOccId}/cancel") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCancelSolNetworkOperationInput(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_serializeOpHttpBindingsCancelSolNetworkOperationInput(v *CancelSolNetworkOperationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsLcmOpOccId == nil || len(*v.NsLcmOpOccId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsLcmOpOccId must not be empty")} + } + if v.NsLcmOpOccId != nil { + if err := encoder.SetURI("nsLcmOpOccId").String(*v.NsLcmOpOccId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateSolFunctionPackage struct { +} + +func (*awsRestjson1_serializeOpCreateSolFunctionPackage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSolFunctionPackage) 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.(*CreateSolFunctionPackageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSolFunctionPackageInput(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_serializeOpHttpBindingsCreateSolFunctionPackageInput(v *CreateSolFunctionPackageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSolFunctionPackageInput(v *CreateSolFunctionPackageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateSolNetworkInstance struct { +} + +func (*awsRestjson1_serializeOpCreateSolNetworkInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSolNetworkInstance) 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.(*CreateSolNetworkInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_instances") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSolNetworkInstanceInput(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_serializeOpHttpBindingsCreateSolNetworkInstanceInput(v *CreateSolNetworkInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSolNetworkInstanceInput(v *CreateSolNetworkInstanceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NsDescription != nil { + ok := object.Key("nsDescription") + ok.String(*v.NsDescription) + } + + if v.NsdInfoId != nil { + ok := object.Key("nsdInfoId") + ok.String(*v.NsdInfoId) + } + + if v.NsName != nil { + ok := object.Key("nsName") + ok.String(*v.NsName) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateSolNetworkPackage struct { +} + +func (*awsRestjson1_serializeOpCreateSolNetworkPackage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSolNetworkPackage) 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.(*CreateSolNetworkPackageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSolNetworkPackageInput(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_serializeOpHttpBindingsCreateSolNetworkPackageInput(v *CreateSolNetworkPackageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSolNetworkPackageInput(v *CreateSolNetworkPackageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteSolFunctionPackage struct { +} + +func (*awsRestjson1_serializeOpDeleteSolFunctionPackage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSolFunctionPackage) 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.(*DeleteSolFunctionPackageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteSolFunctionPackageInput(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_serializeOpHttpBindingsDeleteSolFunctionPackageInput(v *DeleteSolFunctionPackageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VnfPkgId == nil || len(*v.VnfPkgId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member vnfPkgId must not be empty")} + } + if v.VnfPkgId != nil { + if err := encoder.SetURI("vnfPkgId").String(*v.VnfPkgId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteSolNetworkInstance struct { +} + +func (*awsRestjson1_serializeOpDeleteSolNetworkInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSolNetworkInstance) 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.(*DeleteSolNetworkInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_instances/{nsInstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteSolNetworkInstanceInput(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_serializeOpHttpBindingsDeleteSolNetworkInstanceInput(v *DeleteSolNetworkInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsInstanceId == nil || len(*v.NsInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsInstanceId must not be empty")} + } + if v.NsInstanceId != nil { + if err := encoder.SetURI("nsInstanceId").String(*v.NsInstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteSolNetworkPackage struct { +} + +func (*awsRestjson1_serializeOpDeleteSolNetworkPackage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSolNetworkPackage) 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.(*DeleteSolNetworkPackageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors/{nsdInfoId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteSolNetworkPackageInput(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_serializeOpHttpBindingsDeleteSolNetworkPackageInput(v *DeleteSolNetworkPackageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsdInfoId == nil || len(*v.NsdInfoId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsdInfoId must not be empty")} + } + if v.NsdInfoId != nil { + if err := encoder.SetURI("nsdInfoId").String(*v.NsdInfoId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolFunctionInstance struct { +} + +func (*awsRestjson1_serializeOpGetSolFunctionInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolFunctionInstance) 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.(*GetSolFunctionInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnflcm/v1/vnf_instances/{vnfInstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolFunctionInstanceInput(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_serializeOpHttpBindingsGetSolFunctionInstanceInput(v *GetSolFunctionInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VnfInstanceId == nil || len(*v.VnfInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member vnfInstanceId must not be empty")} + } + if v.VnfInstanceId != nil { + if err := encoder.SetURI("vnfInstanceId").String(*v.VnfInstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolFunctionPackage struct { +} + +func (*awsRestjson1_serializeOpGetSolFunctionPackage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolFunctionPackage) 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.(*GetSolFunctionPackageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolFunctionPackageInput(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_serializeOpHttpBindingsGetSolFunctionPackageInput(v *GetSolFunctionPackageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VnfPkgId == nil || len(*v.VnfPkgId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member vnfPkgId must not be empty")} + } + if v.VnfPkgId != nil { + if err := encoder.SetURI("vnfPkgId").String(*v.VnfPkgId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolFunctionPackageContent struct { +} + +func (*awsRestjson1_serializeOpGetSolFunctionPackageContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolFunctionPackageContent) 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.(*GetSolFunctionPackageContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolFunctionPackageContentInput(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_serializeOpHttpBindingsGetSolFunctionPackageContentInput(v *GetSolFunctionPackageContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.Accept) > 0 { + locationName := "Accept" + encoder.SetHeader(locationName).String(string(v.Accept)) + } + + if v.VnfPkgId == nil || len(*v.VnfPkgId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member vnfPkgId must not be empty")} + } + if v.VnfPkgId != nil { + if err := encoder.SetURI("vnfPkgId").String(*v.VnfPkgId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolFunctionPackageDescriptor struct { +} + +func (*awsRestjson1_serializeOpGetSolFunctionPackageDescriptor) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolFunctionPackageDescriptor) 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.(*GetSolFunctionPackageDescriptorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}/vnfd") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolFunctionPackageDescriptorInput(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_serializeOpHttpBindingsGetSolFunctionPackageDescriptorInput(v *GetSolFunctionPackageDescriptorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.Accept) > 0 { + locationName := "Accept" + encoder.SetHeader(locationName).String(string(v.Accept)) + } + + if v.VnfPkgId == nil || len(*v.VnfPkgId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member vnfPkgId must not be empty")} + } + if v.VnfPkgId != nil { + if err := encoder.SetURI("vnfPkgId").String(*v.VnfPkgId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolNetworkInstance struct { +} + +func (*awsRestjson1_serializeOpGetSolNetworkInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolNetworkInstance) 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.(*GetSolNetworkInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_instances/{nsInstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolNetworkInstanceInput(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_serializeOpHttpBindingsGetSolNetworkInstanceInput(v *GetSolNetworkInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsInstanceId == nil || len(*v.NsInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsInstanceId must not be empty")} + } + if v.NsInstanceId != nil { + if err := encoder.SetURI("nsInstanceId").String(*v.NsInstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolNetworkOperation struct { +} + +func (*awsRestjson1_serializeOpGetSolNetworkOperation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolNetworkOperation) 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.(*GetSolNetworkOperationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_lcm_op_occs/{nsLcmOpOccId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolNetworkOperationInput(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_serializeOpHttpBindingsGetSolNetworkOperationInput(v *GetSolNetworkOperationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsLcmOpOccId == nil || len(*v.NsLcmOpOccId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsLcmOpOccId must not be empty")} + } + if v.NsLcmOpOccId != nil { + if err := encoder.SetURI("nsLcmOpOccId").String(*v.NsLcmOpOccId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolNetworkPackage struct { +} + +func (*awsRestjson1_serializeOpGetSolNetworkPackage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolNetworkPackage) 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.(*GetSolNetworkPackageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors/{nsdInfoId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolNetworkPackageInput(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_serializeOpHttpBindingsGetSolNetworkPackageInput(v *GetSolNetworkPackageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsdInfoId == nil || len(*v.NsdInfoId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsdInfoId must not be empty")} + } + if v.NsdInfoId != nil { + if err := encoder.SetURI("nsdInfoId").String(*v.NsdInfoId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolNetworkPackageContent struct { +} + +func (*awsRestjson1_serializeOpGetSolNetworkPackageContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolNetworkPackageContent) 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.(*GetSolNetworkPackageContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors/{nsdInfoId}/nsd_content") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolNetworkPackageContentInput(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_serializeOpHttpBindingsGetSolNetworkPackageContentInput(v *GetSolNetworkPackageContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.Accept) > 0 { + locationName := "Accept" + encoder.SetHeader(locationName).String(string(v.Accept)) + } + + if v.NsdInfoId == nil || len(*v.NsdInfoId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsdInfoId must not be empty")} + } + if v.NsdInfoId != nil { + if err := encoder.SetURI("nsdInfoId").String(*v.NsdInfoId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSolNetworkPackageDescriptor struct { +} + +func (*awsRestjson1_serializeOpGetSolNetworkPackageDescriptor) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSolNetworkPackageDescriptor) 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.(*GetSolNetworkPackageDescriptorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors/{nsdInfoId}/nsd") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSolNetworkPackageDescriptorInput(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_serializeOpHttpBindingsGetSolNetworkPackageDescriptorInput(v *GetSolNetworkPackageDescriptorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsdInfoId == nil || len(*v.NsdInfoId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsdInfoId must not be empty")} + } + if v.NsdInfoId != nil { + if err := encoder.SetURI("nsdInfoId").String(*v.NsdInfoId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpInstantiateSolNetworkInstance struct { +} + +func (*awsRestjson1_serializeOpInstantiateSolNetworkInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpInstantiateSolNetworkInstance) 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.(*InstantiateSolNetworkInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_instances/{nsInstanceId}/instantiate") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsInstantiateSolNetworkInstanceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentInstantiateSolNetworkInstanceInput(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_serializeOpHttpBindingsInstantiateSolNetworkInstanceInput(v *InstantiateSolNetworkInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DryRun != nil { + encoder.SetQuery("dry_run").Boolean(*v.DryRun) + } + + if v.NsInstanceId == nil || len(*v.NsInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsInstanceId must not be empty")} + } + if v.NsInstanceId != nil { + if err := encoder.SetURI("nsInstanceId").String(*v.NsInstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentInstantiateSolNetworkInstanceInput(v *InstantiateSolNetworkInstanceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalParamsForNs != nil { + ok := object.Key("additionalParamsForNs") + if err := awsRestjson1_serializeDocumentDocument(v.AdditionalParamsForNs, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListSolFunctionInstances struct { +} + +func (*awsRestjson1_serializeOpListSolFunctionInstances) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSolFunctionInstances) 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.(*ListSolFunctionInstancesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnflcm/v1/vnf_instances") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSolFunctionInstancesInput(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_serializeOpHttpBindingsListSolFunctionInstancesInput(v *ListSolFunctionInstancesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max_results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextpage_opaque_marker").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSolFunctionPackages struct { +} + +func (*awsRestjson1_serializeOpListSolFunctionPackages) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSolFunctionPackages) 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.(*ListSolFunctionPackagesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSolFunctionPackagesInput(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_serializeOpHttpBindingsListSolFunctionPackagesInput(v *ListSolFunctionPackagesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max_results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextpage_opaque_marker").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSolNetworkInstances struct { +} + +func (*awsRestjson1_serializeOpListSolNetworkInstances) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSolNetworkInstances) 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.(*ListSolNetworkInstancesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_instances") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSolNetworkInstancesInput(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_serializeOpHttpBindingsListSolNetworkInstancesInput(v *ListSolNetworkInstancesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max_results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextpage_opaque_marker").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSolNetworkOperations struct { +} + +func (*awsRestjson1_serializeOpListSolNetworkOperations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSolNetworkOperations) 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.(*ListSolNetworkOperationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_lcm_op_occs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSolNetworkOperationsInput(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_serializeOpHttpBindingsListSolNetworkOperationsInput(v *ListSolNetworkOperationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max_results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextpage_opaque_marker").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSolNetworkPackages struct { +} + +func (*awsRestjson1_serializeOpListSolNetworkPackages) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSolNetworkPackages) 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.(*ListSolNetworkPackagesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSolNetworkPackagesInput(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_serializeOpHttpBindingsListSolNetworkPackagesInput(v *ListSolNetworkPackagesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max_results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextpage_opaque_marker").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) 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.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(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_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutSolFunctionPackageContent struct { +} + +func (*awsRestjson1_serializeOpPutSolFunctionPackageContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutSolFunctionPackageContent) 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.(*PutSolFunctionPackageContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutSolFunctionPackageContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/octet-stream") + } + + if input.File != nil { + payload := bytes.NewReader(input.File) + if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsPutSolFunctionPackageContentInput(v *PutSolFunctionPackageContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ContentType) > 0 { + locationName := "Content-Type" + encoder.SetHeader(locationName).String(string(v.ContentType)) + } + + if v.VnfPkgId == nil || len(*v.VnfPkgId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member vnfPkgId must not be empty")} + } + if v.VnfPkgId != nil { + if err := encoder.SetURI("vnfPkgId").String(*v.VnfPkgId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutSolNetworkPackageContent struct { +} + +func (*awsRestjson1_serializeOpPutSolNetworkPackageContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutSolNetworkPackageContent) 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.(*PutSolNetworkPackageContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors/{nsdInfoId}/nsd_content") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutSolNetworkPackageContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/octet-stream") + } + + if input.File != nil { + payload := bytes.NewReader(input.File) + if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsPutSolNetworkPackageContentInput(v *PutSolNetworkPackageContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ContentType) > 0 { + locationName := "Content-Type" + encoder.SetHeader(locationName).String(string(v.ContentType)) + } + + if v.NsdInfoId == nil || len(*v.NsdInfoId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsdInfoId must not be empty")} + } + if v.NsdInfoId != nil { + if err := encoder.SetURI("nsdInfoId").String(*v.NsdInfoId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) 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.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(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_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTerminateSolNetworkInstance struct { +} + +func (*awsRestjson1_serializeOpTerminateSolNetworkInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTerminateSolNetworkInstance) 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.(*TerminateSolNetworkInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_instances/{nsInstanceId}/terminate") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTerminateSolNetworkInstanceInput(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_serializeOpHttpBindingsTerminateSolNetworkInstanceInput(v *TerminateSolNetworkInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsInstanceId == nil || len(*v.NsInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsInstanceId must not be empty")} + } + if v.NsInstanceId != nil { + if err := encoder.SetURI("nsInstanceId").String(*v.NsInstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) 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.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(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_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSolFunctionPackage struct { +} + +func (*awsRestjson1_serializeOpUpdateSolFunctionPackage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSolFunctionPackage) 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.(*UpdateSolFunctionPackageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateSolFunctionPackageInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSolFunctionPackageInput(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_serializeOpHttpBindingsUpdateSolFunctionPackageInput(v *UpdateSolFunctionPackageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VnfPkgId == nil || len(*v.VnfPkgId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member vnfPkgId must not be empty")} + } + if v.VnfPkgId != nil { + if err := encoder.SetURI("vnfPkgId").String(*v.VnfPkgId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSolFunctionPackageInput(v *UpdateSolFunctionPackageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.OperationalState) > 0 { + ok := object.Key("operationalState") + ok.String(string(v.OperationalState)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSolNetworkInstance struct { +} + +func (*awsRestjson1_serializeOpUpdateSolNetworkInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSolNetworkInstance) 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.(*UpdateSolNetworkInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nslcm/v1/ns_instances/{nsInstanceId}/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateSolNetworkInstanceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSolNetworkInstanceInput(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_serializeOpHttpBindingsUpdateSolNetworkInstanceInput(v *UpdateSolNetworkInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsInstanceId == nil || len(*v.NsInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsInstanceId must not be empty")} + } + if v.NsInstanceId != nil { + if err := encoder.SetURI("nsInstanceId").String(*v.NsInstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSolNetworkInstanceInput(v *UpdateSolNetworkInstanceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ModifyVnfInfoData != nil { + ok := object.Key("modifyVnfInfoData") + if err := awsRestjson1_serializeDocumentUpdateSolNetworkModify(v.ModifyVnfInfoData, ok); err != nil { + return err + } + } + + if len(v.UpdateType) > 0 { + ok := object.Key("updateType") + ok.String(string(v.UpdateType)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSolNetworkPackage struct { +} + +func (*awsRestjson1_serializeOpUpdateSolNetworkPackage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSolNetworkPackage) 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.(*UpdateSolNetworkPackageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors/{nsdInfoId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateSolNetworkPackageInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSolNetworkPackageInput(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_serializeOpHttpBindingsUpdateSolNetworkPackageInput(v *UpdateSolNetworkPackageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NsdInfoId == nil || len(*v.NsdInfoId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsdInfoId must not be empty")} + } + if v.NsdInfoId != nil { + if err := encoder.SetURI("nsdInfoId").String(*v.NsdInfoId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSolNetworkPackageInput(v *UpdateSolNetworkPackageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.NsdOperationalState) > 0 { + ok := object.Key("nsdOperationalState") + ok.String(string(v.NsdOperationalState)) + } + + return nil +} + +type awsRestjson1_serializeOpValidateSolFunctionPackageContent struct { +} + +func (*awsRestjson1_serializeOpValidateSolFunctionPackageContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpValidateSolFunctionPackageContent) 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.(*ValidateSolFunctionPackageContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content/validate") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsValidateSolFunctionPackageContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/octet-stream") + } + + if input.File != nil { + payload := bytes.NewReader(input.File) + if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsValidateSolFunctionPackageContentInput(v *ValidateSolFunctionPackageContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ContentType) > 0 { + locationName := "Content-Type" + encoder.SetHeader(locationName).String(string(v.ContentType)) + } + + if v.VnfPkgId == nil || len(*v.VnfPkgId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member vnfPkgId must not be empty")} + } + if v.VnfPkgId != nil { + if err := encoder.SetURI("vnfPkgId").String(*v.VnfPkgId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpValidateSolNetworkPackageContent struct { +} + +func (*awsRestjson1_serializeOpValidateSolNetworkPackageContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpValidateSolNetworkPackageContent) 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.(*ValidateSolNetworkPackageContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sol/nsd/v1/ns_descriptors/{nsdInfoId}/nsd_content/validate") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsValidateSolNetworkPackageContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/octet-stream") + } + + if input.File != nil { + payload := bytes.NewReader(input.File) + if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsValidateSolNetworkPackageContentInput(v *ValidateSolNetworkPackageContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ContentType) > 0 { + locationName := "Content-Type" + encoder.SetHeader(locationName).String(string(v.ContentType)) + } + + if v.NsdInfoId == nil || len(*v.NsdInfoId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member nsdInfoId must not be empty")} + } + if v.NsdInfoId != nil { + if err := encoder.SetURI("nsdInfoId").String(*v.NsdInfoId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentUpdateSolNetworkModify(v *types.UpdateSolNetworkModify, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.VnfConfigurableProperties != nil { + ok := object.Key("vnfConfigurableProperties") + if err := awsRestjson1_serializeDocumentDocument(v.VnfConfigurableProperties, ok); err != nil { + return err + } + } + + if v.VnfInstanceId != nil { + ok := object.Key("vnfInstanceId") + ok.String(*v.VnfInstanceId) + } + + return nil +} + +func awsRestjson1_serializeDocumentDocument(v document.Interface, value smithyjson.Value) error { + if v == nil { + return nil + } + if !internaldocument.IsInterface(v) { + return fmt.Errorf("%T is not a compatible document type", v) + } + db, err := v.MarshalSmithyDocument() + if err != nil { + return err + } + value.Write(db) + return nil +} diff --git a/service/tnb/types/enums.go b/service/tnb/types/enums.go new file mode 100644 index 00000000000..74f4f9ac613 --- /dev/null +++ b/service/tnb/types/enums.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type DescriptorContentType string + +// Enum values for DescriptorContentType +const ( + DescriptorContentTypeTextPlain DescriptorContentType = "text/plain" +) + +// Values returns all known values for DescriptorContentType. 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 (DescriptorContentType) Values() []DescriptorContentType { + return []DescriptorContentType{ + "text/plain", + } +} + +type LcmOperationType string + +// Enum values for LcmOperationType +const ( + LcmOperationTypeInstantiate LcmOperationType = "INSTANTIATE" + LcmOperationTypeUpdate LcmOperationType = "UPDATE" + LcmOperationTypeTerminate LcmOperationType = "TERMINATE" +) + +// Values returns all known values for LcmOperationType. 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 (LcmOperationType) Values() []LcmOperationType { + return []LcmOperationType{ + "INSTANTIATE", + "UPDATE", + "TERMINATE", + } +} + +type NsdOnboardingState string + +// Enum values for NsdOnboardingState +const ( + NsdOnboardingStateCreated NsdOnboardingState = "CREATED" + NsdOnboardingStateOnboarded NsdOnboardingState = "ONBOARDED" + NsdOnboardingStateError NsdOnboardingState = "ERROR" +) + +// Values returns all known values for NsdOnboardingState. 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 (NsdOnboardingState) Values() []NsdOnboardingState { + return []NsdOnboardingState{ + "CREATED", + "ONBOARDED", + "ERROR", + } +} + +type NsdOperationalState string + +// Enum values for NsdOperationalState +const ( + NsdOperationalStateEnabled NsdOperationalState = "ENABLED" + NsdOperationalStateDisabled NsdOperationalState = "DISABLED" +) + +// Values returns all known values for NsdOperationalState. 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 (NsdOperationalState) Values() []NsdOperationalState { + return []NsdOperationalState{ + "ENABLED", + "DISABLED", + } +} + +type NsdUsageState string + +// Enum values for NsdUsageState +const ( + NsdUsageStateInUse NsdUsageState = "IN_USE" + NsdUsageStateNotInUse NsdUsageState = "NOT_IN_USE" +) + +// Values returns all known values for NsdUsageState. 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 (NsdUsageState) Values() []NsdUsageState { + return []NsdUsageState{ + "IN_USE", + "NOT_IN_USE", + } +} + +type NsLcmOperationState string + +// Enum values for NsLcmOperationState +const ( + NsLcmOperationStateProcessing NsLcmOperationState = "PROCESSING" + NsLcmOperationStateCompleted NsLcmOperationState = "COMPLETED" + NsLcmOperationStateFailed NsLcmOperationState = "FAILED" + NsLcmOperationStateCancelling NsLcmOperationState = "CANCELLING" + NsLcmOperationStateCancelled NsLcmOperationState = "CANCELLED" +) + +// Values returns all known values for NsLcmOperationState. 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 (NsLcmOperationState) Values() []NsLcmOperationState { + return []NsLcmOperationState{ + "PROCESSING", + "COMPLETED", + "FAILED", + "CANCELLING", + "CANCELLED", + } +} + +type NsState string + +// Enum values for NsState +const ( + NsStateInstantiated NsState = "INSTANTIATED" + NsStateNotInstantiated NsState = "NOT_INSTANTIATED" + NsStateImpaired NsState = "IMPAIRED" + NsStateStopped NsState = "STOPPED" + NsStateDeleted NsState = "DELETED" + NsStateInstantiateInProgress NsState = "INSTANTIATE_IN_PROGRESS" + NsStateUpdateInProgress NsState = "UPDATE_IN_PROGRESS" + NsStateTerminateInProgress NsState = "TERMINATE_IN_PROGRESS" +) + +// Values returns all known values for NsState. 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 (NsState) Values() []NsState { + return []NsState{ + "INSTANTIATED", + "NOT_INSTANTIATED", + "IMPAIRED", + "STOPPED", + "DELETED", + "INSTANTIATE_IN_PROGRESS", + "UPDATE_IN_PROGRESS", + "TERMINATE_IN_PROGRESS", + } +} + +type OnboardingState string + +// Enum values for OnboardingState +const ( + OnboardingStateCreated OnboardingState = "CREATED" + OnboardingStateOnboarded OnboardingState = "ONBOARDED" + OnboardingStateError OnboardingState = "ERROR" +) + +// Values returns all known values for OnboardingState. 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 (OnboardingState) Values() []OnboardingState { + return []OnboardingState{ + "CREATED", + "ONBOARDED", + "ERROR", + } +} + +type OperationalState string + +// Enum values for OperationalState +const ( + OperationalStateEnabled OperationalState = "ENABLED" + OperationalStateDisabled OperationalState = "DISABLED" +) + +// Values returns all known values for OperationalState. 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 (OperationalState) Values() []OperationalState { + return []OperationalState{ + "ENABLED", + "DISABLED", + } +} + +type PackageContentType string + +// Enum values for PackageContentType +const ( + PackageContentTypeApplicationZip PackageContentType = "application/zip" +) + +// Values returns all known values for PackageContentType. 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 (PackageContentType) Values() []PackageContentType { + return []PackageContentType{ + "application/zip", + } +} + +type TaskStatus string + +// Enum values for TaskStatus +const ( + TaskStatusScheduled TaskStatus = "SCHEDULED" + TaskStatusStarted TaskStatus = "STARTED" + TaskStatusInProgress TaskStatus = "IN_PROGRESS" + TaskStatusCompleted TaskStatus = "COMPLETED" + TaskStatusError TaskStatus = "ERROR" + TaskStatusSkipped TaskStatus = "SKIPPED" + TaskStatusCancelled TaskStatus = "CANCELLED" +) + +// Values returns all known values for TaskStatus. 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 (TaskStatus) Values() []TaskStatus { + return []TaskStatus{ + "SCHEDULED", + "STARTED", + "IN_PROGRESS", + "COMPLETED", + "ERROR", + "SKIPPED", + "CANCELLED", + } +} + +type UpdateSolNetworkType string + +// Enum values for UpdateSolNetworkType +const ( + UpdateSolNetworkTypeModifyVnfInformation UpdateSolNetworkType = "MODIFY_VNF_INFORMATION" +) + +// Values returns all known values for UpdateSolNetworkType. 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 (UpdateSolNetworkType) Values() []UpdateSolNetworkType { + return []UpdateSolNetworkType{ + "MODIFY_VNF_INFORMATION", + } +} + +type UsageState string + +// Enum values for UsageState +const ( + UsageStateInUse UsageState = "IN_USE" + UsageStateNotInUse UsageState = "NOT_IN_USE" +) + +// Values returns all known values for UsageState. 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 (UsageState) Values() []UsageState { + return []UsageState{ + "IN_USE", + "NOT_IN_USE", + } +} + +type VnfInstantiationState string + +// Enum values for VnfInstantiationState +const ( + VnfInstantiationStateInstantiated VnfInstantiationState = "INSTANTIATED" + VnfInstantiationStateNotInstantiated VnfInstantiationState = "NOT_INSTANTIATED" +) + +// Values returns all known values for VnfInstantiationState. 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 (VnfInstantiationState) Values() []VnfInstantiationState { + return []VnfInstantiationState{ + "INSTANTIATED", + "NOT_INSTANTIATED", + } +} + +type VnfOperationalState string + +// Enum values for VnfOperationalState +const ( + VnfOperationalStateStarted VnfOperationalState = "STARTED" + VnfOperationalStateStopped VnfOperationalState = "STOPPED" +) + +// Values returns all known values for VnfOperationalState. 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 (VnfOperationalState) Values() []VnfOperationalState { + return []VnfOperationalState{ + "STARTED", + "STOPPED", + } +} diff --git a/service/tnb/types/errors.go b/service/tnb/types/errors.go new file mode 100644 index 00000000000..a9fc0ac91f6 --- /dev/null +++ b/service/tnb/types/errors.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Insufficient permissions to make request. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Unexpected error occurred. Problem on the server. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Request references a resource that doesn't exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Service quotas have been exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception caused by throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Unable to process the request because the client provided input failed to +// satisfy request constraints. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/tnb/types/types.go b/service/tnb/types/types.go new file mode 100644 index 00000000000..e3c1a20e002 --- /dev/null +++ b/service/tnb/types/types.go @@ -0,0 +1,657 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "github.com/aws/aws-sdk-go-v2/service/tnb/document" + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Provides error information. +type ErrorInfo struct { + + // Error cause. + Cause *string + + // Error details. + Details *string + + noSmithyDocumentSerde +} + +// Metadata for function package artifacts. Artifacts are the contents of the +// package descriptor file and the state of the package. +type FunctionArtifactMeta struct { + + // Lists of function package overrides. + Overrides []ToscaOverride + + noSmithyDocumentSerde +} + +// The metadata of a network function instance. A network function instance is a +// function in a function package . +type GetSolFunctionInstanceMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + noSmithyDocumentSerde +} + +// Metadata related to the function package. A function package is a .zip file in +// CSAR (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network. +type GetSolFunctionPackageMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + // Metadata related to the function package descriptor of the function package. + Vnfd *FunctionArtifactMeta + + noSmithyDocumentSerde +} + +// Information about a network function. A network instance is a single network +// created in Amazon Web Services TNB that can be deployed and on which life-cycle +// operations (like terminate, update, and delete) can be performed. +type GetSolInstantiatedVnfInfo struct { + + // State of the network function. + VnfState VnfOperationalState + + noSmithyDocumentSerde +} + +// The metadata of a network instance. A network instance is a single network +// created in Amazon Web Services TNB that can be deployed and on which life-cycle +// operations (like terminate, update, and delete) can be performed. +type GetSolNetworkInstanceMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + noSmithyDocumentSerde +} + +// Metadata related to a network operation occurence. A network operation is any +// operation that is done to your network, such as network instance instantiation +// or termination. +type GetSolNetworkOperationMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + noSmithyDocumentSerde +} + +// Gets the details of a network operation. A network operation is any operation +// that is done to your network, such as network instance instantiation or +// termination. +type GetSolNetworkOperationTaskDetails struct { + + // Context for the network operation task. + TaskContext map[string]string + + // Task end time. + TaskEndTime *time.Time + + // Task error details. + TaskErrorDetails *ErrorInfo + + // Task name. + TaskName *string + + // Task start time. + TaskStartTime *time.Time + + // Task status. + TaskStatus TaskStatus + + noSmithyDocumentSerde +} + +// Metadata associated with a network package. A network package is a .zip file in +// CSAR (Cloud Service Archive) format defines the function packages you want to +// deploy and the Amazon Web Services infrastructure you want to deploy them on. +type GetSolNetworkPackageMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + // Metadata related to the onboarded network service descriptor in the network + // package. + Nsd *NetworkArtifactMeta + + noSmithyDocumentSerde +} + +// Details of resource associated with a network function. A network instance is a +// single network created in Amazon Web Services TNB that can be deployed and on +// which life-cycle operations (like terminate, update, and delete) can be +// performed. +type GetSolVnfcResourceInfo struct { + + // The metadata of the network function compute. + Metadata *GetSolVnfcResourceInfoMetadata + + noSmithyDocumentSerde +} + +// The metadata of a network function. A network instance is a single network +// created in Amazon Web Services TNB that can be deployed and on which life-cycle +// operations (like terminate, update, and delete) can be performed. +type GetSolVnfcResourceInfoMetadata struct { + + // Information about the cluster. + Cluster *string + + // Information about the helm chart. + HelmChart *string + + // Information about the node group. + NodeGroup *string + + noSmithyDocumentSerde +} + +// Information about the network function. A network function instance is a +// function in a function package . +type GetSolVnfInfo struct { + + // State of the network function instance. + VnfState VnfOperationalState + + // Compute info used by the network function instance. + VnfcResourceInfo []GetSolVnfcResourceInfo + + noSmithyDocumentSerde +} + +// Lifecycle management operation details on the network instance. Lifecycle +// management operations are deploy, update, or delete operations. +type LcmOperationInfo struct { + + // The identifier of the latest network lifecycle management operation occurrence. + // + // This member is required. + NsLcmOpOccId *string + + noSmithyDocumentSerde +} + +// Lists information about a network function instance. A network function instance +// is a function in a function package . +type ListSolFunctionInstanceInfo struct { + + // Network function instance ARN. + // + // This member is required. + Arn *string + + // Network function instance ID. + // + // This member is required. + Id *string + + // Network function instance instantiation state. + // + // This member is required. + InstantiationState VnfInstantiationState + + // Network function instance metadata. + // + // This member is required. + Metadata *ListSolFunctionInstanceMetadata + + // Network instance ID. + // + // This member is required. + NsInstanceId *string + + // Function package ID. + // + // This member is required. + VnfPkgId *string + + // Information about a network function. A network instance is a single network + // created in Amazon Web Services TNB that can be deployed and on which life-cycle + // operations (like terminate, update, and delete) can be performed. + InstantiatedVnfInfo *GetSolInstantiatedVnfInfo + + // Function package name. + VnfPkgName *string + + noSmithyDocumentSerde +} + +// Lists network function instance metadata. A network function instance is a +// function in a function package . +type ListSolFunctionInstanceMetadata struct { + + // When the network function instance was created. + // + // This member is required. + CreatedAt *time.Time + + // When the network function instance was last modified. + // + // This member is required. + LastModified *time.Time + + noSmithyDocumentSerde +} + +// Information about a function package. A function package is a .zip file in CSAR +// (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network. +type ListSolFunctionPackageInfo struct { + + // Function package ARN. + // + // This member is required. + Arn *string + + // ID of the function package. + // + // This member is required. + Id *string + + // Onboarding state of the function package. + // + // This member is required. + OnboardingState OnboardingState + + // Operational state of the function package. + // + // This member is required. + OperationalState OperationalState + + // Usage state of the function package. + // + // This member is required. + UsageState UsageState + + // The metadata of the function package. + Metadata *ListSolFunctionPackageMetadata + + // The product name for the network function. + VnfProductName *string + + // Provider of the function package and the function package descriptor. + VnfProvider *string + + // Identifies the function package and the function package descriptor. + VnfdId *string + + // Identifies the version of the function package descriptor. + VnfdVersion *string + + noSmithyDocumentSerde +} + +// Details for the function package metadata. A function package is a .zip file in +// CSAR (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network. +type ListSolFunctionPackageMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + noSmithyDocumentSerde +} + +// Info about the specific network instance. A network instance is a single network +// created in Amazon Web Services TNB that can be deployed and on which life-cycle +// operations (like terminate, update, and delete) can be performed. +type ListSolNetworkInstanceInfo struct { + + // Network instance ARN. + // + // This member is required. + Arn *string + + // ID of the network instance. + // + // This member is required. + Id *string + + // The metadata of the network instance. + // + // This member is required. + Metadata *ListSolNetworkInstanceMetadata + + // Human-readable description of the network instance. + // + // This member is required. + NsInstanceDescription *string + + // Human-readable name of the network instance. + // + // This member is required. + NsInstanceName *string + + // The state of the network instance. + // + // This member is required. + NsState NsState + + // ID of the network service descriptor in the network package. + // + // This member is required. + NsdId *string + + // ID of the network service descriptor in the network package. + // + // This member is required. + NsdInfoId *string + + noSmithyDocumentSerde +} + +// Metadata details for a network instance. A network instance is a single network +// created in Amazon Web Services TNB that can be deployed and on which life-cycle +// operations (like terminate, update, and delete) can be performed. +type ListSolNetworkInstanceMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + noSmithyDocumentSerde +} + +// Information parameters for a network operation. +type ListSolNetworkOperationsInfo struct { + + // Network operation ARN. + // + // This member is required. + Arn *string + + // ID of this network operation. + // + // This member is required. + Id *string + + // Type of lifecycle management network operation. + // + // This member is required. + LcmOperationType LcmOperationType + + // ID of the network instance related to this operation. + // + // This member is required. + NsInstanceId *string + + // The state of the network operation. + // + // This member is required. + OperationState NsLcmOperationState + + // Error related to this specific network operation. + Error *ProblemDetails + + // Metadata related to this network operation. + Metadata *ListSolNetworkOperationsMetadata + + noSmithyDocumentSerde +} + +// Metadata related to a network operation. A network operation is any operation +// that is done to your network, such as network instance instantiation or +// termination. +type ListSolNetworkOperationsMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + noSmithyDocumentSerde +} + +// Details of a network package. A network package is a .zip file in CSAR (Cloud +// Service Archive) format defines the function packages you want to deploy and the +// Amazon Web Services infrastructure you want to deploy them on. +type ListSolNetworkPackageInfo struct { + + // Network package ARN. + // + // This member is required. + Arn *string + + // ID of the individual network package. + // + // This member is required. + Id *string + + // The metadata of the network package. + // + // This member is required. + Metadata *ListSolNetworkPackageMetadata + + // Onboarding state of the network service descriptor in the network package. + // + // This member is required. + NsdOnboardingState NsdOnboardingState + + // Operational state of the network service descriptor in the network package. + // + // This member is required. + NsdOperationalState NsdOperationalState + + // Usage state of the network service descriptor in the network package. + // + // This member is required. + NsdUsageState NsdUsageState + + // Designer of the onboarded network service descriptor in the network package. + NsdDesigner *string + + // ID of the network service descriptor on which the network package is based. + NsdId *string + + // Identifies a network service descriptor in a version independent manner. + NsdInvariantId *string + + // Name of the onboarded network service descriptor in the network package. + NsdName *string + + // Version of the onboarded network service descriptor in the network package. + NsdVersion *string + + // Identifies the function package for the function package descriptor referenced + // by the onboarded network package. + VnfPkgIds []string + + noSmithyDocumentSerde +} + +// Metadata related to a network package. A network package is a .zip file in CSAR +// (Cloud Service Archive) format defines the function packages you want to deploy +// and the Amazon Web Services infrastructure you want to deploy them on. +type ListSolNetworkPackageMetadata struct { + + // The date that the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The date that the resource was last modified. + // + // This member is required. + LastModified *time.Time + + noSmithyDocumentSerde +} + +// Metadata for network package artifacts. Artifacts are the contents of the +// package descriptor file and the state of the package. +type NetworkArtifactMeta struct { + + // Lists network package overrides. + Overrides []ToscaOverride + + noSmithyDocumentSerde +} + +// Details related to problems with AWS TNB resources. +type ProblemDetails struct { + + // A human-readable explanation specific to this occurrence of the problem. + // + // This member is required. + Detail *string + + // A human-readable title of the problem type. + Title *string + + noSmithyDocumentSerde +} + +// Update metadata in a function package. A function package is a .zip file in CSAR +// (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network. +type PutSolFunctionPackageContentMetadata struct { + + // Metadata for function package artifacts. Artifacts are the contents of the + // package descriptor file and the state of the package. + Vnfd *FunctionArtifactMeta + + noSmithyDocumentSerde +} + +// Update metadata in a network package. A network package is a .zip file in CSAR +// (Cloud Service Archive) format defines the function packages you want to deploy +// and the Amazon Web Services infrastructure you want to deploy them on. +type PutSolNetworkPackageContentMetadata struct { + + // Metadata for network package artifacts. Artifacts are the contents of the + // package descriptor file and the state of the package. + Nsd *NetworkArtifactMeta + + noSmithyDocumentSerde +} + +// Overrides of the TOSCA node. +type ToscaOverride struct { + + // Default value for the override. + DefaultValue *string + + // Name of the TOSCA override. + Name *string + + noSmithyDocumentSerde +} + +// Information parameters and/or the configurable properties for a network +// function. A network function instance is a function in a function package . +type UpdateSolNetworkModify struct { + + // Provides values for the configurable properties declared in the function package + // descriptor. + // + // This member is required. + VnfConfigurableProperties document.Interface + + // ID of the network function instance. A network function instance is a function + // in a function package . + // + // This member is required. + VnfInstanceId *string + + noSmithyDocumentSerde +} + +// Validates function package content metadata. A function package is a .zip file +// in CSAR (Cloud Service Archive) format that contains a network function (an ETSI +// standard telecommunication application) and function package descriptor that +// uses the TOSCA standard to describe how the network functions should run on your +// network. +type ValidateSolFunctionPackageContentMetadata struct { + + // Metadata for function package artifacts. Artifacts are the contents of the + // package descriptor file and the state of the package. + Vnfd *FunctionArtifactMeta + + noSmithyDocumentSerde +} + +// Validates network package content metadata. A network package is a .zip file in +// CSAR (Cloud Service Archive) format defines the function packages you want to +// deploy and the Amazon Web Services infrastructure you want to deploy them on. +type ValidateSolNetworkPackageContentMetadata struct { + + // Metadata for network package artifacts. Artifacts are the contents of the + // package descriptor file and the state of the package. + Nsd *NetworkArtifactMeta + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/tnb/validators.go b/service/tnb/validators.go new file mode 100644 index 00000000000..84f82944e5d --- /dev/null +++ b/service/tnb/validators.go @@ -0,0 +1,1087 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/tnb/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCancelSolNetworkOperation struct { +} + +func (*validateOpCancelSolNetworkOperation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelSolNetworkOperation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelSolNetworkOperationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelSolNetworkOperationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSolNetworkInstance struct { +} + +func (*validateOpCreateSolNetworkInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSolNetworkInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSolNetworkInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSolNetworkInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSolFunctionPackage struct { +} + +func (*validateOpDeleteSolFunctionPackage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSolFunctionPackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSolFunctionPackageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSolFunctionPackageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSolNetworkInstance struct { +} + +func (*validateOpDeleteSolNetworkInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSolNetworkInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSolNetworkInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSolNetworkInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSolNetworkPackage struct { +} + +func (*validateOpDeleteSolNetworkPackage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSolNetworkPackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSolNetworkPackageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSolNetworkPackageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolFunctionInstance struct { +} + +func (*validateOpGetSolFunctionInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolFunctionInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolFunctionInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolFunctionInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolFunctionPackageContent struct { +} + +func (*validateOpGetSolFunctionPackageContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolFunctionPackageContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolFunctionPackageContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolFunctionPackageContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolFunctionPackageDescriptor struct { +} + +func (*validateOpGetSolFunctionPackageDescriptor) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolFunctionPackageDescriptor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolFunctionPackageDescriptorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolFunctionPackageDescriptorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolFunctionPackage struct { +} + +func (*validateOpGetSolFunctionPackage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolFunctionPackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolFunctionPackageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolFunctionPackageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolNetworkInstance struct { +} + +func (*validateOpGetSolNetworkInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolNetworkInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolNetworkInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolNetworkInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolNetworkOperation struct { +} + +func (*validateOpGetSolNetworkOperation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolNetworkOperation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolNetworkOperationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolNetworkOperationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolNetworkPackageContent struct { +} + +func (*validateOpGetSolNetworkPackageContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolNetworkPackageContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolNetworkPackageContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolNetworkPackageContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolNetworkPackageDescriptor struct { +} + +func (*validateOpGetSolNetworkPackageDescriptor) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolNetworkPackageDescriptor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolNetworkPackageDescriptorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolNetworkPackageDescriptorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSolNetworkPackage struct { +} + +func (*validateOpGetSolNetworkPackage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSolNetworkPackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSolNetworkPackageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSolNetworkPackageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpInstantiateSolNetworkInstance struct { +} + +func (*validateOpInstantiateSolNetworkInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpInstantiateSolNetworkInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*InstantiateSolNetworkInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpInstantiateSolNetworkInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutSolFunctionPackageContent struct { +} + +func (*validateOpPutSolFunctionPackageContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutSolFunctionPackageContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutSolFunctionPackageContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutSolFunctionPackageContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutSolNetworkPackageContent struct { +} + +func (*validateOpPutSolNetworkPackageContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutSolNetworkPackageContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutSolNetworkPackageContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutSolNetworkPackageContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTerminateSolNetworkInstance struct { +} + +func (*validateOpTerminateSolNetworkInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTerminateSolNetworkInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TerminateSolNetworkInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTerminateSolNetworkInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSolFunctionPackage struct { +} + +func (*validateOpUpdateSolFunctionPackage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSolFunctionPackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSolFunctionPackageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSolFunctionPackageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSolNetworkInstance struct { +} + +func (*validateOpUpdateSolNetworkInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSolNetworkInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSolNetworkInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSolNetworkInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSolNetworkPackage struct { +} + +func (*validateOpUpdateSolNetworkPackage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSolNetworkPackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSolNetworkPackageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSolNetworkPackageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpValidateSolFunctionPackageContent struct { +} + +func (*validateOpValidateSolFunctionPackageContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpValidateSolFunctionPackageContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ValidateSolFunctionPackageContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpValidateSolFunctionPackageContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpValidateSolNetworkPackageContent struct { +} + +func (*validateOpValidateSolNetworkPackageContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpValidateSolNetworkPackageContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ValidateSolNetworkPackageContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpValidateSolNetworkPackageContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCancelSolNetworkOperationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelSolNetworkOperation{}, middleware.After) +} + +func addOpCreateSolNetworkInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSolNetworkInstance{}, middleware.After) +} + +func addOpDeleteSolFunctionPackageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSolFunctionPackage{}, middleware.After) +} + +func addOpDeleteSolNetworkInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSolNetworkInstance{}, middleware.After) +} + +func addOpDeleteSolNetworkPackageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSolNetworkPackage{}, middleware.After) +} + +func addOpGetSolFunctionInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolFunctionInstance{}, middleware.After) +} + +func addOpGetSolFunctionPackageContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolFunctionPackageContent{}, middleware.After) +} + +func addOpGetSolFunctionPackageDescriptorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolFunctionPackageDescriptor{}, middleware.After) +} + +func addOpGetSolFunctionPackageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolFunctionPackage{}, middleware.After) +} + +func addOpGetSolNetworkInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolNetworkInstance{}, middleware.After) +} + +func addOpGetSolNetworkOperationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolNetworkOperation{}, middleware.After) +} + +func addOpGetSolNetworkPackageContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolNetworkPackageContent{}, middleware.After) +} + +func addOpGetSolNetworkPackageDescriptorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolNetworkPackageDescriptor{}, middleware.After) +} + +func addOpGetSolNetworkPackageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSolNetworkPackage{}, middleware.After) +} + +func addOpInstantiateSolNetworkInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpInstantiateSolNetworkInstance{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpPutSolFunctionPackageContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutSolFunctionPackageContent{}, middleware.After) +} + +func addOpPutSolNetworkPackageContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutSolNetworkPackageContent{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpTerminateSolNetworkInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTerminateSolNetworkInstance{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateSolFunctionPackageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSolFunctionPackage{}, middleware.After) +} + +func addOpUpdateSolNetworkInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSolNetworkInstance{}, middleware.After) +} + +func addOpUpdateSolNetworkPackageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSolNetworkPackage{}, middleware.After) +} + +func addOpValidateSolFunctionPackageContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpValidateSolFunctionPackageContent{}, middleware.After) +} + +func addOpValidateSolNetworkPackageContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpValidateSolNetworkPackageContent{}, middleware.After) +} + +func validateUpdateSolNetworkModify(v *types.UpdateSolNetworkModify) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSolNetworkModify"} + if v.VnfInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfInstanceId")) + } + if v.VnfConfigurableProperties == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfConfigurableProperties")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCancelSolNetworkOperationInput(v *CancelSolNetworkOperationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelSolNetworkOperationInput"} + if v.NsLcmOpOccId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsLcmOpOccId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateSolNetworkInstanceInput(v *CreateSolNetworkInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSolNetworkInstanceInput"} + if v.NsdInfoId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsdInfoId")) + } + if v.NsName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSolFunctionPackageInput(v *DeleteSolFunctionPackageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSolFunctionPackageInput"} + if v.VnfPkgId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfPkgId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSolNetworkInstanceInput(v *DeleteSolNetworkInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSolNetworkInstanceInput"} + if v.NsInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSolNetworkPackageInput(v *DeleteSolNetworkPackageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSolNetworkPackageInput"} + if v.NsdInfoId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsdInfoId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolFunctionInstanceInput(v *GetSolFunctionInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolFunctionInstanceInput"} + if v.VnfInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolFunctionPackageContentInput(v *GetSolFunctionPackageContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolFunctionPackageContentInput"} + if v.VnfPkgId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfPkgId")) + } + if len(v.Accept) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Accept")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolFunctionPackageDescriptorInput(v *GetSolFunctionPackageDescriptorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolFunctionPackageDescriptorInput"} + if v.VnfPkgId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfPkgId")) + } + if len(v.Accept) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Accept")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolFunctionPackageInput(v *GetSolFunctionPackageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolFunctionPackageInput"} + if v.VnfPkgId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfPkgId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolNetworkInstanceInput(v *GetSolNetworkInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolNetworkInstanceInput"} + if v.NsInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolNetworkOperationInput(v *GetSolNetworkOperationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolNetworkOperationInput"} + if v.NsLcmOpOccId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsLcmOpOccId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolNetworkPackageContentInput(v *GetSolNetworkPackageContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolNetworkPackageContentInput"} + if v.NsdInfoId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsdInfoId")) + } + if len(v.Accept) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Accept")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolNetworkPackageDescriptorInput(v *GetSolNetworkPackageDescriptorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolNetworkPackageDescriptorInput"} + if v.NsdInfoId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsdInfoId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSolNetworkPackageInput(v *GetSolNetworkPackageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSolNetworkPackageInput"} + if v.NsdInfoId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsdInfoId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpInstantiateSolNetworkInstanceInput(v *InstantiateSolNetworkInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InstantiateSolNetworkInstanceInput"} + if v.NsInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutSolFunctionPackageContentInput(v *PutSolFunctionPackageContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutSolFunctionPackageContentInput"} + if v.VnfPkgId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfPkgId")) + } + if v.File == nil { + invalidParams.Add(smithy.NewErrParamRequired("File")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutSolNetworkPackageContentInput(v *PutSolNetworkPackageContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutSolNetworkPackageContentInput"} + if v.NsdInfoId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsdInfoId")) + } + if v.File == nil { + invalidParams.Add(smithy.NewErrParamRequired("File")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTerminateSolNetworkInstanceInput(v *TerminateSolNetworkInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TerminateSolNetworkInstanceInput"} + if v.NsInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSolFunctionPackageInput(v *UpdateSolFunctionPackageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSolFunctionPackageInput"} + if v.VnfPkgId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfPkgId")) + } + if len(v.OperationalState) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("OperationalState")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSolNetworkInstanceInput(v *UpdateSolNetworkInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSolNetworkInstanceInput"} + if v.NsInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsInstanceId")) + } + if len(v.UpdateType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("UpdateType")) + } + if v.ModifyVnfInfoData != nil { + if err := validateUpdateSolNetworkModify(v.ModifyVnfInfoData); err != nil { + invalidParams.AddNested("ModifyVnfInfoData", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSolNetworkPackageInput(v *UpdateSolNetworkPackageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSolNetworkPackageInput"} + if v.NsdInfoId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsdInfoId")) + } + if len(v.NsdOperationalState) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("NsdOperationalState")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpValidateSolFunctionPackageContentInput(v *ValidateSolFunctionPackageContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ValidateSolFunctionPackageContentInput"} + if v.VnfPkgId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VnfPkgId")) + } + if v.File == nil { + invalidParams.Add(smithy.NewErrParamRequired("File")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpValidateSolNetworkPackageContentInput(v *ValidateSolNetworkPackageContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ValidateSolNetworkPackageContentInput"} + if v.NsdInfoId == nil { + invalidParams.Add(smithy.NewErrParamRequired("NsdInfoId")) + } + if v.File == nil { + invalidParams.Add(smithy.NewErrParamRequired("File")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +}