From ffda1f4c767445b3dc511fac39e805530ca2fced Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Tue, 23 Jan 2024 20:38:55 +0000 Subject: [PATCH] Regenerated Clients --- .../68010d18c72942d38201329465a197ef.json | 8 + .../api_op_CreateCisScanConfiguration.go | 156 + .../api_op_DeleteCisScanConfiguration.go | 138 + service/inspector2/api_op_GetCisScanReport.go | 143 + .../api_op_GetCisScanResultDetails.go | 261 + .../api_op_ListCisScanConfigurations.go | 246 + ...op_ListCisScanResultsAggregatedByChecks.go | 252 + ...isScanResultsAggregatedByTargetResource.go | 252 + service/inspector2/api_op_ListCisScans.go | 244 + .../inspector2/api_op_SendCisSessionHealth.go | 140 + .../api_op_SendCisSessionTelemetry.go | 146 + service/inspector2/api_op_StartCisSession.go | 141 + service/inspector2/api_op_StopCisSession.go | 146 + .../api_op_UpdateCisScanConfiguration.go | 152 + service/inspector2/deserializers.go | 5898 +++++++++++++---- service/inspector2/endpoints.go | 2 +- service/inspector2/generated.json | 13 + service/inspector2/serializers.go | 3227 +++++++-- service/inspector2/types/enums.go | 480 ++ service/inspector2/types/types.go | 743 ++- .../inspector2/types/types_exported_test.go | 30 + service/inspector2/validators.go | 1621 ++++- 22 files changed, 12499 insertions(+), 1940 deletions(-) create mode 100644 .changelog/68010d18c72942d38201329465a197ef.json create mode 100644 service/inspector2/api_op_CreateCisScanConfiguration.go create mode 100644 service/inspector2/api_op_DeleteCisScanConfiguration.go create mode 100644 service/inspector2/api_op_GetCisScanReport.go create mode 100644 service/inspector2/api_op_GetCisScanResultDetails.go create mode 100644 service/inspector2/api_op_ListCisScanConfigurations.go create mode 100644 service/inspector2/api_op_ListCisScanResultsAggregatedByChecks.go create mode 100644 service/inspector2/api_op_ListCisScanResultsAggregatedByTargetResource.go create mode 100644 service/inspector2/api_op_ListCisScans.go create mode 100644 service/inspector2/api_op_SendCisSessionHealth.go create mode 100644 service/inspector2/api_op_SendCisSessionTelemetry.go create mode 100644 service/inspector2/api_op_StartCisSession.go create mode 100644 service/inspector2/api_op_StopCisSession.go create mode 100644 service/inspector2/api_op_UpdateCisScanConfiguration.go diff --git a/.changelog/68010d18c72942d38201329465a197ef.json b/.changelog/68010d18c72942d38201329465a197ef.json new file mode 100644 index 00000000000..d5909d3021f --- /dev/null +++ b/.changelog/68010d18c72942d38201329465a197ef.json @@ -0,0 +1,8 @@ +{ + "id": "68010d18-c729-42d3-8201-329465a197ef", + "type": "feature", + "description": "This release adds support for CIS scans on EC2 instances.", + "modules": [ + "service/inspector2" + ] +} \ No newline at end of file diff --git a/service/inspector2/api_op_CreateCisScanConfiguration.go b/service/inspector2/api_op_CreateCisScanConfiguration.go new file mode 100644 index 00000000000..83efbe1e780 --- /dev/null +++ b/service/inspector2/api_op_CreateCisScanConfiguration.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a CIS scan configuration. +func (c *Client) CreateCisScanConfiguration(ctx context.Context, params *CreateCisScanConfigurationInput, optFns ...func(*Options)) (*CreateCisScanConfigurationOutput, error) { + if params == nil { + params = &CreateCisScanConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateCisScanConfiguration", params, optFns, c.addOperationCreateCisScanConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateCisScanConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateCisScanConfigurationInput struct { + + // The scan name for the CIS scan configuration. + // + // This member is required. + ScanName *string + + // The schedule for the CIS scan configuration. + // + // This member is required. + Schedule types.Schedule + + // The security level for the CIS scan configuration. Security level refers to the + // Benchmark levels that CIS assigns to a profile. + // + // This member is required. + SecurityLevel types.CisSecurityLevel + + // The targets for the CIS scan configuration. + // + // This member is required. + Targets *types.CreateCisTargets + + // The tags for the CIS scan configuration. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateCisScanConfigurationOutput struct { + + // The scan configuration ARN for the CIS scan configuration. + ScanConfigurationArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateCisScanConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCisScanConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCisScanConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCisScanConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateCisScanConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCisScanConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateCisScanConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateCisScanConfiguration", + } +} diff --git a/service/inspector2/api_op_DeleteCisScanConfiguration.go b/service/inspector2/api_op_DeleteCisScanConfiguration.go new file mode 100644 index 00000000000..b5ceb4a9412 --- /dev/null +++ b/service/inspector2/api_op_DeleteCisScanConfiguration.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a CIS scan configuration. +func (c *Client) DeleteCisScanConfiguration(ctx context.Context, params *DeleteCisScanConfigurationInput, optFns ...func(*Options)) (*DeleteCisScanConfigurationOutput, error) { + if params == nil { + params = &DeleteCisScanConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCisScanConfiguration", params, optFns, c.addOperationDeleteCisScanConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCisScanConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteCisScanConfigurationInput struct { + + // The ARN of the CIS scan configuration. + // + // This member is required. + ScanConfigurationArn *string + + noSmithyDocumentSerde +} + +type DeleteCisScanConfigurationOutput struct { + + // The ARN of the CIS scan configuration. + // + // This member is required. + ScanConfigurationArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCisScanConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCisScanConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCisScanConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCisScanConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteCisScanConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCisScanConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCisScanConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCisScanConfiguration", + } +} diff --git a/service/inspector2/api_op_GetCisScanReport.go b/service/inspector2/api_op_GetCisScanReport.go new file mode 100644 index 00000000000..1ce57c707a5 --- /dev/null +++ b/service/inspector2/api_op_GetCisScanReport.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a CIS scan report. +func (c *Client) GetCisScanReport(ctx context.Context, params *GetCisScanReportInput, optFns ...func(*Options)) (*GetCisScanReportOutput, error) { + if params == nil { + params = &GetCisScanReportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCisScanReport", params, optFns, c.addOperationGetCisScanReportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCisScanReportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCisScanReportInput struct { + + // The scan ARN. + // + // This member is required. + ScanArn *string + + // The target accounts. + TargetAccounts []string + + noSmithyDocumentSerde +} + +type GetCisScanReportOutput struct { + + // The status. + Status types.CisReportStatus + + // The URL where the CIS scan report PDF can be downloaded. + Url *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCisScanReportMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCisScanReport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCisScanReport{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCisScanReport"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetCisScanReportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCisScanReport(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCisScanReport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCisScanReport", + } +} diff --git a/service/inspector2/api_op_GetCisScanResultDetails.go b/service/inspector2/api_op_GetCisScanResultDetails.go new file mode 100644 index 00000000000..2cedb950dd7 --- /dev/null +++ b/service/inspector2/api_op_GetCisScanResultDetails.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves CIS scan result details. +func (c *Client) GetCisScanResultDetails(ctx context.Context, params *GetCisScanResultDetailsInput, optFns ...func(*Options)) (*GetCisScanResultDetailsOutput, error) { + if params == nil { + params = &GetCisScanResultDetailsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCisScanResultDetails", params, optFns, c.addOperationGetCisScanResultDetailsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCisScanResultDetailsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCisScanResultDetailsInput struct { + + // The account ID. + // + // This member is required. + AccountId *string + + // The scan ARN. + // + // This member is required. + ScanArn *string + + // The target resource ID. + // + // This member is required. + TargetResourceId *string + + // The filter criteria. + FilterCriteria *types.CisScanResultDetailsFilterCriteria + + // The maximum number of CIS scan result details to be returned in a single page + // of results. + MaxResults *int32 + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The sort by order. + SortBy types.CisScanResultDetailsSortBy + + // The sort order. + SortOrder types.CisSortOrder + + noSmithyDocumentSerde +} + +type GetCisScanResultDetailsOutput struct { + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The scan result details. + ScanResultDetails []types.CisScanResultDetails + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCisScanResultDetailsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCisScanResultDetails{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCisScanResultDetails{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCisScanResultDetails"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetCisScanResultDetailsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCisScanResultDetails(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// GetCisScanResultDetailsAPIClient is a client that implements the +// GetCisScanResultDetails operation. +type GetCisScanResultDetailsAPIClient interface { + GetCisScanResultDetails(context.Context, *GetCisScanResultDetailsInput, ...func(*Options)) (*GetCisScanResultDetailsOutput, error) +} + +var _ GetCisScanResultDetailsAPIClient = (*Client)(nil) + +// GetCisScanResultDetailsPaginatorOptions is the paginator options for +// GetCisScanResultDetails +type GetCisScanResultDetailsPaginatorOptions struct { + // The maximum number of CIS scan result details to be returned in a single page + // of results. + 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 +} + +// GetCisScanResultDetailsPaginator is a paginator for GetCisScanResultDetails +type GetCisScanResultDetailsPaginator struct { + options GetCisScanResultDetailsPaginatorOptions + client GetCisScanResultDetailsAPIClient + params *GetCisScanResultDetailsInput + nextToken *string + firstPage bool +} + +// NewGetCisScanResultDetailsPaginator returns a new +// GetCisScanResultDetailsPaginator +func NewGetCisScanResultDetailsPaginator(client GetCisScanResultDetailsAPIClient, params *GetCisScanResultDetailsInput, optFns ...func(*GetCisScanResultDetailsPaginatorOptions)) *GetCisScanResultDetailsPaginator { + if params == nil { + params = &GetCisScanResultDetailsInput{} + } + + options := GetCisScanResultDetailsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetCisScanResultDetailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCisScanResultDetailsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetCisScanResultDetails page. +func (p *GetCisScanResultDetailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCisScanResultDetailsOutput, 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.GetCisScanResultDetails(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_opGetCisScanResultDetails(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCisScanResultDetails", + } +} diff --git a/service/inspector2/api_op_ListCisScanConfigurations.go b/service/inspector2/api_op_ListCisScanConfigurations.go new file mode 100644 index 00000000000..02c6b410267 --- /dev/null +++ b/service/inspector2/api_op_ListCisScanConfigurations.go @@ -0,0 +1,246 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists CIS scan configurations. +func (c *Client) ListCisScanConfigurations(ctx context.Context, params *ListCisScanConfigurationsInput, optFns ...func(*Options)) (*ListCisScanConfigurationsOutput, error) { + if params == nil { + params = &ListCisScanConfigurationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCisScanConfigurations", params, optFns, c.addOperationListCisScanConfigurationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCisScanConfigurationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCisScanConfigurationsInput struct { + + // The CIS scan configuration filter criteria. + FilterCriteria *types.ListCisScanConfigurationsFilterCriteria + + // The maximum number of CIS scan configurations to be returned in a single page + // of results. + MaxResults *int32 + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The CIS scan configuration sort by order. + SortBy types.CisScanConfigurationsSortBy + + // The CIS scan configuration sort order order. + SortOrder types.CisSortOrder + + noSmithyDocumentSerde +} + +type ListCisScanConfigurationsOutput struct { + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The CIS scan configuration scan configurations. + ScanConfigurations []types.CisScanConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCisScanConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCisScanConfigurations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCisScanConfigurations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCisScanConfigurations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListCisScanConfigurationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCisScanConfigurations(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListCisScanConfigurationsAPIClient is a client that implements the +// ListCisScanConfigurations operation. +type ListCisScanConfigurationsAPIClient interface { + ListCisScanConfigurations(context.Context, *ListCisScanConfigurationsInput, ...func(*Options)) (*ListCisScanConfigurationsOutput, error) +} + +var _ ListCisScanConfigurationsAPIClient = (*Client)(nil) + +// ListCisScanConfigurationsPaginatorOptions is the paginator options for +// ListCisScanConfigurations +type ListCisScanConfigurationsPaginatorOptions struct { + // The maximum number of CIS scan configurations to be returned in a single page + // of results. + 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 +} + +// ListCisScanConfigurationsPaginator is a paginator for ListCisScanConfigurations +type ListCisScanConfigurationsPaginator struct { + options ListCisScanConfigurationsPaginatorOptions + client ListCisScanConfigurationsAPIClient + params *ListCisScanConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListCisScanConfigurationsPaginator returns a new +// ListCisScanConfigurationsPaginator +func NewListCisScanConfigurationsPaginator(client ListCisScanConfigurationsAPIClient, params *ListCisScanConfigurationsInput, optFns ...func(*ListCisScanConfigurationsPaginatorOptions)) *ListCisScanConfigurationsPaginator { + if params == nil { + params = &ListCisScanConfigurationsInput{} + } + + options := ListCisScanConfigurationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCisScanConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCisScanConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCisScanConfigurations page. +func (p *ListCisScanConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCisScanConfigurationsOutput, 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.ListCisScanConfigurations(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_opListCisScanConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCisScanConfigurations", + } +} diff --git a/service/inspector2/api_op_ListCisScanResultsAggregatedByChecks.go b/service/inspector2/api_op_ListCisScanResultsAggregatedByChecks.go new file mode 100644 index 00000000000..568cac11a92 --- /dev/null +++ b/service/inspector2/api_op_ListCisScanResultsAggregatedByChecks.go @@ -0,0 +1,252 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists scan results aggregated by checks. +func (c *Client) ListCisScanResultsAggregatedByChecks(ctx context.Context, params *ListCisScanResultsAggregatedByChecksInput, optFns ...func(*Options)) (*ListCisScanResultsAggregatedByChecksOutput, error) { + if params == nil { + params = &ListCisScanResultsAggregatedByChecksInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCisScanResultsAggregatedByChecks", params, optFns, c.addOperationListCisScanResultsAggregatedByChecksMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCisScanResultsAggregatedByChecksOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCisScanResultsAggregatedByChecksInput struct { + + // The scan ARN. + // + // This member is required. + ScanArn *string + + // The filter criteria. + FilterCriteria *types.CisScanResultsAggregatedByChecksFilterCriteria + + // The maximum number of scan results aggregated by checks to be returned in a + // single page of results. + MaxResults *int32 + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The sort by order. + SortBy types.CisScanResultsAggregatedByChecksSortBy + + // The sort order. + SortOrder types.CisSortOrder + + noSmithyDocumentSerde +} + +type ListCisScanResultsAggregatedByChecksOutput struct { + + // The check aggregations. + CheckAggregations []types.CisCheckAggregation + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCisScanResultsAggregatedByChecksMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCisScanResultsAggregatedByChecks{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCisScanResultsAggregatedByChecks{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCisScanResultsAggregatedByChecks"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListCisScanResultsAggregatedByChecksValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCisScanResultsAggregatedByChecks(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListCisScanResultsAggregatedByChecksAPIClient is a client that implements the +// ListCisScanResultsAggregatedByChecks operation. +type ListCisScanResultsAggregatedByChecksAPIClient interface { + ListCisScanResultsAggregatedByChecks(context.Context, *ListCisScanResultsAggregatedByChecksInput, ...func(*Options)) (*ListCisScanResultsAggregatedByChecksOutput, error) +} + +var _ ListCisScanResultsAggregatedByChecksAPIClient = (*Client)(nil) + +// ListCisScanResultsAggregatedByChecksPaginatorOptions is the paginator options +// for ListCisScanResultsAggregatedByChecks +type ListCisScanResultsAggregatedByChecksPaginatorOptions struct { + // The maximum number of scan results aggregated by checks to be returned in a + // single page of results. + 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 +} + +// ListCisScanResultsAggregatedByChecksPaginator is a paginator for +// ListCisScanResultsAggregatedByChecks +type ListCisScanResultsAggregatedByChecksPaginator struct { + options ListCisScanResultsAggregatedByChecksPaginatorOptions + client ListCisScanResultsAggregatedByChecksAPIClient + params *ListCisScanResultsAggregatedByChecksInput + nextToken *string + firstPage bool +} + +// NewListCisScanResultsAggregatedByChecksPaginator returns a new +// ListCisScanResultsAggregatedByChecksPaginator +func NewListCisScanResultsAggregatedByChecksPaginator(client ListCisScanResultsAggregatedByChecksAPIClient, params *ListCisScanResultsAggregatedByChecksInput, optFns ...func(*ListCisScanResultsAggregatedByChecksPaginatorOptions)) *ListCisScanResultsAggregatedByChecksPaginator { + if params == nil { + params = &ListCisScanResultsAggregatedByChecksInput{} + } + + options := ListCisScanResultsAggregatedByChecksPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCisScanResultsAggregatedByChecksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCisScanResultsAggregatedByChecksPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCisScanResultsAggregatedByChecks page. +func (p *ListCisScanResultsAggregatedByChecksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCisScanResultsAggregatedByChecksOutput, 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.ListCisScanResultsAggregatedByChecks(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_opListCisScanResultsAggregatedByChecks(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCisScanResultsAggregatedByChecks", + } +} diff --git a/service/inspector2/api_op_ListCisScanResultsAggregatedByTargetResource.go b/service/inspector2/api_op_ListCisScanResultsAggregatedByTargetResource.go new file mode 100644 index 00000000000..181f15a165d --- /dev/null +++ b/service/inspector2/api_op_ListCisScanResultsAggregatedByTargetResource.go @@ -0,0 +1,252 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists scan results aggregated by a target resource. +func (c *Client) ListCisScanResultsAggregatedByTargetResource(ctx context.Context, params *ListCisScanResultsAggregatedByTargetResourceInput, optFns ...func(*Options)) (*ListCisScanResultsAggregatedByTargetResourceOutput, error) { + if params == nil { + params = &ListCisScanResultsAggregatedByTargetResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCisScanResultsAggregatedByTargetResource", params, optFns, c.addOperationListCisScanResultsAggregatedByTargetResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCisScanResultsAggregatedByTargetResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCisScanResultsAggregatedByTargetResourceInput struct { + + // The scan ARN. + // + // This member is required. + ScanArn *string + + // The filter criteria. + FilterCriteria *types.CisScanResultsAggregatedByTargetResourceFilterCriteria + + // The maximum number of scan results aggregated by a target resource to be + // returned in a single page of results. + MaxResults *int32 + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The sort by order. + SortBy types.CisScanResultsAggregatedByTargetResourceSortBy + + // The sort order. + SortOrder types.CisSortOrder + + noSmithyDocumentSerde +} + +type ListCisScanResultsAggregatedByTargetResourceOutput struct { + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The resource aggregations. + TargetResourceAggregations []types.CisTargetResourceAggregation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCisScanResultsAggregatedByTargetResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCisScanResultsAggregatedByTargetResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCisScanResultsAggregatedByTargetResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCisScanResultsAggregatedByTargetResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListCisScanResultsAggregatedByTargetResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCisScanResultsAggregatedByTargetResource(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListCisScanResultsAggregatedByTargetResourceAPIClient is a client that +// implements the ListCisScanResultsAggregatedByTargetResource operation. +type ListCisScanResultsAggregatedByTargetResourceAPIClient interface { + ListCisScanResultsAggregatedByTargetResource(context.Context, *ListCisScanResultsAggregatedByTargetResourceInput, ...func(*Options)) (*ListCisScanResultsAggregatedByTargetResourceOutput, error) +} + +var _ ListCisScanResultsAggregatedByTargetResourceAPIClient = (*Client)(nil) + +// ListCisScanResultsAggregatedByTargetResourcePaginatorOptions is the paginator +// options for ListCisScanResultsAggregatedByTargetResource +type ListCisScanResultsAggregatedByTargetResourcePaginatorOptions struct { + // The maximum number of scan results aggregated by a target resource to be + // returned in a single page of results. + 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 +} + +// ListCisScanResultsAggregatedByTargetResourcePaginator is a paginator for +// ListCisScanResultsAggregatedByTargetResource +type ListCisScanResultsAggregatedByTargetResourcePaginator struct { + options ListCisScanResultsAggregatedByTargetResourcePaginatorOptions + client ListCisScanResultsAggregatedByTargetResourceAPIClient + params *ListCisScanResultsAggregatedByTargetResourceInput + nextToken *string + firstPage bool +} + +// NewListCisScanResultsAggregatedByTargetResourcePaginator returns a new +// ListCisScanResultsAggregatedByTargetResourcePaginator +func NewListCisScanResultsAggregatedByTargetResourcePaginator(client ListCisScanResultsAggregatedByTargetResourceAPIClient, params *ListCisScanResultsAggregatedByTargetResourceInput, optFns ...func(*ListCisScanResultsAggregatedByTargetResourcePaginatorOptions)) *ListCisScanResultsAggregatedByTargetResourcePaginator { + if params == nil { + params = &ListCisScanResultsAggregatedByTargetResourceInput{} + } + + options := ListCisScanResultsAggregatedByTargetResourcePaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCisScanResultsAggregatedByTargetResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCisScanResultsAggregatedByTargetResourcePaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCisScanResultsAggregatedByTargetResource page. +func (p *ListCisScanResultsAggregatedByTargetResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCisScanResultsAggregatedByTargetResourceOutput, 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.ListCisScanResultsAggregatedByTargetResource(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_opListCisScanResultsAggregatedByTargetResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCisScanResultsAggregatedByTargetResource", + } +} diff --git a/service/inspector2/api_op_ListCisScans.go b/service/inspector2/api_op_ListCisScans.go new file mode 100644 index 00000000000..55ec7cc4264 --- /dev/null +++ b/service/inspector2/api_op_ListCisScans.go @@ -0,0 +1,244 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a CIS scan list. +func (c *Client) ListCisScans(ctx context.Context, params *ListCisScansInput, optFns ...func(*Options)) (*ListCisScansOutput, error) { + if params == nil { + params = &ListCisScansInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCisScans", params, optFns, c.addOperationListCisScansMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCisScansOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCisScansInput struct { + + // The detail applied to the CIS scan. + DetailLevel types.ListCisScansDetailLevel + + // The CIS scan filter criteria. + FilterCriteria *types.ListCisScansFilterCriteria + + // The maximum number of results to be returned. + MaxResults *int32 + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The CIS scans sort by order. + SortBy types.ListCisScansSortBy + + // The CIS scans sort order. + SortOrder types.CisSortOrder + + noSmithyDocumentSerde +} + +type ListCisScansOutput struct { + + // The pagination token from a previous request that's used to retrieve the next + // page of results. + NextToken *string + + // The CIS scans. + Scans []types.CisScan + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCisScansMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCisScans{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCisScans{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCisScans"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListCisScansValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCisScans(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListCisScansAPIClient is a client that implements the ListCisScans operation. +type ListCisScansAPIClient interface { + ListCisScans(context.Context, *ListCisScansInput, ...func(*Options)) (*ListCisScansOutput, error) +} + +var _ ListCisScansAPIClient = (*Client)(nil) + +// ListCisScansPaginatorOptions is the paginator options for ListCisScans +type ListCisScansPaginatorOptions struct { + // The maximum number of results to be returned. + 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 +} + +// ListCisScansPaginator is a paginator for ListCisScans +type ListCisScansPaginator struct { + options ListCisScansPaginatorOptions + client ListCisScansAPIClient + params *ListCisScansInput + nextToken *string + firstPage bool +} + +// NewListCisScansPaginator returns a new ListCisScansPaginator +func NewListCisScansPaginator(client ListCisScansAPIClient, params *ListCisScansInput, optFns ...func(*ListCisScansPaginatorOptions)) *ListCisScansPaginator { + if params == nil { + params = &ListCisScansInput{} + } + + options := ListCisScansPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCisScansPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCisScansPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCisScans page. +func (p *ListCisScansPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCisScansOutput, 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.ListCisScans(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_opListCisScans(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCisScans", + } +} diff --git a/service/inspector2/api_op_SendCisSessionHealth.go b/service/inspector2/api_op_SendCisSessionHealth.go new file mode 100644 index 00000000000..cffd23c9c92 --- /dev/null +++ b/service/inspector2/api_op_SendCisSessionHealth.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sends a CIS session health. This API is used by the Amazon Inspector SSM plugin +// to communicate with the Amazon Inspector service. The Amazon Inspector SSM +// plugin calls this API to start a CIS scan session for the scan ID supplied by +// the service. +func (c *Client) SendCisSessionHealth(ctx context.Context, params *SendCisSessionHealthInput, optFns ...func(*Options)) (*SendCisSessionHealthOutput, error) { + if params == nil { + params = &SendCisSessionHealthInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendCisSessionHealth", params, optFns, c.addOperationSendCisSessionHealthMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendCisSessionHealthOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SendCisSessionHealthInput struct { + + // A unique identifier for the scan job. + // + // This member is required. + ScanJobId *string + + // The unique token that identifies the CIS session. + // + // This member is required. + SessionToken *string + + noSmithyDocumentSerde +} + +type SendCisSessionHealthOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendCisSessionHealthMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSendCisSessionHealth{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSendCisSessionHealth{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendCisSessionHealth"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSendCisSessionHealthValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendCisSessionHealth(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendCisSessionHealth(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendCisSessionHealth", + } +} diff --git a/service/inspector2/api_op_SendCisSessionTelemetry.go b/service/inspector2/api_op_SendCisSessionTelemetry.go new file mode 100644 index 00000000000..33cf4ae2218 --- /dev/null +++ b/service/inspector2/api_op_SendCisSessionTelemetry.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sends a CIS session telemetry. This API is used by the Amazon Inspector SSM +// plugin to communicate with the Amazon Inspector service. The Amazon Inspector +// SSM plugin calls this API to start a CIS scan session for the scan ID supplied +// by the service. +func (c *Client) SendCisSessionTelemetry(ctx context.Context, params *SendCisSessionTelemetryInput, optFns ...func(*Options)) (*SendCisSessionTelemetryOutput, error) { + if params == nil { + params = &SendCisSessionTelemetryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendCisSessionTelemetry", params, optFns, c.addOperationSendCisSessionTelemetryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendCisSessionTelemetryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SendCisSessionTelemetryInput struct { + + // The CIS session telemetry messages. + // + // This member is required. + Messages []types.CisSessionMessage + + // A unique identifier for the scan job. + // + // This member is required. + ScanJobId *string + + // The unique token that identifies the CIS session. + // + // This member is required. + SessionToken *string + + noSmithyDocumentSerde +} + +type SendCisSessionTelemetryOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendCisSessionTelemetryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSendCisSessionTelemetry{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSendCisSessionTelemetry{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendCisSessionTelemetry"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSendCisSessionTelemetryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendCisSessionTelemetry(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendCisSessionTelemetry(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendCisSessionTelemetry", + } +} diff --git a/service/inspector2/api_op_StartCisSession.go b/service/inspector2/api_op_StartCisSession.go new file mode 100644 index 00000000000..5b937fb2508 --- /dev/null +++ b/service/inspector2/api_op_StartCisSession.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a CIS session. This API is used by the Amazon Inspector SSM plugin to +// communicate with the Amazon Inspector service. The Amazon Inspector SSM plugin +// calls this API to start a CIS scan session for the scan ID supplied by the +// service. +func (c *Client) StartCisSession(ctx context.Context, params *StartCisSessionInput, optFns ...func(*Options)) (*StartCisSessionOutput, error) { + if params == nil { + params = &StartCisSessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartCisSession", params, optFns, c.addOperationStartCisSessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartCisSessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartCisSessionInput struct { + + // The start CIS session message. + // + // This member is required. + Message *types.StartCisSessionMessage + + // A unique identifier for the scan job. + // + // This member is required. + ScanJobId *string + + noSmithyDocumentSerde +} + +type StartCisSessionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartCisSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartCisSession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartCisSession{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartCisSession"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpStartCisSessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCisSession(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartCisSession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartCisSession", + } +} diff --git a/service/inspector2/api_op_StopCisSession.go b/service/inspector2/api_op_StopCisSession.go new file mode 100644 index 00000000000..2aa2b452186 --- /dev/null +++ b/service/inspector2/api_op_StopCisSession.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stops a CIS session. This API is used by the Amazon Inspector SSM plugin to +// communicate with the Amazon Inspector service. The Amazon Inspector SSM plugin +// calls this API to start a CIS scan session for the scan ID supplied by the +// service. +func (c *Client) StopCisSession(ctx context.Context, params *StopCisSessionInput, optFns ...func(*Options)) (*StopCisSessionOutput, error) { + if params == nil { + params = &StopCisSessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopCisSession", params, optFns, c.addOperationStopCisSessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopCisSessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopCisSessionInput struct { + + // The stop CIS session message. + // + // This member is required. + Message *types.StopCisSessionMessage + + // A unique identifier for the scan job. + // + // This member is required. + ScanJobId *string + + // The unique token that identifies the CIS session. + // + // This member is required. + SessionToken *string + + noSmithyDocumentSerde +} + +type StopCisSessionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopCisSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStopCisSession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopCisSession{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopCisSession"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpStopCisSessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopCisSession(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopCisSession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopCisSession", + } +} diff --git a/service/inspector2/api_op_UpdateCisScanConfiguration.go b/service/inspector2/api_op_UpdateCisScanConfiguration.go new file mode 100644 index 00000000000..dd5718b34be --- /dev/null +++ b/service/inspector2/api_op_UpdateCisScanConfiguration.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +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/inspector2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a CIS scan configuration. +func (c *Client) UpdateCisScanConfiguration(ctx context.Context, params *UpdateCisScanConfigurationInput, optFns ...func(*Options)) (*UpdateCisScanConfigurationOutput, error) { + if params == nil { + params = &UpdateCisScanConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCisScanConfiguration", params, optFns, c.addOperationUpdateCisScanConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCisScanConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateCisScanConfigurationInput struct { + + // The CIS scan configuration ARN. + // + // This member is required. + ScanConfigurationArn *string + + // The scan name for the CIS scan configuration. + ScanName *string + + // The schedule for the CIS scan configuration. + Schedule types.Schedule + + // The security level for the CIS scan configuration. Security level refers to the + // Benchmark levels that CIS assigns to a profile. + SecurityLevel types.CisSecurityLevel + + // The targets for the CIS scan configuration. + Targets *types.UpdateCisTargets + + noSmithyDocumentSerde +} + +type UpdateCisScanConfigurationOutput struct { + + // The CIS scan configuration ARN. + // + // This member is required. + ScanConfigurationArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCisScanConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCisScanConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCisScanConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCisScanConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateCisScanConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCisScanConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCisScanConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCisScanConfiguration", + } +} diff --git a/service/inspector2/deserializers.go b/service/inspector2/deserializers.go index 933414cf43e..8a9fb796912 100644 --- a/service/inspector2/deserializers.go +++ b/service/inspector2/deserializers.go @@ -1476,14 +1476,14 @@ func awsRestjson1_deserializeOpDocumentCancelSbomExportOutput(v **CancelSbomExpo return nil } -type awsRestjson1_deserializeOpCreateFilter struct { +type awsRestjson1_deserializeOpCreateCisScanConfiguration struct { } -func (*awsRestjson1_deserializeOpCreateFilter) ID() string { +func (*awsRestjson1_deserializeOpCreateCisScanConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateCisScanConfiguration) 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) @@ -1497,9 +1497,9 @@ func (m *awsRestjson1_deserializeOpCreateFilter) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateFilter(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateCisScanConfiguration(response, &metadata) } - output := &CreateFilterOutput{} + output := &CreateCisScanConfigurationOutput{} out.Result = output var buff [1024]byte @@ -1520,7 +1520,7 @@ func (m *awsRestjson1_deserializeOpCreateFilter) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateFilterOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateCisScanConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1533,7 +1533,7 @@ func (m *awsRestjson1_deserializeOpCreateFilter) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateCisScanConfiguration(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)} @@ -1577,15 +1577,9 @@ func awsRestjson1_deserializeOpErrorCreateFilter(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(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) @@ -1602,7 +1596,7 @@ func awsRestjson1_deserializeOpErrorCreateFilter(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateFilterOutput(v **CreateFilterOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateCisScanConfigurationOutput(v **CreateCisScanConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1615,22 +1609,22 @@ func awsRestjson1_deserializeOpDocumentCreateFilterOutput(v **CreateFilterOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateFilterOutput + var sv *CreateCisScanConfigurationOutput if *v == nil { - sv = &CreateFilterOutput{} + sv = &CreateCisScanConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": + case "scanConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FilterArn to be of type string, got %T instead", value) + return fmt.Errorf("expected CisScanConfigurationArn to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.ScanConfigurationArn = ptr.String(jtv) } default: @@ -1642,14 +1636,14 @@ func awsRestjson1_deserializeOpDocumentCreateFilterOutput(v **CreateFilterOutput return nil } -type awsRestjson1_deserializeOpCreateFindingsReport struct { +type awsRestjson1_deserializeOpCreateFilter struct { } -func (*awsRestjson1_deserializeOpCreateFindingsReport) ID() string { +func (*awsRestjson1_deserializeOpCreateFilter) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateFindingsReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateFilter) 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) @@ -1663,9 +1657,9 @@ func (m *awsRestjson1_deserializeOpCreateFindingsReport) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateFindingsReport(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateFilter(response, &metadata) } - output := &CreateFindingsReportOutput{} + output := &CreateFilterOutput{} out.Result = output var buff [1024]byte @@ -1686,7 +1680,7 @@ func (m *awsRestjson1_deserializeOpCreateFindingsReport) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateFindingsReportOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateFilterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1699,7 +1693,7 @@ func (m *awsRestjson1_deserializeOpCreateFindingsReport) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateFindingsReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateFilter(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)} @@ -1743,11 +1737,14 @@ func awsRestjson1_deserializeOpErrorCreateFindingsReport(response *smithyhttp.Re case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(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) @@ -1765,7 +1762,7 @@ func awsRestjson1_deserializeOpErrorCreateFindingsReport(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentCreateFindingsReportOutput(v **CreateFindingsReportOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateFilterOutput(v **CreateFilterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1778,22 +1775,22 @@ func awsRestjson1_deserializeOpDocumentCreateFindingsReportOutput(v **CreateFind return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateFindingsReportOutput + var sv *CreateFilterOutput if *v == nil { - sv = &CreateFindingsReportOutput{} + sv = &CreateFilterOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "reportId": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) + return fmt.Errorf("expected FilterArn to be of type string, got %T instead", value) } - sv.ReportId = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } default: @@ -1805,14 +1802,14 @@ func awsRestjson1_deserializeOpDocumentCreateFindingsReportOutput(v **CreateFind return nil } -type awsRestjson1_deserializeOpCreateSbomExport struct { +type awsRestjson1_deserializeOpCreateFindingsReport struct { } -func (*awsRestjson1_deserializeOpCreateSbomExport) ID() string { +func (*awsRestjson1_deserializeOpCreateFindingsReport) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateSbomExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateFindingsReport) 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) @@ -1826,9 +1823,9 @@ func (m *awsRestjson1_deserializeOpCreateSbomExport) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateSbomExport(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateFindingsReport(response, &metadata) } - output := &CreateSbomExportOutput{} + output := &CreateFindingsReportOutput{} out.Result = output var buff [1024]byte @@ -1849,7 +1846,7 @@ func (m *awsRestjson1_deserializeOpCreateSbomExport) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateSbomExportOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateFindingsReportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1862,7 +1859,7 @@ func (m *awsRestjson1_deserializeOpCreateSbomExport) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateSbomExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateFindingsReport(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)} @@ -1928,7 +1925,7 @@ func awsRestjson1_deserializeOpErrorCreateSbomExport(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentCreateSbomExportOutput(v **CreateSbomExportOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateFindingsReportOutput(v **CreateFindingsReportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1941,9 +1938,9 @@ func awsRestjson1_deserializeOpDocumentCreateSbomExportOutput(v **CreateSbomExpo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateSbomExportOutput + var sv *CreateFindingsReportOutput if *v == nil { - sv = &CreateSbomExportOutput{} + sv = &CreateFindingsReportOutput{} } else { sv = *v } @@ -1968,14 +1965,14 @@ func awsRestjson1_deserializeOpDocumentCreateSbomExportOutput(v **CreateSbomExpo return nil } -type awsRestjson1_deserializeOpDeleteFilter struct { +type awsRestjson1_deserializeOpCreateSbomExport struct { } -func (*awsRestjson1_deserializeOpDeleteFilter) ID() string { +func (*awsRestjson1_deserializeOpCreateSbomExport) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateSbomExport) 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) @@ -1989,9 +1986,9 @@ func (m *awsRestjson1_deserializeOpDeleteFilter) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteFilter(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateSbomExport(response, &metadata) } - output := &DeleteFilterOutput{} + output := &CreateSbomExportOutput{} out.Result = output var buff [1024]byte @@ -2012,7 +2009,7 @@ func (m *awsRestjson1_deserializeOpDeleteFilter) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteFilterOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateSbomExportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2025,7 +2022,7 @@ func (m *awsRestjson1_deserializeOpDeleteFilter) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateSbomExport(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)} @@ -2091,7 +2088,7 @@ func awsRestjson1_deserializeOpErrorDeleteFilter(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDeleteFilterOutput(v **DeleteFilterOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateSbomExportOutput(v **CreateSbomExportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2104,22 +2101,22 @@ func awsRestjson1_deserializeOpDocumentDeleteFilterOutput(v **DeleteFilterOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteFilterOutput + var sv *CreateSbomExportOutput if *v == nil { - sv = &DeleteFilterOutput{} + sv = &CreateSbomExportOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": + case "reportId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FilterArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.ReportId = ptr.String(jtv) } default: @@ -2131,14 +2128,14 @@ func awsRestjson1_deserializeOpDocumentDeleteFilterOutput(v **DeleteFilterOutput return nil } -type awsRestjson1_deserializeOpDescribeOrganizationConfiguration struct { +type awsRestjson1_deserializeOpDeleteCisScanConfiguration struct { } -func (*awsRestjson1_deserializeOpDescribeOrganizationConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDeleteCisScanConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteCisScanConfiguration) 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) @@ -2152,9 +2149,9 @@ func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCisScanConfiguration(response, &metadata) } - output := &DescribeOrganizationConfigurationOutput{} + output := &DeleteCisScanConfigurationOutput{} out.Result = output var buff [1024]byte @@ -2175,7 +2172,7 @@ func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteCisScanConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2188,7 +2185,7 @@ func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteCisScanConfiguration(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)} @@ -2235,6 +2232,9 @@ func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response * 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) @@ -2251,7 +2251,7 @@ func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response * } } -func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v **DescribeOrganizationConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteCisScanConfigurationOutput(v **DeleteCisScanConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2264,27 +2264,22 @@ func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeOrganizationConfigurationOutput + var sv *DeleteCisScanConfigurationOutput if *v == nil { - sv = &DescribeOrganizationConfigurationOutput{} + sv = &DeleteCisScanConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "autoEnable": - if err := awsRestjson1_deserializeDocumentAutoEnable(&sv.AutoEnable, value); err != nil { - return err - } - - case "maxAccountLimitReached": + case "scanConfigurationArn": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected CisScanConfigurationArn to be of type string, got %T instead", value) } - sv.MaxAccountLimitReached = ptr.Bool(jtv) + sv.ScanConfigurationArn = ptr.String(jtv) } default: @@ -2296,14 +2291,14 @@ func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v return nil } -type awsRestjson1_deserializeOpDisable struct { +type awsRestjson1_deserializeOpDeleteFilter struct { } -func (*awsRestjson1_deserializeOpDisable) ID() string { +func (*awsRestjson1_deserializeOpDeleteFilter) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteFilter) 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) @@ -2317,9 +2312,9 @@ func (m *awsRestjson1_deserializeOpDisable) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisable(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteFilter(response, &metadata) } - output := &DisableOutput{} + output := &DeleteFilterOutput{} out.Result = output var buff [1024]byte @@ -2340,7 +2335,7 @@ func (m *awsRestjson1_deserializeOpDisable) HandleDeserialize(ctx context.Contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDisableOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteFilterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2353,7 +2348,7 @@ func (m *awsRestjson1_deserializeOpDisable) HandleDeserialize(ctx context.Contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteFilter(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)} @@ -2419,7 +2414,7 @@ func awsRestjson1_deserializeOpErrorDisable(response *smithyhttp.Response, metad } } -func awsRestjson1_deserializeOpDocumentDisableOutput(v **DisableOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteFilterOutput(v **DeleteFilterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2432,23 +2427,22 @@ func awsRestjson1_deserializeOpDocumentDisableOutput(v **DisableOutput, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DisableOutput + var sv *DeleteFilterOutput if *v == nil { - sv = &DisableOutput{} + sv = &DeleteFilterOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "accounts": - if err := awsRestjson1_deserializeDocumentAccountList(&sv.Accounts, value); err != nil { - return err - } - - case "failedAccounts": - if err := awsRestjson1_deserializeDocumentFailedAccountList(&sv.FailedAccounts, value); err != nil { - return err + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FilterArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) } default: @@ -2460,14 +2454,14 @@ func awsRestjson1_deserializeOpDocumentDisableOutput(v **DisableOutput, value in return nil } -type awsRestjson1_deserializeOpDisableDelegatedAdminAccount struct { +type awsRestjson1_deserializeOpDescribeOrganizationConfiguration struct { } -func (*awsRestjson1_deserializeOpDisableDelegatedAdminAccount) ID() string { +func (*awsRestjson1_deserializeOpDescribeOrganizationConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisableDelegatedAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) 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) @@ -2481,9 +2475,9 @@ func (m *awsRestjson1_deserializeOpDisableDelegatedAdminAccount) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisableDelegatedAdminAccount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response, &metadata) } - output := &DisableDelegatedAdminAccountOutput{} + output := &DescribeOrganizationConfigurationOutput{} out.Result = output var buff [1024]byte @@ -2504,7 +2498,7 @@ func (m *awsRestjson1_deserializeOpDisableDelegatedAdminAccount) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDisableDelegatedAdminAccountOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2517,7 +2511,7 @@ func (m *awsRestjson1_deserializeOpDisableDelegatedAdminAccount) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisableDelegatedAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(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)} @@ -2561,15 +2555,9 @@ func awsRestjson1_deserializeOpErrorDisableDelegatedAdminAccount(response *smith 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) @@ -2586,7 +2574,7 @@ func awsRestjson1_deserializeOpErrorDisableDelegatedAdminAccount(response *smith } } -func awsRestjson1_deserializeOpDocumentDisableDelegatedAdminAccountOutput(v **DisableDelegatedAdminAccountOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v **DescribeOrganizationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2599,22 +2587,27 @@ func awsRestjson1_deserializeOpDocumentDisableDelegatedAdminAccountOutput(v **Di return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DisableDelegatedAdminAccountOutput + var sv *DescribeOrganizationConfigurationOutput if *v == nil { - sv = &DisableDelegatedAdminAccountOutput{} + sv = &DescribeOrganizationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "delegatedAdminAccountId": + case "autoEnable": + if err := awsRestjson1_deserializeDocumentAutoEnable(&sv.AutoEnable, value); err != nil { + return err + } + + case "maxAccountLimitReached": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.DelegatedAdminAccountId = ptr.String(jtv) + sv.MaxAccountLimitReached = ptr.Bool(jtv) } default: @@ -2626,14 +2619,14 @@ func awsRestjson1_deserializeOpDocumentDisableDelegatedAdminAccountOutput(v **Di return nil } -type awsRestjson1_deserializeOpDisassociateMember struct { +type awsRestjson1_deserializeOpDisable struct { } -func (*awsRestjson1_deserializeOpDisassociateMember) ID() string { +func (*awsRestjson1_deserializeOpDisable) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateMember) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisable) 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) @@ -2647,9 +2640,9 @@ func (m *awsRestjson1_deserializeOpDisassociateMember) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateMember(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisable(response, &metadata) } - output := &DisassociateMemberOutput{} + output := &DisableOutput{} out.Result = output var buff [1024]byte @@ -2670,7 +2663,7 @@ func (m *awsRestjson1_deserializeOpDisassociateMember) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDisassociateMemberOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDisableOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2683,7 +2676,7 @@ func (m *awsRestjson1_deserializeOpDisassociateMember) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateMember(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisable(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)} @@ -2730,6 +2723,9 @@ func awsRestjson1_deserializeOpErrorDisassociateMember(response *smithyhttp.Resp 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) @@ -2746,7 +2742,7 @@ func awsRestjson1_deserializeOpErrorDisassociateMember(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentDisassociateMemberOutput(v **DisassociateMemberOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDisableOutput(v **DisableOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2759,22 +2755,23 @@ func awsRestjson1_deserializeOpDocumentDisassociateMemberOutput(v **Disassociate return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DisassociateMemberOutput + var sv *DisableOutput if *v == nil { - sv = &DisassociateMemberOutput{} + sv = &DisableOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) + case "accounts": + if err := awsRestjson1_deserializeDocumentAccountList(&sv.Accounts, value); err != nil { + return err + } + + case "failedAccounts": + if err := awsRestjson1_deserializeDocumentFailedAccountList(&sv.FailedAccounts, value); err != nil { + return err } default: @@ -2786,14 +2783,14 @@ func awsRestjson1_deserializeOpDocumentDisassociateMemberOutput(v **Disassociate return nil } -type awsRestjson1_deserializeOpEnable struct { +type awsRestjson1_deserializeOpDisableDelegatedAdminAccount struct { } -func (*awsRestjson1_deserializeOpEnable) ID() string { +func (*awsRestjson1_deserializeOpDisableDelegatedAdminAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpEnable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisableDelegatedAdminAccount) 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) @@ -2807,9 +2804,9 @@ func (m *awsRestjson1_deserializeOpEnable) HandleDeserialize(ctx context.Context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorEnable(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisableDelegatedAdminAccount(response, &metadata) } - output := &EnableOutput{} + output := &DisableDelegatedAdminAccountOutput{} out.Result = output var buff [1024]byte @@ -2830,7 +2827,7 @@ func (m *awsRestjson1_deserializeOpEnable) HandleDeserialize(ctx context.Context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentEnableOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDisableDelegatedAdminAccountOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2843,7 +2840,7 @@ func (m *awsRestjson1_deserializeOpEnable) HandleDeserialize(ctx context.Context return out, metadata, err } -func awsRestjson1_deserializeOpErrorEnable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisableDelegatedAdminAccount(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)} @@ -2887,6 +2884,9 @@ func awsRestjson1_deserializeOpErrorEnable(response *smithyhttp.Response, metada 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) @@ -2909,7 +2909,7 @@ func awsRestjson1_deserializeOpErrorEnable(response *smithyhttp.Response, metada } } -func awsRestjson1_deserializeOpDocumentEnableOutput(v **EnableOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDisableDelegatedAdminAccountOutput(v **DisableDelegatedAdminAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2922,23 +2922,22 @@ func awsRestjson1_deserializeOpDocumentEnableOutput(v **EnableOutput, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *EnableOutput + var sv *DisableDelegatedAdminAccountOutput if *v == nil { - sv = &EnableOutput{} + sv = &DisableDelegatedAdminAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "accounts": - if err := awsRestjson1_deserializeDocumentAccountList(&sv.Accounts, value); err != nil { - return err - } - - case "failedAccounts": - if err := awsRestjson1_deserializeDocumentFailedAccountList(&sv.FailedAccounts, value); err != nil { - return err + case "delegatedAdminAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.DelegatedAdminAccountId = ptr.String(jtv) } default: @@ -2950,14 +2949,14 @@ func awsRestjson1_deserializeOpDocumentEnableOutput(v **EnableOutput, value inte return nil } -type awsRestjson1_deserializeOpEnableDelegatedAdminAccount struct { +type awsRestjson1_deserializeOpDisassociateMember struct { } -func (*awsRestjson1_deserializeOpEnableDelegatedAdminAccount) ID() string { +func (*awsRestjson1_deserializeOpDisassociateMember) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpEnableDelegatedAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateMember) 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) @@ -2971,9 +2970,9 @@ func (m *awsRestjson1_deserializeOpEnableDelegatedAdminAccount) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorEnableDelegatedAdminAccount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateMember(response, &metadata) } - output := &EnableDelegatedAdminAccountOutput{} + output := &DisassociateMemberOutput{} out.Result = output var buff [1024]byte @@ -2994,7 +2993,7 @@ func (m *awsRestjson1_deserializeOpEnableDelegatedAdminAccount) HandleDeserializ return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentEnableDelegatedAdminAccountOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDisassociateMemberOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3007,7 +3006,7 @@ func (m *awsRestjson1_deserializeOpEnableDelegatedAdminAccount) HandleDeserializ return out, metadata, err } -func awsRestjson1_deserializeOpErrorEnableDelegatedAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateMember(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)} @@ -3051,15 +3050,9 @@ func awsRestjson1_deserializeOpErrorEnableDelegatedAdminAccount(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) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -3076,7 +3069,7 @@ func awsRestjson1_deserializeOpErrorEnableDelegatedAdminAccount(response *smithy } } -func awsRestjson1_deserializeOpDocumentEnableDelegatedAdminAccountOutput(v **EnableDelegatedAdminAccountOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDisassociateMemberOutput(v **DisassociateMemberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3089,22 +3082,22 @@ func awsRestjson1_deserializeOpDocumentEnableDelegatedAdminAccountOutput(v **Ena return fmt.Errorf("unexpected JSON type %v", value) } - var sv *EnableDelegatedAdminAccountOutput + var sv *DisassociateMemberOutput if *v == nil { - sv = &EnableDelegatedAdminAccountOutput{} + sv = &DisassociateMemberOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "delegatedAdminAccountId": + case "accountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } - sv.DelegatedAdminAccountId = ptr.String(jtv) + sv.AccountId = ptr.String(jtv) } default: @@ -3116,14 +3109,14 @@ func awsRestjson1_deserializeOpDocumentEnableDelegatedAdminAccountOutput(v **Ena return nil } -type awsRestjson1_deserializeOpGetConfiguration struct { +type awsRestjson1_deserializeOpEnable struct { } -func (*awsRestjson1_deserializeOpGetConfiguration) ID() string { +func (*awsRestjson1_deserializeOpEnable) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpEnable) 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) @@ -3137,9 +3130,9 @@ func (m *awsRestjson1_deserializeOpGetConfiguration) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorEnable(response, &metadata) } - output := &GetConfigurationOutput{} + output := &EnableOutput{} out.Result = output var buff [1024]byte @@ -3160,7 +3153,7 @@ func (m *awsRestjson1_deserializeOpGetConfiguration) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentEnableOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3173,7 +3166,7 @@ func (m *awsRestjson1_deserializeOpGetConfiguration) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorEnable(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)} @@ -3214,6 +3207,9 @@ func awsRestjson1_deserializeOpErrorGetConfiguration(response *smithyhttp.Respon } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3223,6 +3219,9 @@ func awsRestjson1_deserializeOpErrorGetConfiguration(response *smithyhttp.Respon 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, @@ -3233,7 +3232,7 @@ func awsRestjson1_deserializeOpErrorGetConfiguration(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetConfigurationOutput(v **GetConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentEnableOutput(v **EnableOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3246,17 +3245,22 @@ func awsRestjson1_deserializeOpDocumentGetConfigurationOutput(v **GetConfigurati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetConfigurationOutput + var sv *EnableOutput if *v == nil { - sv = &GetConfigurationOutput{} + sv = &EnableOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ecrConfiguration": - if err := awsRestjson1_deserializeDocumentEcrConfigurationState(&sv.EcrConfiguration, value); err != nil { + case "accounts": + if err := awsRestjson1_deserializeDocumentAccountList(&sv.Accounts, value); err != nil { + return err + } + + case "failedAccounts": + if err := awsRestjson1_deserializeDocumentFailedAccountList(&sv.FailedAccounts, value); err != nil { return err } @@ -3269,14 +3273,14 @@ func awsRestjson1_deserializeOpDocumentGetConfigurationOutput(v **GetConfigurati return nil } -type awsRestjson1_deserializeOpGetDelegatedAdminAccount struct { +type awsRestjson1_deserializeOpEnableDelegatedAdminAccount struct { } -func (*awsRestjson1_deserializeOpGetDelegatedAdminAccount) ID() string { +func (*awsRestjson1_deserializeOpEnableDelegatedAdminAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDelegatedAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpEnableDelegatedAdminAccount) 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) @@ -3290,9 +3294,9 @@ func (m *awsRestjson1_deserializeOpGetDelegatedAdminAccount) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDelegatedAdminAccount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorEnableDelegatedAdminAccount(response, &metadata) } - output := &GetDelegatedAdminAccountOutput{} + output := &EnableDelegatedAdminAccountOutput{} out.Result = output var buff [1024]byte @@ -3313,7 +3317,7 @@ func (m *awsRestjson1_deserializeOpGetDelegatedAdminAccount) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDelegatedAdminAccountOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentEnableDelegatedAdminAccountOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3326,7 +3330,7 @@ func (m *awsRestjson1_deserializeOpGetDelegatedAdminAccount) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDelegatedAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorEnableDelegatedAdminAccount(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)} @@ -3370,6 +3374,9 @@ func awsRestjson1_deserializeOpErrorGetDelegatedAdminAccount(response *smithyhtt 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) @@ -3392,7 +3399,7 @@ func awsRestjson1_deserializeOpErrorGetDelegatedAdminAccount(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentGetDelegatedAdminAccountOutput(v **GetDelegatedAdminAccountOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentEnableDelegatedAdminAccountOutput(v **EnableDelegatedAdminAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3405,18 +3412,22 @@ func awsRestjson1_deserializeOpDocumentGetDelegatedAdminAccountOutput(v **GetDel return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDelegatedAdminAccountOutput + var sv *EnableDelegatedAdminAccountOutput if *v == nil { - sv = &GetDelegatedAdminAccountOutput{} + sv = &EnableDelegatedAdminAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "delegatedAdmin": - if err := awsRestjson1_deserializeDocumentDelegatedAdmin(&sv.DelegatedAdmin, value); err != nil { - return err + case "delegatedAdminAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.DelegatedAdminAccountId = ptr.String(jtv) } default: @@ -3428,14 +3439,14 @@ func awsRestjson1_deserializeOpDocumentGetDelegatedAdminAccountOutput(v **GetDel return nil } -type awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration struct { +type awsRestjson1_deserializeOpGetCisScanReport struct { } -func (*awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) ID() string { +func (*awsRestjson1_deserializeOpGetCisScanReport) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetCisScanReport) 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) @@ -3449,9 +3460,9 @@ func (m *awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetEc2DeepInspectionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetCisScanReport(response, &metadata) } - output := &GetEc2DeepInspectionConfigurationOutput{} + output := &GetCisScanReportOutput{} out.Result = output var buff [1024]byte @@ -3472,7 +3483,7 @@ func (m *awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetEc2DeepInspectionConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetCisScanReportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3485,7 +3496,7 @@ func (m *awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetEc2DeepInspectionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetCisScanReport(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)} @@ -3532,12 +3543,12 @@ func awsRestjson1_deserializeOpErrorGetEc2DeepInspectionConfiguration(response * 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, @@ -3548,7 +3559,7 @@ func awsRestjson1_deserializeOpErrorGetEc2DeepInspectionConfiguration(response * } } -func awsRestjson1_deserializeOpDocumentGetEc2DeepInspectionConfigurationOutput(v **GetEc2DeepInspectionConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetCisScanReportOutput(v **GetCisScanReportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3561,41 +3572,31 @@ func awsRestjson1_deserializeOpDocumentGetEc2DeepInspectionConfigurationOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetEc2DeepInspectionConfigurationOutput + var sv *GetCisScanReportOutput if *v == nil { - sv = &GetEc2DeepInspectionConfigurationOutput{} + sv = &GetCisScanReportOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "errorMessage": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected CisReportStatus to be of type string, got %T instead", value) } - sv.ErrorMessage = ptr.String(jtv) - } - - case "orgPackagePaths": - if err := awsRestjson1_deserializeDocumentPathList(&sv.OrgPackagePaths, value); err != nil { - return err - } - - case "packagePaths": - if err := awsRestjson1_deserializeDocumentPathList(&sv.PackagePaths, value); err != nil { - return err + sv.Status = types.CisReportStatus(jtv) } - case "status": + case "url": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Ec2DeepInspectionStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Status = types.Ec2DeepInspectionStatus(jtv) + sv.Url = ptr.String(jtv) } default: @@ -3607,14 +3608,14 @@ func awsRestjson1_deserializeOpDocumentGetEc2DeepInspectionConfigurationOutput(v return nil } -type awsRestjson1_deserializeOpGetEncryptionKey struct { +type awsRestjson1_deserializeOpGetCisScanResultDetails struct { } -func (*awsRestjson1_deserializeOpGetEncryptionKey) ID() string { +func (*awsRestjson1_deserializeOpGetCisScanResultDetails) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetEncryptionKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetCisScanResultDetails) 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) @@ -3628,9 +3629,9 @@ func (m *awsRestjson1_deserializeOpGetEncryptionKey) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetEncryptionKey(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetCisScanResultDetails(response, &metadata) } - output := &GetEncryptionKeyOutput{} + output := &GetCisScanResultDetailsOutput{} out.Result = output var buff [1024]byte @@ -3651,7 +3652,7 @@ func (m *awsRestjson1_deserializeOpGetEncryptionKey) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetEncryptionKeyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetCisScanResultDetailsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3664,7 +3665,7 @@ func (m *awsRestjson1_deserializeOpGetEncryptionKey) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetEncryptionKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetCisScanResultDetails(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)} @@ -3711,9 +3712,6 @@ func awsRestjson1_deserializeOpErrorGetEncryptionKey(response *smithyhttp.Respon 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) @@ -3730,7 +3728,7 @@ func awsRestjson1_deserializeOpErrorGetEncryptionKey(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetEncryptionKeyOutput(v **GetEncryptionKeyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetCisScanResultDetailsOutput(v **GetCisScanResultDetailsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3743,22 +3741,27 @@ func awsRestjson1_deserializeOpDocumentGetEncryptionKeyOutput(v **GetEncryptionK return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetEncryptionKeyOutput + var sv *GetCisScanResultDetailsOutput if *v == nil { - sv = &GetEncryptionKeyOutput{} + sv = &GetCisScanResultDetailsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "kmsKeyId": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.KmsKeyId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) + } + + case "scanResultDetails": + if err := awsRestjson1_deserializeDocumentCisScanResultDetailsList(&sv.ScanResultDetails, value); err != nil { + return err } default: @@ -3770,14 +3773,14 @@ func awsRestjson1_deserializeOpDocumentGetEncryptionKeyOutput(v **GetEncryptionK return nil } -type awsRestjson1_deserializeOpGetFindingsReportStatus struct { +type awsRestjson1_deserializeOpGetConfiguration struct { } -func (*awsRestjson1_deserializeOpGetFindingsReportStatus) ID() string { +func (*awsRestjson1_deserializeOpGetConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetFindingsReportStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetConfiguration) 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) @@ -3791,9 +3794,9 @@ func (m *awsRestjson1_deserializeOpGetFindingsReportStatus) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetFindingsReportStatus(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetConfiguration(response, &metadata) } - output := &GetFindingsReportStatusOutput{} + output := &GetConfigurationOutput{} out.Result = output var buff [1024]byte @@ -3814,7 +3817,7 @@ func (m *awsRestjson1_deserializeOpGetFindingsReportStatus) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetFindingsReportStatusOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3827,7 +3830,7 @@ func (m *awsRestjson1_deserializeOpGetFindingsReportStatus) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetFindingsReportStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetConfiguration(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)} @@ -3868,9 +3871,6 @@ func awsRestjson1_deserializeOpErrorGetFindingsReportStatus(response *smithyhttp } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3880,9 +3880,6 @@ func awsRestjson1_deserializeOpErrorGetFindingsReportStatus(response *smithyhttp 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, @@ -3893,7 +3890,7 @@ func awsRestjson1_deserializeOpErrorGetFindingsReportStatus(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentGetFindingsReportStatusOutput(v **GetFindingsReportStatusOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetConfigurationOutput(v **GetConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3906,61 +3903,20 @@ func awsRestjson1_deserializeOpDocumentGetFindingsReportStatusOutput(v **GetFind return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetFindingsReportStatusOutput + var sv *GetConfigurationOutput if *v == nil { - sv = &GetFindingsReportStatusOutput{} + sv = &GetConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "destination": - if err := awsRestjson1_deserializeDocumentDestination(&sv.Destination, value); err != nil { - return err - } - - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReportingErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = types.ReportingErrorCode(jtv) - } - - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - case "filterCriteria": - if err := awsRestjson1_deserializeDocumentFilterCriteria(&sv.FilterCriteria, value); err != nil { + case "ecrConfiguration": + if err := awsRestjson1_deserializeDocumentEcrConfigurationState(&sv.EcrConfiguration, value); err != nil { return err } - case "reportId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) - } - sv.ReportId = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExternalReportStatus to be of type string, got %T instead", value) - } - sv.Status = types.ExternalReportStatus(jtv) - } - default: _, _ = key, value @@ -3970,14 +3926,14 @@ func awsRestjson1_deserializeOpDocumentGetFindingsReportStatusOutput(v **GetFind return nil } -type awsRestjson1_deserializeOpGetMember struct { +type awsRestjson1_deserializeOpGetDelegatedAdminAccount struct { } -func (*awsRestjson1_deserializeOpGetMember) ID() string { +func (*awsRestjson1_deserializeOpGetDelegatedAdminAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetMember) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetDelegatedAdminAccount) 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) @@ -3991,9 +3947,9 @@ func (m *awsRestjson1_deserializeOpGetMember) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetMember(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetDelegatedAdminAccount(response, &metadata) } - output := &GetMemberOutput{} + output := &GetDelegatedAdminAccountOutput{} out.Result = output var buff [1024]byte @@ -4014,7 +3970,7 @@ func (m *awsRestjson1_deserializeOpGetMember) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetMemberOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetDelegatedAdminAccountOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4027,7 +3983,7 @@ func (m *awsRestjson1_deserializeOpGetMember) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetMember(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetDelegatedAdminAccount(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)} @@ -4093,7 +4049,7 @@ func awsRestjson1_deserializeOpErrorGetMember(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentGetMemberOutput(v **GetMemberOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetDelegatedAdminAccountOutput(v **GetDelegatedAdminAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4106,17 +4062,17 @@ func awsRestjson1_deserializeOpDocumentGetMemberOutput(v **GetMemberOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetMemberOutput + var sv *GetDelegatedAdminAccountOutput if *v == nil { - sv = &GetMemberOutput{} + sv = &GetDelegatedAdminAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "member": - if err := awsRestjson1_deserializeDocumentMember(&sv.Member, value); err != nil { + case "delegatedAdmin": + if err := awsRestjson1_deserializeDocumentDelegatedAdmin(&sv.DelegatedAdmin, value); err != nil { return err } @@ -4129,14 +4085,14 @@ func awsRestjson1_deserializeOpDocumentGetMemberOutput(v **GetMemberOutput, valu return nil } -type awsRestjson1_deserializeOpGetSbomExport struct { +type awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration struct { } -func (*awsRestjson1_deserializeOpGetSbomExport) ID() string { +func (*awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetSbomExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) 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) @@ -4150,9 +4106,9 @@ func (m *awsRestjson1_deserializeOpGetSbomExport) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetSbomExport(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetEc2DeepInspectionConfiguration(response, &metadata) } - output := &GetSbomExportOutput{} + output := &GetEc2DeepInspectionConfigurationOutput{} out.Result = output var buff [1024]byte @@ -4173,7 +4129,7 @@ func (m *awsRestjson1_deserializeOpGetSbomExport) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetSbomExportOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetEc2DeepInspectionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4186,7 +4142,7 @@ func (m *awsRestjson1_deserializeOpGetSbomExport) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetSbomExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetEc2DeepInspectionConfiguration(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)} @@ -4239,9 +4195,6 @@ func awsRestjson1_deserializeOpErrorGetSbomExport(response *smithyhttp.Response, 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, @@ -4252,7 +4205,7 @@ func awsRestjson1_deserializeOpErrorGetSbomExport(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetSbomExportOutput(v **GetSbomExportOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetEc2DeepInspectionConfigurationOutput(v **GetEc2DeepInspectionConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4265,24 +4218,15 @@ func awsRestjson1_deserializeOpDocumentGetSbomExportOutput(v **GetSbomExportOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetSbomExportOutput + var sv *GetEc2DeepInspectionConfigurationOutput if *v == nil { - sv = &GetSbomExportOutput{} + sv = &GetEc2DeepInspectionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReportingErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = types.ReportingErrorCode(jtv) - } - case "errorMessage": if value != nil { jtv, ok := value.(string) @@ -4292,31 +4236,13 @@ func awsRestjson1_deserializeOpDocumentGetSbomExportOutput(v **GetSbomExportOutp sv.ErrorMessage = ptr.String(jtv) } - case "filterCriteria": - if err := awsRestjson1_deserializeDocumentResourceFilterCriteria(&sv.FilterCriteria, value); err != nil { + case "orgPackagePaths": + if err := awsRestjson1_deserializeDocumentPathList(&sv.OrgPackagePaths, value); err != nil { return err } - case "format": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SbomReportFormat to be of type string, got %T instead", value) - } - sv.Format = types.SbomReportFormat(jtv) - } - - case "reportId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) - } - sv.ReportId = ptr.String(jtv) - } - - case "s3Destination": - if err := awsRestjson1_deserializeDocumentDestination(&sv.S3Destination, value); err != nil { + case "packagePaths": + if err := awsRestjson1_deserializeDocumentPathList(&sv.PackagePaths, value); err != nil { return err } @@ -4324,9 +4250,9 @@ func awsRestjson1_deserializeOpDocumentGetSbomExportOutput(v **GetSbomExportOutp if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExternalReportStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected Ec2DeepInspectionStatus to be of type string, got %T instead", value) } - sv.Status = types.ExternalReportStatus(jtv) + sv.Status = types.Ec2DeepInspectionStatus(jtv) } default: @@ -4338,14 +4264,14 @@ func awsRestjson1_deserializeOpDocumentGetSbomExportOutput(v **GetSbomExportOutp return nil } -type awsRestjson1_deserializeOpListAccountPermissions struct { +type awsRestjson1_deserializeOpGetEncryptionKey struct { } -func (*awsRestjson1_deserializeOpListAccountPermissions) ID() string { +func (*awsRestjson1_deserializeOpGetEncryptionKey) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAccountPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetEncryptionKey) 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) @@ -4359,9 +4285,9 @@ func (m *awsRestjson1_deserializeOpListAccountPermissions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAccountPermissions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetEncryptionKey(response, &metadata) } - output := &ListAccountPermissionsOutput{} + output := &GetEncryptionKeyOutput{} out.Result = output var buff [1024]byte @@ -4382,7 +4308,7 @@ func (m *awsRestjson1_deserializeOpListAccountPermissions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAccountPermissionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetEncryptionKeyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4395,7 +4321,7 @@ func (m *awsRestjson1_deserializeOpListAccountPermissions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAccountPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetEncryptionKey(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)} @@ -4442,6 +4368,9 @@ func awsRestjson1_deserializeOpErrorListAccountPermissions(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("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4458,7 +4387,7 @@ func awsRestjson1_deserializeOpErrorListAccountPermissions(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListAccountPermissionsOutput(v **ListAccountPermissionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetEncryptionKeyOutput(v **GetEncryptionKeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4471,27 +4400,22 @@ func awsRestjson1_deserializeOpDocumentListAccountPermissionsOutput(v **ListAcco return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAccountPermissionsOutput + var sv *GetEncryptionKeyOutput if *v == nil { - sv = &ListAccountPermissionsOutput{} + sv = &GetEncryptionKeyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "kmsKeyId": 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 KmsKeyArn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) - } - - case "permissions": - if err := awsRestjson1_deserializeDocumentPermissions(&sv.Permissions, value); err != nil { - return err + sv.KmsKeyId = ptr.String(jtv) } default: @@ -4503,14 +4427,14 @@ func awsRestjson1_deserializeOpDocumentListAccountPermissionsOutput(v **ListAcco return nil } -type awsRestjson1_deserializeOpListCoverage struct { +type awsRestjson1_deserializeOpGetFindingsReportStatus struct { } -func (*awsRestjson1_deserializeOpListCoverage) ID() string { +func (*awsRestjson1_deserializeOpGetFindingsReportStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCoverage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFindingsReportStatus) 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) @@ -4524,9 +4448,9 @@ func (m *awsRestjson1_deserializeOpListCoverage) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCoverage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFindingsReportStatus(response, &metadata) } - output := &ListCoverageOutput{} + output := &GetFindingsReportStatusOutput{} out.Result = output var buff [1024]byte @@ -4547,7 +4471,7 @@ func (m *awsRestjson1_deserializeOpListCoverage) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCoverageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFindingsReportStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4560,7 +4484,7 @@ func (m *awsRestjson1_deserializeOpListCoverage) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCoverage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFindingsReportStatus(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)} @@ -4601,9 +4525,15 @@ func awsRestjson1_deserializeOpErrorListCoverage(response *smithyhttp.Response, } 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) @@ -4620,7 +4550,7 @@ func awsRestjson1_deserializeOpErrorListCoverage(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListCoverageOutput(v **ListCoverageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFindingsReportStatusOutput(v **GetFindingsReportStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4633,27 +4563,59 @@ func awsRestjson1_deserializeOpDocumentListCoverageOutput(v **ListCoverageOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCoverageOutput + var sv *GetFindingsReportStatusOutput if *v == nil { - sv = &ListCoverageOutput{} + sv = &GetFindingsReportStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "coveredResources": - if err := awsRestjson1_deserializeDocumentCoveredResources(&sv.CoveredResources, value); err != nil { + case "destination": + if err := awsRestjson1_deserializeDocumentDestination(&sv.Destination, value); err != nil { return err } - case "nextToken": + case "errorCode": 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 ReportingErrorCode to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ErrorCode = types.ReportingErrorCode(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "filterCriteria": + if err := awsRestjson1_deserializeDocumentFilterCriteria(&sv.FilterCriteria, value); err != nil { + return err + } + + case "reportId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) + } + sv.ReportId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalReportStatus to be of type string, got %T instead", value) + } + sv.Status = types.ExternalReportStatus(jtv) } default: @@ -4665,14 +4627,14 @@ func awsRestjson1_deserializeOpDocumentListCoverageOutput(v **ListCoverageOutput return nil } -type awsRestjson1_deserializeOpListCoverageStatistics struct { +type awsRestjson1_deserializeOpGetMember struct { } -func (*awsRestjson1_deserializeOpListCoverageStatistics) ID() string { +func (*awsRestjson1_deserializeOpGetMember) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCoverageStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetMember) 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) @@ -4686,9 +4648,9 @@ func (m *awsRestjson1_deserializeOpListCoverageStatistics) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCoverageStatistics(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetMember(response, &metadata) } - output := &ListCoverageStatisticsOutput{} + output := &GetMemberOutput{} out.Result = output var buff [1024]byte @@ -4709,7 +4671,7 @@ func (m *awsRestjson1_deserializeOpListCoverageStatistics) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCoverageStatisticsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetMemberOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4722,7 +4684,7 @@ func (m *awsRestjson1_deserializeOpListCoverageStatistics) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCoverageStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetMember(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)} @@ -4763,9 +4725,15 @@ func awsRestjson1_deserializeOpErrorListCoverageStatistics(response *smithyhttp. } 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) @@ -4782,7 +4750,7 @@ func awsRestjson1_deserializeOpErrorListCoverageStatistics(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListCoverageStatisticsOutput(v **ListCoverageStatisticsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetMemberOutput(v **GetMemberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4795,42 +4763,20 @@ func awsRestjson1_deserializeOpDocumentListCoverageStatisticsOutput(v **ListCove return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCoverageStatisticsOutput + var sv *GetMemberOutput if *v == nil { - sv = &ListCoverageStatisticsOutput{} + sv = &GetMemberOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "countsByGroup": - if err := awsRestjson1_deserializeDocumentCountsList(&sv.CountsByGroup, value); err != nil { + case "member": + if err := awsRestjson1_deserializeDocumentMember(&sv.Member, 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) - } - - case "totalCounts": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Long to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.TotalCounts = ptr.Int64(i64) - } - default: _, _ = key, value @@ -4840,14 +4786,14 @@ func awsRestjson1_deserializeOpDocumentListCoverageStatisticsOutput(v **ListCove return nil } -type awsRestjson1_deserializeOpListDelegatedAdminAccounts struct { +type awsRestjson1_deserializeOpGetSbomExport struct { } -func (*awsRestjson1_deserializeOpListDelegatedAdminAccounts) ID() string { +func (*awsRestjson1_deserializeOpGetSbomExport) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDelegatedAdminAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetSbomExport) 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) @@ -4861,9 +4807,9 @@ func (m *awsRestjson1_deserializeOpListDelegatedAdminAccounts) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDelegatedAdminAccounts(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetSbomExport(response, &metadata) } - output := &ListDelegatedAdminAccountsOutput{} + output := &GetSbomExportOutput{} out.Result = output var buff [1024]byte @@ -4884,7 +4830,7 @@ func (m *awsRestjson1_deserializeOpListDelegatedAdminAccounts) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDelegatedAdminAccountsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetSbomExportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4897,7 +4843,7 @@ func (m *awsRestjson1_deserializeOpListDelegatedAdminAccounts) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDelegatedAdminAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetSbomExport(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)} @@ -4944,6 +4890,9 @@ func awsRestjson1_deserializeOpErrorListDelegatedAdminAccounts(response *smithyh 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) @@ -4960,7 +4909,7 @@ func awsRestjson1_deserializeOpErrorListDelegatedAdminAccounts(response *smithyh } } -func awsRestjson1_deserializeOpDocumentListDelegatedAdminAccountsOutput(v **ListDelegatedAdminAccountsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetSbomExportOutput(v **GetSbomExportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4973,27 +4922,68 @@ func awsRestjson1_deserializeOpDocumentListDelegatedAdminAccountsOutput(v **List return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDelegatedAdminAccountsOutput + var sv *GetSbomExportOutput if *v == nil { - sv = &ListDelegatedAdminAccountsOutput{} + sv = &GetSbomExportOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "delegatedAdminAccounts": - if err := awsRestjson1_deserializeDocumentDelegatedAdminAccountList(&sv.DelegatedAdminAccounts, value); err != nil { - return err - } - - case "nextToken": + case "errorCode": 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 ReportingErrorCode to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ErrorCode = types.ReportingErrorCode(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "filterCriteria": + if err := awsRestjson1_deserializeDocumentResourceFilterCriteria(&sv.FilterCriteria, value); err != nil { + return err + } + + case "format": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SbomReportFormat to be of type string, got %T instead", value) + } + sv.Format = types.SbomReportFormat(jtv) + } + + case "reportId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) + } + sv.ReportId = ptr.String(jtv) + } + + case "s3Destination": + if err := awsRestjson1_deserializeDocumentDestination(&sv.S3Destination, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalReportStatus to be of type string, got %T instead", value) + } + sv.Status = types.ExternalReportStatus(jtv) } default: @@ -5005,14 +4995,14 @@ func awsRestjson1_deserializeOpDocumentListDelegatedAdminAccountsOutput(v **List return nil } -type awsRestjson1_deserializeOpListFilters struct { +type awsRestjson1_deserializeOpListAccountPermissions struct { } -func (*awsRestjson1_deserializeOpListFilters) ID() string { +func (*awsRestjson1_deserializeOpListAccountPermissions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAccountPermissions) 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) @@ -5026,9 +5016,9 @@ func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFilters(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAccountPermissions(response, &metadata) } - output := &ListFiltersOutput{} + output := &ListAccountPermissionsOutput{} out.Result = output var buff [1024]byte @@ -5049,7 +5039,7 @@ func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFiltersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAccountPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5062,7 +5052,7 @@ func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAccountPermissions(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)} @@ -5125,7 +5115,7 @@ func awsRestjson1_deserializeOpErrorListFilters(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAccountPermissionsOutput(v **ListAccountPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5138,20 +5128,15 @@ func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFiltersOutput + var sv *ListAccountPermissionsOutput if *v == nil { - sv = &ListFiltersOutput{} + sv = &ListAccountPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "filters": - if err := awsRestjson1_deserializeDocumentFilterList(&sv.Filters, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -5161,6 +5146,11 @@ func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, sv.NextToken = ptr.String(jtv) } + case "permissions": + if err := awsRestjson1_deserializeDocumentPermissions(&sv.Permissions, value); err != nil { + return err + } + default: _, _ = key, value @@ -5170,14 +5160,14 @@ func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, return nil } -type awsRestjson1_deserializeOpListFindingAggregations struct { +type awsRestjson1_deserializeOpListCisScanConfigurations struct { } -func (*awsRestjson1_deserializeOpListFindingAggregations) ID() string { +func (*awsRestjson1_deserializeOpListCisScanConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFindingAggregations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCisScanConfigurations) 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) @@ -5191,9 +5181,9 @@ func (m *awsRestjson1_deserializeOpListFindingAggregations) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFindingAggregations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCisScanConfigurations(response, &metadata) } - output := &ListFindingAggregationsOutput{} + output := &ListCisScanConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -5214,7 +5204,7 @@ func (m *awsRestjson1_deserializeOpListFindingAggregations) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFindingAggregationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCisScanConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5227,7 +5217,7 @@ func (m *awsRestjson1_deserializeOpListFindingAggregations) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFindingAggregations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCisScanConfigurations(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)} @@ -5268,6 +5258,9 @@ func awsRestjson1_deserializeOpErrorListFindingAggregations(response *smithyhttp } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -5287,7 +5280,7 @@ func awsRestjson1_deserializeOpErrorListFindingAggregations(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListFindingAggregationsOutput(v **ListFindingAggregationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCisScanConfigurationsOutput(v **ListCisScanConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5300,24 +5293,15 @@ func awsRestjson1_deserializeOpDocumentListFindingAggregationsOutput(v **ListFin return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFindingAggregationsOutput + var sv *ListCisScanConfigurationsOutput if *v == nil { - sv = &ListFindingAggregationsOutput{} + sv = &ListCisScanConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "aggregationType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AggregationType to be of type string, got %T instead", value) - } - sv.AggregationType = types.AggregationType(jtv) - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -5327,8 +5311,8 @@ func awsRestjson1_deserializeOpDocumentListFindingAggregationsOutput(v **ListFin sv.NextToken = ptr.String(jtv) } - case "responses": - if err := awsRestjson1_deserializeDocumentAggregationResponseList(&sv.Responses, value); err != nil { + case "scanConfigurations": + if err := awsRestjson1_deserializeDocumentCisScanConfigurationList(&sv.ScanConfigurations, value); err != nil { return err } @@ -5341,14 +5325,14 @@ func awsRestjson1_deserializeOpDocumentListFindingAggregationsOutput(v **ListFin return nil } -type awsRestjson1_deserializeOpListFindings struct { +type awsRestjson1_deserializeOpListCisScanResultsAggregatedByChecks struct { } -func (*awsRestjson1_deserializeOpListFindings) ID() string { +func (*awsRestjson1_deserializeOpListCisScanResultsAggregatedByChecks) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCisScanResultsAggregatedByChecks) 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) @@ -5362,9 +5346,9 @@ func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFindings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCisScanResultsAggregatedByChecks(response, &metadata) } - output := &ListFindingsOutput{} + output := &ListCisScanResultsAggregatedByChecksOutput{} out.Result = output var buff [1024]byte @@ -5385,7 +5369,7 @@ func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFindingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCisScanResultsAggregatedByChecksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5398,7 +5382,7 @@ func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCisScanResultsAggregatedByChecks(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)} @@ -5439,6 +5423,9 @@ func awsRestjson1_deserializeOpErrorListFindings(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -5458,7 +5445,7 @@ func awsRestjson1_deserializeOpErrorListFindings(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCisScanResultsAggregatedByChecksOutput(v **ListCisScanResultsAggregatedByChecksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5471,17 +5458,17 @@ func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFindingsOutput + var sv *ListCisScanResultsAggregatedByChecksOutput if *v == nil { - sv = &ListFindingsOutput{} + sv = &ListCisScanResultsAggregatedByChecksOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "findings": - if err := awsRestjson1_deserializeDocumentFindingList(&sv.Findings, value); err != nil { + case "checkAggregations": + if err := awsRestjson1_deserializeDocumentCisCheckAggregationList(&sv.CheckAggregations, value); err != nil { return err } @@ -5503,14 +5490,14 @@ func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput return nil } -type awsRestjson1_deserializeOpListMembers struct { +type awsRestjson1_deserializeOpListCisScanResultsAggregatedByTargetResource struct { } -func (*awsRestjson1_deserializeOpListMembers) ID() string { +func (*awsRestjson1_deserializeOpListCisScanResultsAggregatedByTargetResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCisScanResultsAggregatedByTargetResource) 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) @@ -5524,9 +5511,9 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCisScanResultsAggregatedByTargetResource(response, &metadata) } - output := &ListMembersOutput{} + output := &ListCisScanResultsAggregatedByTargetResourceOutput{} out.Result = output var buff [1024]byte @@ -5547,7 +5534,7 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMembersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCisScanResultsAggregatedByTargetResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5560,7 +5547,7 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCisScanResultsAggregatedByTargetResource(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)} @@ -5623,7 +5610,7 @@ func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCisScanResultsAggregatedByTargetResourceOutput(v **ListCisScanResultsAggregatedByTargetResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5636,20 +5623,15 @@ func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMembersOutput + var sv *ListCisScanResultsAggregatedByTargetResourceOutput if *v == nil { - sv = &ListMembersOutput{} + sv = &ListCisScanResultsAggregatedByTargetResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "members": - if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -5659,6 +5641,11 @@ func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, sv.NextToken = ptr.String(jtv) } + case "targetResourceAggregations": + if err := awsRestjson1_deserializeDocumentCisTargetResourceAggregationList(&sv.TargetResourceAggregations, value); err != nil { + return err + } + default: _, _ = key, value @@ -5668,14 +5655,14 @@ func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListCisScans struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListCisScans) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCisScans) 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) @@ -5689,9 +5676,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_deserializeOpErrorListCisScans(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListCisScansOutput{} out.Result = output var buff [1024]byte @@ -5712,7 +5699,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCisScansOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5725,7 +5712,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCisScans(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)} @@ -5766,12 +5753,12 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } 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) @@ -5788,7 +5775,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCisScansOutput(v **ListCisScansOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5801,17 +5788,26 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListCisScansOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListCisScansOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + 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 "scans": + if err := awsRestjson1_deserializeDocumentCisScanList(&sv.Scans, value); err != nil { return err } @@ -5824,14 +5820,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListUsageTotals struct { +type awsRestjson1_deserializeOpListCoverage struct { } -func (*awsRestjson1_deserializeOpListUsageTotals) ID() string { +func (*awsRestjson1_deserializeOpListCoverage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListUsageTotals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCoverage) 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) @@ -5845,9 +5841,9 @@ func (m *awsRestjson1_deserializeOpListUsageTotals) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListUsageTotals(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCoverage(response, &metadata) } - output := &ListUsageTotalsOutput{} + output := &ListCoverageOutput{} out.Result = output var buff [1024]byte @@ -5868,7 +5864,7 @@ func (m *awsRestjson1_deserializeOpListUsageTotals) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListUsageTotalsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCoverageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5881,7 +5877,7 @@ func (m *awsRestjson1_deserializeOpListUsageTotals) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListUsageTotals(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCoverage(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)} @@ -5922,9 +5918,6 @@ func awsRestjson1_deserializeOpErrorListUsageTotals(response *smithyhttp.Respons } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -5944,7 +5937,7 @@ func awsRestjson1_deserializeOpErrorListUsageTotals(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListUsageTotalsOutput(v **ListUsageTotalsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCoverageOutput(v **ListCoverageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5957,29 +5950,29 @@ func awsRestjson1_deserializeOpDocumentListUsageTotalsOutput(v **ListUsageTotals return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListUsageTotalsOutput + var sv *ListCoverageOutput if *v == nil { - sv = &ListUsageTotalsOutput{} + sv = &ListCoverageOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "coveredResources": + if err := awsRestjson1_deserializeDocumentCoveredResources(&sv.CoveredResources, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ListUsageTotalsNextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "totals": - if err := awsRestjson1_deserializeDocumentUsageTotalList(&sv.Totals, value); err != nil { - return err - } - default: _, _ = key, value @@ -5989,14 +5982,14 @@ func awsRestjson1_deserializeOpDocumentListUsageTotalsOutput(v **ListUsageTotals return nil } -type awsRestjson1_deserializeOpResetEncryptionKey struct { +type awsRestjson1_deserializeOpListCoverageStatistics struct { } -func (*awsRestjson1_deserializeOpResetEncryptionKey) ID() string { +func (*awsRestjson1_deserializeOpListCoverageStatistics) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpResetEncryptionKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCoverageStatistics) 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) @@ -6010,15 +6003,43 @@ func (m *awsRestjson1_deserializeOpResetEncryptionKey) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorResetEncryptionKey(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCoverageStatistics(response, &metadata) } - output := &ResetEncryptionKeyOutput{} + output := &ListCoverageStatisticsOutput{} 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_deserializeOpDocumentListCoverageStatisticsOutput(&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_deserializeOpErrorResetEncryptionKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCoverageStatistics(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)} @@ -6059,15 +6080,9 @@ func awsRestjson1_deserializeOpErrorResetEncryptionKey(response *smithyhttp.Resp } 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) @@ -6084,14 +6099,72 @@ func awsRestjson1_deserializeOpErrorResetEncryptionKey(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpSearchVulnerabilities struct { -} +func awsRestjson1_deserializeOpDocumentListCoverageStatisticsOutput(v **ListCoverageStatisticsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } -func (*awsRestjson1_deserializeOpSearchVulnerabilities) ID() string { - return "OperationDeserializer" -} + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } -func (m *awsRestjson1_deserializeOpSearchVulnerabilities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + var sv *ListCoverageStatisticsOutput + if *v == nil { + sv = &ListCoverageStatisticsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "countsByGroup": + if err := awsRestjson1_deserializeDocumentCountsList(&sv.CountsByGroup, 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) + } + + case "totalCounts": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalCounts = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDelegatedAdminAccounts struct { +} + +func (*awsRestjson1_deserializeOpListDelegatedAdminAccounts) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDelegatedAdminAccounts) 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) @@ -6105,9 +6178,9 @@ func (m *awsRestjson1_deserializeOpSearchVulnerabilities) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchVulnerabilities(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDelegatedAdminAccounts(response, &metadata) } - output := &SearchVulnerabilitiesOutput{} + output := &ListDelegatedAdminAccountsOutput{} out.Result = output var buff [1024]byte @@ -6128,7 +6201,7 @@ func (m *awsRestjson1_deserializeOpSearchVulnerabilities) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchVulnerabilitiesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDelegatedAdminAccountsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6141,7 +6214,7 @@ func (m *awsRestjson1_deserializeOpSearchVulnerabilities) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchVulnerabilities(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDelegatedAdminAccounts(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)} @@ -6204,7 +6277,7 @@ func awsRestjson1_deserializeOpErrorSearchVulnerabilities(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentSearchVulnerabilitiesOutput(v **SearchVulnerabilitiesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDelegatedAdminAccountsOutput(v **ListDelegatedAdminAccountsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6217,15 +6290,20 @@ func awsRestjson1_deserializeOpDocumentSearchVulnerabilitiesOutput(v **SearchVul return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchVulnerabilitiesOutput + var sv *ListDelegatedAdminAccountsOutput if *v == nil { - sv = &SearchVulnerabilitiesOutput{} + sv = &ListDelegatedAdminAccountsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "delegatedAdminAccounts": + if err := awsRestjson1_deserializeDocumentDelegatedAdminAccountList(&sv.DelegatedAdminAccounts, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -6235,11 +6313,6 @@ func awsRestjson1_deserializeOpDocumentSearchVulnerabilitiesOutput(v **SearchVul sv.NextToken = ptr.String(jtv) } - case "vulnerabilities": - if err := awsRestjson1_deserializeDocumentVulnerabilities(&sv.Vulnerabilities, value); err != nil { - return err - } - default: _, _ = key, value @@ -6249,14 +6322,14 @@ func awsRestjson1_deserializeOpDocumentSearchVulnerabilitiesOutput(v **SearchVul return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListFilters struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListFilters) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFilters) 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) @@ -6270,15 +6343,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_deserializeOpErrorListFilters(response, &metadata) } - output := &TagResourceOutput{} + output := &ListFiltersOutput{} 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_deserializeOpDocumentListFiltersOutput(&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_deserializeOpErrorListFilters(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)} @@ -6319,15 +6420,12 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + 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) @@ -6344,14 +6442,59 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, 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 *ListFiltersOutput + if *v == nil { + sv = &ListFiltersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "filters": + if err := awsRestjson1_deserializeDocumentFilterList(&sv.Filters, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpListFindingAggregations struct { +} + +func (*awsRestjson1_deserializeOpListFindingAggregations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFindingAggregations) 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) @@ -6365,15 +6508,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_deserializeOpErrorListFindingAggregations(response, &metadata) } - output := &UntagResourceOutput{} + output := &ListFindingAggregationsOutput{} 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_deserializeOpDocumentListFindingAggregationsOutput(&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_deserializeOpErrorListFindingAggregations(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)} @@ -6417,9 +6588,6 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, 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) @@ -6436,106 +6604,68 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateConfiguration struct { -} - -func (*awsRestjson1_deserializeOpUpdateConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateConfiguration) 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 +func awsRestjson1_deserializeOpDocumentListFindingAggregationsOutput(v **ListFindingAggregationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - response, ok := out.RawResponse.(*smithyhttp.Response) + shape, ok := value.(map[string]interface{}) if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + return fmt.Errorf("unexpected JSON type %v", value) } - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateConfiguration(response, &metadata) + var sv *ListFindingAggregationsOutput + if *v == nil { + sv = &ListFindingAggregationsOutput{} + } else { + sv = *v } - output := &UpdateConfigurationOutput{} - out.Result = output - - return out, metadata, err -} -func awsRestjson1_deserializeOpErrorUpdateConfiguration(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) + for key, value := range shape { + switch key { + case "aggregationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AggregationType to be of type string, got %T instead", value) + } + sv.AggregationType = types.AggregationType(jtv) + } - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + 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 strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case "responses": + if err := awsRestjson1_deserializeDocumentAggregationResponseList(&sv.Responses, value); err != nil { + return err + } - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: + _, _ = key, value - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, } - return genericError - } + *v = sv + return nil } -type awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration struct { +type awsRestjson1_deserializeOpListFindings struct { } -func (*awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) ID() string { +func (*awsRestjson1_deserializeOpListFindings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFindings) 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) @@ -6549,9 +6679,9 @@ func (m *awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateEc2DeepInspectionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListFindings(response, &metadata) } - output := &UpdateEc2DeepInspectionConfigurationOutput{} + output := &ListFindingsOutput{} out.Result = output var buff [1024]byte @@ -6572,7 +6702,7 @@ func (m *awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) HandleD return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateEc2DeepInspectionConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListFindingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6585,7 +6715,7 @@ func (m *awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) HandleD return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateEc2DeepInspectionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListFindings(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)} @@ -6626,9 +6756,6 @@ func awsRestjson1_deserializeOpErrorUpdateEc2DeepInspectionConfiguration(respons } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -6648,7 +6775,7 @@ func awsRestjson1_deserializeOpErrorUpdateEc2DeepInspectionConfiguration(respons } } -func awsRestjson1_deserializeOpDocumentUpdateEc2DeepInspectionConfigurationOutput(v **UpdateEc2DeepInspectionConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6661,41 +6788,27 @@ func awsRestjson1_deserializeOpDocumentUpdateEc2DeepInspectionConfigurationOutpu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateEc2DeepInspectionConfigurationOutput + var sv *ListFindingsOutput if *v == nil { - sv = &UpdateEc2DeepInspectionConfigurationOutput{} + sv = &ListFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - case "orgPackagePaths": - if err := awsRestjson1_deserializeDocumentPathList(&sv.OrgPackagePaths, value); err != nil { - return err - } - - case "packagePaths": - if err := awsRestjson1_deserializeDocumentPathList(&sv.PackagePaths, value); err != nil { + case "findings": + if err := awsRestjson1_deserializeDocumentFindingList(&sv.Findings, value); err != nil { return err } - case "status": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Ec2DeepInspectionStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.Status = types.Ec2DeepInspectionStatus(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -6707,14 +6820,14 @@ func awsRestjson1_deserializeOpDocumentUpdateEc2DeepInspectionConfigurationOutpu return nil } -type awsRestjson1_deserializeOpUpdateEncryptionKey struct { +type awsRestjson1_deserializeOpListMembers struct { } -func (*awsRestjson1_deserializeOpUpdateEncryptionKey) ID() string { +func (*awsRestjson1_deserializeOpListMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateEncryptionKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMembers) 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) @@ -6728,15 +6841,43 @@ func (m *awsRestjson1_deserializeOpUpdateEncryptionKey) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateEncryptionKey(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListMembers(response, &metadata) } - output := &UpdateEncryptionKeyOutput{} + output := &ListMembersOutput{} 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_deserializeOpDocumentListMembersOutput(&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_deserializeOpErrorUpdateEncryptionKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMembers(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)} @@ -6783,9 +6924,6 @@ func awsRestjson1_deserializeOpErrorUpdateEncryptionKey(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("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -6802,14 +6940,59 @@ func awsRestjson1_deserializeOpErrorUpdateEncryptionKey(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpUpdateFilter struct { +func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, 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 *ListMembersOutput + if *v == nil { + sv = &ListMembersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "members": + if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateFilter) ID() string { +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -6823,9 +7006,9 @@ func (m *awsRestjson1_deserializeOpUpdateFilter) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateFilter(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UpdateFilterOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -6846,7 +7029,7 @@ func (m *awsRestjson1_deserializeOpUpdateFilter) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateFilterOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6859,7 +7042,7 @@ func (m *awsRestjson1_deserializeOpUpdateFilter) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -6900,9 +7083,6 @@ func awsRestjson1_deserializeOpErrorUpdateFilter(response *smithyhttp.Response, } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -6925,7 +7105,7 @@ func awsRestjson1_deserializeOpErrorUpdateFilter(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateFilterOutput(v **UpdateFilterOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6938,22 +7118,18 @@ func awsRestjson1_deserializeOpDocumentUpdateFilterOutput(v **UpdateFilterOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateFilterOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &UpdateFilterOutput{} + sv = &ListTagsForResourceOutput{} } 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 FilterArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -6965,14 +7141,14 @@ func awsRestjson1_deserializeOpDocumentUpdateFilterOutput(v **UpdateFilterOutput return nil } -type awsRestjson1_deserializeOpUpdateOrganizationConfiguration struct { +type awsRestjson1_deserializeOpListUsageTotals struct { } -func (*awsRestjson1_deserializeOpUpdateOrganizationConfiguration) ID() string { +func (*awsRestjson1_deserializeOpListUsageTotals) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListUsageTotals) 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) @@ -6986,9 +7162,9 @@ func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListUsageTotals(response, &metadata) } - output := &UpdateOrganizationConfigurationOutput{} + output := &ListUsageTotalsOutput{} out.Result = output var buff [1024]byte @@ -7009,7 +7185,7 @@ func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateOrganizationConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListUsageTotalsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7022,7 +7198,7 @@ func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListUsageTotals(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)} @@ -7085,7 +7261,7 @@ func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *sm } } -func awsRestjson1_deserializeOpDocumentUpdateOrganizationConfigurationOutput(v **UpdateOrganizationConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListUsageTotalsOutput(v **ListUsageTotalsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7098,17 +7274,26 @@ func awsRestjson1_deserializeOpDocumentUpdateOrganizationConfigurationOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateOrganizationConfigurationOutput + var sv *ListUsageTotalsOutput if *v == nil { - sv = &UpdateOrganizationConfigurationOutput{} + sv = &ListUsageTotalsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "autoEnable": - if err := awsRestjson1_deserializeDocumentAutoEnable(&sv.AutoEnable, value); err != nil { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListUsageTotalsNextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "totals": + if err := awsRestjson1_deserializeDocumentUsageTotalList(&sv.Totals, value); err != nil { return err } @@ -7121,14 +7306,14 @@ func awsRestjson1_deserializeOpDocumentUpdateOrganizationConfigurationOutput(v * return nil } -type awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration struct { +type awsRestjson1_deserializeOpResetEncryptionKey struct { } -func (*awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration) ID() string { +func (*awsRestjson1_deserializeOpResetEncryptionKey) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpResetEncryptionKey) 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) @@ -7142,15 +7327,15 @@ func (m *awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration) Hand } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateOrgEc2DeepInspectionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorResetEncryptionKey(response, &metadata) } - output := &UpdateOrgEc2DeepInspectionConfigurationOutput{} + output := &ResetEncryptionKeyOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateOrgEc2DeepInspectionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorResetEncryptionKey(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)} @@ -7197,6 +7382,9 @@ func awsRestjson1_deserializeOpErrorUpdateOrgEc2DeepInspectionConfiguration(resp 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) @@ -7213,44 +7401,37 @@ func awsRestjson1_deserializeOpErrorUpdateOrgEc2DeepInspectionConfiguration(resp } } -func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } +type awsRestjson1_deserializeOpSearchVulnerabilities struct { +} - if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - vv, err := strconv.ParseInt(headerValues[0], 0, 32) - if err != nil { - return err - } - v.RetryAfterSeconds = ptr.Int32(int32(vv)) +func (*awsRestjson1_deserializeOpSearchVulnerabilities) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchVulnerabilities) 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 } - return nil -} -func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - vv, err := strconv.ParseInt(headerValues[0], 0, 32) - if err != nil { - return err - } - v.RetryAfterSeconds = ptr.Int32(int32(vv)) + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchVulnerabilities(response, &metadata) } + output := &SearchVulnerabilitiesOutput{} + out.Result = output - 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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -7261,36 +7442,45 @@ func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentSearchVulnerabilitiesOutput(&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), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.BadRequestException{} +func awsRestjson1_deserializeOpErrorSearchVulnerabilities(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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -7300,44 +7490,133 @@ func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Respo return err } - err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - 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(), + 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 err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +func awsRestjson1_deserializeOpDocumentSearchVulnerabilitiesOutput(v **SearchVulnerabilitiesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - return output + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SearchVulnerabilitiesOutput + if *v == nil { + sv = &SearchVulnerabilitiesOutput{} + } 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 "vulnerabilities": + if err := awsRestjson1_deserializeDocumentVulnerabilities(&sv.Vulnerabilities, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} +type awsRestjson1_deserializeOpSendCisSessionHealth struct { +} + +func (*awsRestjson1_deserializeOpSendCisSessionHealth) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSendCisSessionHealth) 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_deserializeOpErrorSendCisSessionHealth(response, &metadata) + } + output := &SendCisSessionHealthOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSendCisSessionHealth(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() - 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_deserializeDocumentConflictException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7349,60 +7628,91 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output -} - -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - 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(), + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(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 err + return genericError + } +} - err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) +type awsRestjson1_deserializeOpSendCisSessionTelemetry struct { +} + +func (*awsRestjson1_deserializeOpSendCisSessionTelemetry) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpSendCisSessionTelemetry) 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 { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSendCisSessionTelemetry(response, &metadata) } + output := &SendCisSessionTelemetryOutput{} + out.Result = output - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} +func awsRestjson1_deserializeOpErrorSendCisSessionTelemetry(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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -7412,33 +7722,92 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - 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(), + 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("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 err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpStartCisSession struct { +} - return output +func (*awsRestjson1_deserializeOpStartCisSession) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} +func (m *awsRestjson1_deserializeOpStartCisSession) 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_deserializeOpErrorStartCisSession(response, &metadata) + } + output := &StartCisSessionOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartCisSession(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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -7448,33 +7817,92 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy return err } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - 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(), + 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("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 err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpStopCisSession struct { +} - return output +func (*awsRestjson1_deserializeOpStopCisSession) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} +func (m *awsRestjson1_deserializeOpStopCisSession) 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_deserializeOpErrorStopCisSession(response, &metadata) + } + output := &StopCisSessionOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStopCisSession(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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -7484,9 +7912,92 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo return err } - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) - - if err != nil { + 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("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_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{ @@ -7497,24 +8008,91 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo } 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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(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 - if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } +} - return output +type awsRestjson1_deserializeOpUntagResource struct { } -func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ValidationException{} +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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -7524,24 +8102,1838 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo return err } - err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + 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("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_deserializeOpUpdateCisScanConfiguration struct { +} +func (*awsRestjson1_deserializeOpUpdateCisScanConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCisScanConfiguration) 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_deserializeOpErrorUpdateCisScanConfiguration(response, &metadata) + } + output := &UpdateCisScanConfigurationOutput{} + 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 err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + err = awsRestjson1_deserializeOpDocumentUpdateCisScanConfigurationOutput(&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 output + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCisScanConfiguration(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_deserializeOpDocumentUpdateCisScanConfigurationOutput(v **UpdateCisScanConfigurationOutput, 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 *UpdateCisScanConfigurationOutput + if *v == nil { + sv = &UpdateCisScanConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "scanConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CisScanConfigurationArn to be of type string, got %T instead", value) + } + sv.ScanConfigurationArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateConfiguration) 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_deserializeOpErrorUpdateConfiguration(response, &metadata) + } + output := &UpdateConfigurationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateConfiguration(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 + + } +} + +type awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) 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_deserializeOpErrorUpdateEc2DeepInspectionConfiguration(response, &metadata) + } + output := &UpdateEc2DeepInspectionConfigurationOutput{} + 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_deserializeOpDocumentUpdateEc2DeepInspectionConfigurationOutput(&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_deserializeOpErrorUpdateEc2DeepInspectionConfiguration(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_deserializeOpDocumentUpdateEc2DeepInspectionConfigurationOutput(v **UpdateEc2DeepInspectionConfigurationOutput, 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 *UpdateEc2DeepInspectionConfigurationOutput + if *v == nil { + sv = &UpdateEc2DeepInspectionConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "orgPackagePaths": + if err := awsRestjson1_deserializeDocumentPathList(&sv.OrgPackagePaths, value); err != nil { + return err + } + + case "packagePaths": + if err := awsRestjson1_deserializeDocumentPathList(&sv.PackagePaths, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Ec2DeepInspectionStatus to be of type string, got %T instead", value) + } + sv.Status = types.Ec2DeepInspectionStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateEncryptionKey struct { +} + +func (*awsRestjson1_deserializeOpUpdateEncryptionKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateEncryptionKey) 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_deserializeOpErrorUpdateEncryptionKey(response, &metadata) + } + output := &UpdateEncryptionKeyOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateEncryptionKey(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_deserializeOpUpdateFilter struct { +} + +func (*awsRestjson1_deserializeOpUpdateFilter) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateFilter) 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_deserializeOpErrorUpdateFilter(response, &metadata) + } + output := &UpdateFilterOutput{} + 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_deserializeOpDocumentUpdateFilterOutput(&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_deserializeOpErrorUpdateFilter(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_deserializeOpDocumentUpdateFilterOutput(v **UpdateFilterOutput, 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 *UpdateFilterOutput + if *v == nil { + sv = &UpdateFilterOutput{} + } 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 FilterArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateOrganizationConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateOrganizationConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) 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_deserializeOpErrorUpdateOrganizationConfiguration(response, &metadata) + } + output := &UpdateOrganizationConfigurationOutput{} + 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_deserializeOpDocumentUpdateOrganizationConfigurationOutput(&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_deserializeOpErrorUpdateOrganizationConfiguration(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_deserializeOpDocumentUpdateOrganizationConfigurationOutput(v **UpdateOrganizationConfigurationOutput, 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 *UpdateOrganizationConfigurationOutput + if *v == nil { + sv = &UpdateOrganizationConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "autoEnable": + if err := awsRestjson1_deserializeDocumentAutoEnable(&sv.AutoEnable, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration) 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_deserializeOpErrorUpdateOrgEc2DeepInspectionConfiguration(response, &metadata) + } + output := &UpdateOrgEc2DeepInspectionConfigurationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateOrgEc2DeepInspectionConfiguration(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_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + 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_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.BadRequestException{} + 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_deserializeDocumentBadRequestException(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + 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_deserializeDocumentConflictException(&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) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + 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) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + 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_deserializeDocumentAccount(v **types.Account, 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.Account + if *v == nil { + sv = &types.Account{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "resourceStatus": + if err := awsRestjson1_deserializeDocumentResourceStatus(&sv.ResourceStatus, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Status to be of type string, got %T instead", value) + } + sv.Status = types.Status(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountAggregationResponse(v **types.AccountAggregationResponse, 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.AccountAggregationResponse + if *v == nil { + sv = &types.AccountAggregationResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "severityCounts": + if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountList(v *[]types.Account, 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.Account + if *v == nil { + cv = []types.Account{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Account + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccount(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAccountState(v **types.AccountState, 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.AccountState + if *v == nil { + sv = &types.AccountState{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "resourceState": + if err := awsRestjson1_deserializeDocumentResourceState(&sv.ResourceState, value); err != nil { + return err + } + + case "state": + if err := awsRestjson1_deserializeDocumentState(&sv.State, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountStateList(v *[]types.AccountState, 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.AccountState + if *v == nil { + cv = []types.AccountState{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountState + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccountState(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAggregationResponse(v *types.AggregationResponse, 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 uv types.AggregationResponse +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "accountAggregation": + var mv types.AccountAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAccountAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberAccountAggregation{Value: mv} + break loop + + case "amiAggregation": + var mv types.AmiAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAmiAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberAmiAggregation{Value: mv} + break loop + + case "awsEcrContainerAggregation": + var mv types.AwsEcrContainerAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAwsEcrContainerAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberAwsEcrContainerAggregation{Value: mv} + break loop + + case "ec2InstanceAggregation": + var mv types.Ec2InstanceAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentEc2InstanceAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberEc2InstanceAggregation{Value: mv} + break loop + + case "findingTypeAggregation": + var mv types.FindingTypeAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFindingTypeAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberFindingTypeAggregation{Value: mv} + break loop + + case "imageLayerAggregation": + var mv types.ImageLayerAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentImageLayerAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberImageLayerAggregation{Value: mv} + break loop + + case "lambdaFunctionAggregation": + var mv types.LambdaFunctionAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentLambdaFunctionAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberLambdaFunctionAggregation{Value: mv} + break loop + + case "lambdaLayerAggregation": + var mv types.LambdaLayerAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentLambdaLayerAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberLambdaLayerAggregation{Value: mv} + break loop + + case "packageAggregation": + var mv types.PackageAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentPackageAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberPackageAggregation{Value: mv} + break loop + + case "repositoryAggregation": + var mv types.RepositoryAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentRepositoryAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberRepositoryAggregation{Value: mv} + break loop + + case "titleAggregation": + var mv types.TitleAggregationResponse + destAddr := &mv + if err := awsRestjson1_deserializeDocumentTitleAggregationResponse(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AggregationResponseMemberTitleAggregation{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentAggregationResponseList(v *[]types.AggregationResponse, 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.AggregationResponse + if *v == nil { + cv = []types.AggregationResponse{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AggregationResponse + if err := awsRestjson1_deserializeDocumentAggregationResponse(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAmiAggregationResponse(v **types.AmiAggregationResponse, 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.AmiAggregationResponse + if *v == nil { + sv = &types.AmiAggregationResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "affectedInstances": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AffectedInstances = ptr.Int64(i64) + } + + case "ami": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmiId to be of type string, got %T instead", value) + } + sv.Ami = ptr.String(jtv) + } + + case "severityCounts": + if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentArchitectureList(v *[]types.Architecture, 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.Architecture + if *v == nil { + cv = []types.Architecture{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Architecture + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) + } + col = types.Architecture(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentAtigData(v **types.AtigData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7554,22 +9946,55 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.AtigData if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.AtigData{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "firstSeen": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.FirstSeen = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected FirstSeen to be a JSON Number, got %T instead", value) + } - sv.Message = ptr.String(jtv) + } + + case "lastSeen": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastSeen = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastSeen to be a JSON Number, got %T instead", value) + + } + } + + case "targets": + if err := awsRestjson1_deserializeDocumentTargets(&sv.Targets, value); err != nil { + return err + } + + case "ttps": + if err := awsRestjson1_deserializeDocumentTtps(&sv.Ttps, value); err != nil { + return err } default: @@ -7581,7 +10006,7 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsRestjson1_deserializeDocumentAccount(v **types.Account, value interface{}) error { +func awsRestjson1_deserializeDocumentAutoEnable(v **types.AutoEnable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7594,36 +10019,49 @@ func awsRestjson1_deserializeDocumentAccount(v **types.Account, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Account + var sv *types.AutoEnable if *v == nil { - sv = &types.Account{} + sv = &types.AutoEnable{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": + case "ec2": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.Ec2 = ptr.Bool(jtv) } - case "resourceStatus": - if err := awsRestjson1_deserializeDocumentResourceStatus(&sv.ResourceStatus, value); err != nil { - return err + case "ecr": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Ecr = ptr.Bool(jtv) } - case "status": + case "lambda": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected Status to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.Status = types.Status(jtv) + sv.Lambda = ptr.Bool(jtv) + } + + case "lambdaCode": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.LambdaCode = ptr.Bool(jtv) } default: @@ -7635,7 +10073,7 @@ func awsRestjson1_deserializeDocumentAccount(v **types.Account, value interface{ return nil } -func awsRestjson1_deserializeDocumentAccountAggregationResponse(v **types.AccountAggregationResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2InstanceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7648,29 +10086,104 @@ func awsRestjson1_deserializeDocumentAccountAggregationResponse(v **types.Accoun return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccountAggregationResponse + var sv *types.AwsEc2InstanceDetails if *v == nil { - sv = &types.AccountAggregationResponse{} + sv = &types.AwsEc2InstanceDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": + case "iamInstanceProfileArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.IamInstanceProfileArn = ptr.String(jtv) } - case "severityCounts": - if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { + case "imageId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ImageId = ptr.String(jtv) + } + + case "ipV4Addresses": + if err := awsRestjson1_deserializeDocumentIpV4AddressList(&sv.IpV4Addresses, value); err != nil { + return err + } + + case "ipV6Addresses": + if err := awsRestjson1_deserializeDocumentIpV6AddressList(&sv.IpV6Addresses, value); err != nil { return err } + case "keyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.KeyName = ptr.String(jtv) + } + + case "launchedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LaunchedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = ptr.String(jtv) + } + + case "subnetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SubnetId = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "vpcId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VpcId = ptr.String(jtv) + } + default: _, _ = key, value @@ -7680,7 +10193,7 @@ func awsRestjson1_deserializeDocumentAccountAggregationResponse(v **types.Accoun return nil } -func awsRestjson1_deserializeDocumentAccountList(v *[]types.Account, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEcrContainerAggregationResponse(v **types.AwsEcrContainerAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7688,33 +10201,85 @@ func awsRestjson1_deserializeDocumentAccountList(v *[]types.Account, value inter return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Account + var sv *types.AwsEcrContainerAggregationResponse if *v == nil { - cv = []types.Account{} + sv = &types.AwsEcrContainerAggregationResponse{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Account - destAddr := &col - if err := awsRestjson1_deserializeDocumentAccount(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "architecture": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Architecture = ptr.String(jtv) + } + + case "imageSha": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ImageSha = ptr.String(jtv) + } + + case "imageTags": + if err := awsRestjson1_deserializeDocumentStringList(&sv.ImageTags, value); err != nil { + return err + } + + case "repository": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Repository = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "severityCounts": + if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { + return err + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAccountState(v **types.AccountState, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEcrContainerImageDetails(v **types.AwsEcrContainerImageDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7727,34 +10292,90 @@ func awsRestjson1_deserializeDocumentAccountState(v **types.AccountState, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccountState + var sv *types.AwsEcrContainerImageDetails if *v == nil { - sv = &types.AccountState{} + sv = &types.AwsEcrContainerImageDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": + case "architecture": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.Architecture = ptr.String(jtv) } - case "resourceState": - if err := awsRestjson1_deserializeDocumentResourceState(&sv.ResourceState, value); err != nil { - return err + case "author": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Author = ptr.String(jtv) } - case "state": - if err := awsRestjson1_deserializeDocumentState(&sv.State, value); err != nil { + case "imageHash": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageHash to be of type string, got %T instead", value) + } + sv.ImageHash = ptr.String(jtv) + } + + case "imageTags": + if err := awsRestjson1_deserializeDocumentImageTagList(&sv.ImageTags, value); err != nil { return err } + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = ptr.String(jtv) + } + + case "pushedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "registry": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Registry = ptr.String(jtv) + } + + case "repositoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RepositoryName = ptr.String(jtv) + } + default: _, _ = key, value @@ -7764,7 +10385,7 @@ func awsRestjson1_deserializeDocumentAccountState(v **types.AccountState, value return nil } -func awsRestjson1_deserializeDocumentAccountStateList(v *[]types.AccountState, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(v **types.AwsLambdaFunctionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7772,205 +10393,115 @@ func awsRestjson1_deserializeDocumentAccountStateList(v *[]types.AccountState, v return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AccountState + var sv *types.AwsLambdaFunctionDetails if *v == nil { - cv = []types.AccountState{} + sv = &types.AwsLambdaFunctionDetails{} } else { - cv = *v - } - - for _, value := range shape { - var col types.AccountState - destAddr := &col - if err := awsRestjson1_deserializeDocumentAccountState(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAggregationResponse(v *types.AggregationResponse, 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) + sv = *v } - var uv types.AggregationResponse -loop: for key, value := range shape { - if value == nil { - continue - } switch key { - case "accountAggregation": - var mv types.AccountAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentAccountAggregationResponse(&destAddr, value); err != nil { + case "architectures": + if err := awsRestjson1_deserializeDocumentArchitectureList(&sv.Architectures, value); err != nil { return err } - mv = *destAddr - uv = &types.AggregationResponseMemberAccountAggregation{Value: mv} - break loop - case "amiAggregation": - var mv types.AmiAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentAmiAggregationResponse(&destAddr, value); err != nil { - return err + case "codeSha256": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.CodeSha256 = ptr.String(jtv) } - mv = *destAddr - uv = &types.AggregationResponseMemberAmiAggregation{Value: mv} - break loop - case "awsEcrContainerAggregation": - var mv types.AwsEcrContainerAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentAwsEcrContainerAggregationResponse(&destAddr, value); err != nil { - return err + case "executionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExecutionRoleArn to be of type string, got %T instead", value) + } + sv.ExecutionRoleArn = ptr.String(jtv) } - mv = *destAddr - uv = &types.AggregationResponseMemberAwsEcrContainerAggregation{Value: mv} - break loop - case "ec2InstanceAggregation": - var mv types.Ec2InstanceAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentEc2InstanceAggregationResponse(&destAddr, value); err != nil { - return err + case "functionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FunctionName to be of type string, got %T instead", value) + } + sv.FunctionName = ptr.String(jtv) } - mv = *destAddr - uv = &types.AggregationResponseMemberEc2InstanceAggregation{Value: mv} - break loop - case "findingTypeAggregation": - var mv types.FindingTypeAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentFindingTypeAggregationResponse(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.AggregationResponseMemberFindingTypeAggregation{Value: mv} - break loop + case "lastModifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - case "imageLayerAggregation": - var mv types.ImageLayerAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentImageLayerAggregationResponse(&destAddr, value); err != nil { - return err + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } - mv = *destAddr - uv = &types.AggregationResponseMemberImageLayerAggregation{Value: mv} - break loop - case "lambdaFunctionAggregation": - var mv types.LambdaFunctionAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentLambdaFunctionAggregationResponse(&destAddr, value); err != nil { + case "layers": + if err := awsRestjson1_deserializeDocumentLayerList(&sv.Layers, value); err != nil { return err } - mv = *destAddr - uv = &types.AggregationResponseMemberLambdaFunctionAggregation{Value: mv} - break loop - case "lambdaLayerAggregation": - var mv types.LambdaLayerAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentLambdaLayerAggregationResponse(&destAddr, value); err != nil { - return err + case "packageType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageType to be of type string, got %T instead", value) + } + sv.PackageType = types.PackageType(jtv) } - mv = *destAddr - uv = &types.AggregationResponseMemberLambdaLayerAggregation{Value: mv} - break loop - case "packageAggregation": - var mv types.PackageAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentPackageAggregationResponse(&destAddr, value); err != nil { - return err + case "runtime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Runtime to be of type string, got %T instead", value) + } + sv.Runtime = types.Runtime(jtv) } - mv = *destAddr - uv = &types.AggregationResponseMemberPackageAggregation{Value: mv} - break loop - case "repositoryAggregation": - var mv types.RepositoryAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentRepositoryAggregationResponse(&destAddr, value); err != nil { - return err + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) } - mv = *destAddr - uv = &types.AggregationResponseMemberRepositoryAggregation{Value: mv} - break loop - case "titleAggregation": - var mv types.TitleAggregationResponse - destAddr := &mv - if err := awsRestjson1_deserializeDocumentTitleAggregationResponse(&destAddr, value); err != nil { + case "vpcConfig": + if err := awsRestjson1_deserializeDocumentLambdaVpcConfig(&sv.VpcConfig, value); err != nil { return err } - mv = *destAddr - uv = &types.AggregationResponseMemberTitleAggregation{Value: mv} - break loop default: - uv = &types.UnknownUnionMember{Tag: key} - break loop - - } - } - *v = uv - return nil -} - -func awsRestjson1_deserializeDocumentAggregationResponseList(v *[]types.AggregationResponse, 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.AggregationResponse - if *v == nil { - cv = []types.AggregationResponse{} - } else { - cv = *v - } + _, _ = key, value - for _, value := range shape { - var col types.AggregationResponse - if err := awsRestjson1_deserializeDocumentAggregationResponse(&col, value); err != nil { - return err } - cv = append(cv, col) - } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAmiAggregationResponse(v **types.AmiAggregationResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7983,49 +10514,22 @@ func awsRestjson1_deserializeDocumentAmiAggregationResponse(v **types.AmiAggrega return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AmiAggregationResponse + var sv *types.BadRequestException if *v == nil { - sv = &types.AmiAggregationResponse{} + sv = &types.BadRequestException{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "affectedInstances": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Long to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.AffectedInstances = ptr.Int64(i64) - } - - case "ami": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AmiId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Ami = ptr.String(jtv) - } - - case "severityCounts": - if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { - return err + sv.Message = ptr.String(jtv) } default: @@ -8037,7 +10541,7 @@ func awsRestjson1_deserializeDocumentAmiAggregationResponse(v **types.AmiAggrega return nil } -func awsRestjson1_deserializeDocumentArchitectureList(v *[]types.Architecture, value interface{}) error { +func awsRestjson1_deserializeDocumentCisAccountIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8050,21 +10554,21 @@ func awsRestjson1_deserializeDocumentArchitectureList(v *[]types.Architecture, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Architecture + var cv []string if *v == nil { - cv = []types.Architecture{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.Architecture + var col string if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } - col = types.Architecture(jtv) + col = jtv } cv = append(cv, col) @@ -8073,7 +10577,7 @@ func awsRestjson1_deserializeDocumentArchitectureList(v *[]types.Architecture, v return nil } -func awsRestjson1_deserializeDocumentAtigData(v **types.AtigData, value interface{}) error { +func awsRestjson1_deserializeDocumentCisaData(v **types.CisaData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8086,16 +10590,25 @@ func awsRestjson1_deserializeDocumentAtigData(v **types.AtigData, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AtigData + var sv *types.CisaData if *v == nil { - sv = &types.AtigData{} + sv = &types.CisaData{} } else { sv = *v } for key, value := range shape { switch key { - case "firstSeen": + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CisaAction to be of type string, got %T instead", value) + } + sv.Action = ptr.String(jtv) + } + + case "dateAdded": if value != nil { switch jtv := value.(type) { case json.Number: @@ -8103,15 +10616,15 @@ func awsRestjson1_deserializeDocumentAtigData(v **types.AtigData, value interfac if err != nil { return err } - sv.FirstSeen = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.DateAdded = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: - return fmt.Errorf("expected FirstSeen to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected CisaDateAdded to be a JSON Number, got %T instead", value) } } - case "lastSeen": + case "dateDue": if value != nil { switch jtv := value.(type) { case json.Number: @@ -8119,24 +10632,14 @@ func awsRestjson1_deserializeDocumentAtigData(v **types.AtigData, value interfac if err != nil { return err } - sv.LastSeen = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.DateDue = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: - return fmt.Errorf("expected LastSeen to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected CisaDateDue to be a JSON Number, got %T instead", value) } } - case "targets": - if err := awsRestjson1_deserializeDocumentTargets(&sv.Targets, value); err != nil { - return err - } - - case "ttps": - if err := awsRestjson1_deserializeDocumentTtps(&sv.Ttps, value); err != nil { - return err - } - default: _, _ = key, value @@ -8146,7 +10649,7 @@ func awsRestjson1_deserializeDocumentAtigData(v **types.AtigData, value interfac return nil } -func awsRestjson1_deserializeDocumentAutoEnable(v **types.AutoEnable, value interface{}) error { +func awsRestjson1_deserializeDocumentCisCheckAggregation(v **types.CisCheckAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8159,49 +10662,81 @@ func awsRestjson1_deserializeDocumentAutoEnable(v **types.AutoEnable, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AutoEnable + var sv *types.CisCheckAggregation if *v == nil { - sv = &types.AutoEnable{} + sv = &types.CisCheckAggregation{} } else { sv = *v } for key, value := range shape { switch key { - case "ec2": + case "accountId": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } - sv.Ec2 = ptr.Bool(jtv) + sv.AccountId = ptr.String(jtv) } - case "ecr": + case "checkDescription": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Ecr = ptr.Bool(jtv) + sv.CheckDescription = ptr.String(jtv) } - case "lambda": + case "checkId": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Lambda = ptr.Bool(jtv) + sv.CheckId = ptr.String(jtv) } - case "lambdaCode": + case "level": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected CisSecurityLevel to be of type string, got %T instead", value) } - sv.LambdaCode = ptr.Bool(jtv) + sv.Level = types.CisSecurityLevel(jtv) + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Platform = ptr.String(jtv) + } + + case "scanArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CisScanArn to be of type string, got %T instead", value) + } + sv.ScanArn = ptr.String(jtv) + } + + case "statusCounts": + if err := awsRestjson1_deserializeDocumentStatusCounts(&sv.StatusCounts, value); err != nil { + return err + } + + 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: @@ -8213,7 +10748,41 @@ func awsRestjson1_deserializeDocumentAutoEnable(v **types.AutoEnable, value inte return nil } -func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2InstanceDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentCisCheckAggregationList(v *[]types.CisCheckAggregation, 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.CisCheckAggregation + if *v == nil { + cv = []types.CisCheckAggregation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CisCheckAggregation + destAddr := &col + if err := awsRestjson1_deserializeDocumentCisCheckAggregation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCisScan(v **types.CisScan, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8226,53 +10795,47 @@ func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2Insta return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsEc2InstanceDetails + var sv *types.CisScan if *v == nil { - sv = &types.AwsEc2InstanceDetails{} + sv = &types.CisScan{} } else { sv = *v } for key, value := range shape { switch key { - case "iamInstanceProfileArn": + case "failedChecks": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.IamInstanceProfileArn = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FailedChecks = ptr.Int32(int32(i64)) } - case "imageId": + case "scanArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected CisScanArn to be of type string, got %T instead", value) } - sv.ImageId = ptr.String(jtv) + sv.ScanArn = ptr.String(jtv) } - case "ipV4Addresses": - if err := awsRestjson1_deserializeDocumentIpV4AddressList(&sv.IpV4Addresses, value); err != nil { - return err - } - - case "ipV6Addresses": - if err := awsRestjson1_deserializeDocumentIpV6AddressList(&sv.IpV6Addresses, value); err != nil { - return err - } - - case "keyName": + case "scanConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected CisScanConfigurationArn to be of type string, got %T instead", value) } - sv.KeyName = ptr.String(jtv) + sv.ScanConfigurationArn = ptr.String(jtv) } - case "launchedAt": + case "scanDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -8280,48 +10843,66 @@ func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2Insta if err != nil { return err } - sv.LaunchedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.ScanDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: - return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } - case "platform": + case "scanName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected CisScanName to be of type string, got %T instead", value) } - sv.Platform = ptr.String(jtv) + sv.ScanName = ptr.String(jtv) } - case "subnetId": + case "scheduledBy": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.SubnetId = ptr.String(jtv) + sv.ScheduledBy = ptr.String(jtv) } - case "type": + case "securityLevel": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected CisSecurityLevel to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.SecurityLevel = types.CisSecurityLevel(jtv) } - case "vpcId": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected CisScanStatus to be of type string, got %T instead", value) } - sv.VpcId = ptr.String(jtv) + sv.Status = types.CisScanStatus(jtv) + } + + case "targets": + if err := awsRestjson1_deserializeDocumentCisTargets(&sv.Targets, value); err != nil { + return err + } + + case "totalChecks": + 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.TotalChecks = ptr.Int32(int32(i64)) } default: @@ -8333,7 +10914,7 @@ func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2Insta return nil } -func awsRestjson1_deserializeDocumentAwsEcrContainerAggregationResponse(v **types.AwsEcrContainerAggregationResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentCisScanConfiguration(v **types.CisScanConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8346,67 +10927,63 @@ func awsRestjson1_deserializeDocumentAwsEcrContainerAggregationResponse(v **type return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsEcrContainerAggregationResponse + var sv *types.CisScanConfiguration if *v == nil { - sv = &types.AwsEcrContainerAggregationResponse{} + sv = &types.CisScanConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": + case "ownerId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected CisOwnerId to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.OwnerId = ptr.String(jtv) } - case "architecture": + case "scanConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected CisScanConfigurationArn to be of type string, got %T instead", value) } - sv.Architecture = ptr.String(jtv) + sv.ScanConfigurationArn = ptr.String(jtv) } - case "imageSha": + case "scanName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected CisScanName to be of type string, got %T instead", value) } - sv.ImageSha = ptr.String(jtv) + sv.ScanName = ptr.String(jtv) } - case "imageTags": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ImageTags, value); err != nil { + case "schedule": + if err := awsRestjson1_deserializeDocumentSchedule(&sv.Schedule, value); err != nil { return err } - case "repository": + case "securityLevel": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected CisSecurityLevel to be of type string, got %T instead", value) } - sv.Repository = ptr.String(jtv) + sv.SecurityLevel = types.CisSecurityLevel(jtv) } - case "resourceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ResourceId = ptr.String(jtv) + case "tags": + if err := awsRestjson1_deserializeDocumentCisTagMap(&sv.Tags, value); err != nil { + return err } - case "severityCounts": - if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { + case "targets": + if err := awsRestjson1_deserializeDocumentCisTargets(&sv.Targets, value); err != nil { return err } @@ -8419,7 +10996,75 @@ func awsRestjson1_deserializeDocumentAwsEcrContainerAggregationResponse(v **type return nil } -func awsRestjson1_deserializeDocumentAwsEcrContainerImageDetails(v **types.AwsEcrContainerImageDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentCisScanConfigurationList(v *[]types.CisScanConfiguration, 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.CisScanConfiguration + if *v == nil { + cv = []types.CisScanConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CisScanConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentCisScanConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCisScanList(v *[]types.CisScan, 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.CisScan + if *v == nil { + cv = []types.CisScan{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CisScan + destAddr := &col + if err := awsRestjson1_deserializeDocumentCisScan(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCisScanResultDetails(v **types.CisScanResultDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8432,88 +11077,121 @@ func awsRestjson1_deserializeDocumentAwsEcrContainerImageDetails(v **types.AwsEc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsEcrContainerImageDetails + var sv *types.CisScanResultDetails if *v == nil { - sv = &types.AwsEcrContainerImageDetails{} + sv = &types.CisScanResultDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "architecture": + case "accountId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } - sv.Architecture = ptr.String(jtv) + sv.AccountId = ptr.String(jtv) } - case "author": + case "checkDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Author = ptr.String(jtv) + sv.CheckDescription = ptr.String(jtv) } - case "imageHash": + case "checkId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageHash to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ImageHash = ptr.String(jtv) + sv.CheckId = ptr.String(jtv) } - case "imageTags": - if err := awsRestjson1_deserializeDocumentImageTagList(&sv.ImageTags, value); err != nil { - return err + case "findingArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CisFindingArn to be of type string, got %T instead", value) + } + sv.FindingArn = ptr.String(jtv) + } + + case "level": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CisSecurityLevel to be of type string, got %T instead", value) + } + sv.Level = types.CisSecurityLevel(jtv) } case "platform": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Platform = ptr.String(jtv) } - case "pushedAt": + case "remediation": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.PushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Remediation = ptr.String(jtv) + } - default: - return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) + case "scanArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CisScanArn to be of type string, got %T instead", value) + } + sv.ScanArn = ptr.String(jtv) + } + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CisFindingStatus to be of type string, got %T instead", value) } + sv.Status = types.CisFindingStatus(jtv) } - case "registry": + case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Registry = ptr.String(jtv) + sv.StatusReason = ptr.String(jtv) } - case "repositoryName": + case "targetResourceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } - sv.RepositoryName = ptr.String(jtv) + sv.TargetResourceId = 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: @@ -8521,11 +11199,81 @@ func awsRestjson1_deserializeDocumentAwsEcrContainerImageDetails(v **types.AwsEc } } - *v = sv + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCisScanResultDetailsList(v *[]types.CisScanResultDetails, 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.CisScanResultDetails + if *v == nil { + cv = []types.CisScanResultDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CisScanResultDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentCisScanResultDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCisTagMap(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 MapValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv return nil } -func awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(v **types.AwsLambdaFunctionDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentCisTargetResourceAggregation(v **types.CisTargetResourceAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8538,98 +11286,77 @@ func awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(v **types.AwsLambd return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsLambdaFunctionDetails + var sv *types.CisTargetResourceAggregation if *v == nil { - sv = &types.AwsLambdaFunctionDetails{} + sv = &types.CisTargetResourceAggregation{} } else { sv = *v } for key, value := range shape { switch key { - case "architectures": - if err := awsRestjson1_deserializeDocumentArchitectureList(&sv.Architectures, value); err != nil { - return err - } - - case "codeSha256": + case "accountId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } - sv.CodeSha256 = ptr.String(jtv) + sv.AccountId = ptr.String(jtv) } - case "executionRoleArn": + case "platform": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExecutionRoleArn to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ExecutionRoleArn = ptr.String(jtv) + sv.Platform = ptr.String(jtv) } - case "functionName": + case "scanArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FunctionName to be of type string, got %T instead", value) - } - sv.FunctionName = ptr.String(jtv) - } - - case "lastModifiedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + return fmt.Errorf("expected CisScanArn to be of type string, got %T instead", value) } + sv.ScanArn = ptr.String(jtv) } - case "layers": - if err := awsRestjson1_deserializeDocumentLayerList(&sv.Layers, value); err != nil { + case "statusCounts": + if err := awsRestjson1_deserializeDocumentStatusCounts(&sv.StatusCounts, value); err != nil { return err } - case "packageType": + case "targetResourceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PackageType to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } - sv.PackageType = types.PackageType(jtv) + sv.TargetResourceId = ptr.String(jtv) } - case "runtime": + case "targetResourceTags": + if err := awsRestjson1_deserializeDocumentTargetResourceTags(&sv.TargetResourceTags, value); err != nil { + return err + } + + case "targetStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Runtime to be of type string, got %T instead", value) + return fmt.Errorf("expected CisTargetStatus to be of type string, got %T instead", value) } - sv.Runtime = types.Runtime(jtv) + sv.TargetStatus = types.CisTargetStatus(jtv) } - case "version": + case "targetStatusReason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Version to be of type string, got %T instead", value) + return fmt.Errorf("expected CisTargetStatusReason to be of type string, got %T instead", value) } - sv.Version = ptr.String(jtv) - } - - case "vpcConfig": - if err := awsRestjson1_deserializeDocumentLambdaVpcConfig(&sv.VpcConfig, value); err != nil { - return err + sv.TargetStatusReason = types.CisTargetStatusReason(jtv) } default: @@ -8641,7 +11368,7 @@ func awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(v **types.AwsLambd return nil } -func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { +func awsRestjson1_deserializeDocumentCisTargetResourceAggregationList(v *[]types.CisTargetResourceAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8649,39 +11376,33 @@ func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestExc return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BadRequestException + var cv []types.CisTargetResourceAggregation if *v == nil { - sv = &types.BadRequestException{} + cv = []types.CisTargetResourceAggregation{} } else { - sv = *v + cv = *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 - + for _, value := range shape { + var col types.CisTargetResourceAggregation + destAddr := &col + if err := awsRestjson1_deserializeDocumentCisTargetResourceAggregation(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentCisaData(v **types.CisaData, value interface{}) error { +func awsRestjson1_deserializeDocumentCisTargets(v **types.CisTargets, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8694,54 +11415,23 @@ func awsRestjson1_deserializeDocumentCisaData(v **types.CisaData, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CisaData + var sv *types.CisTargets if *v == nil { - sv = &types.CisaData{} + sv = &types.CisTargets{} } else { sv = *v } for key, value := range shape { switch key { - case "action": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CisaAction to be of type string, got %T instead", value) - } - sv.Action = ptr.String(jtv) - } - - case "dateAdded": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DateAdded = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CisaDateAdded to be a JSON Number, got %T instead", value) - - } + case "accountIds": + if err := awsRestjson1_deserializeDocumentCisAccountIdList(&sv.AccountIds, value); err != nil { + return err } - case "dateDue": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DateDue = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CisaDateDue to be a JSON Number, got %T instead", value) - - } + case "targetResourceTags": + if err := awsRestjson1_deserializeDocumentTargetResourceTags(&sv.TargetResourceTags, value); err != nil { + return err } default: @@ -10011,6 +12701,42 @@ func awsRestjson1_deserializeDocumentCwes(v *[]string, value interface{}) error return nil } +func awsRestjson1_deserializeDocumentDailySchedule(v **types.DailySchedule, 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.DailySchedule + if *v == nil { + sv = &types.DailySchedule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "startTime": + if err := awsRestjson1_deserializeDocumentTime(&sv.StartTime, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDateFilter(v **types.DateFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10108,6 +12834,42 @@ func awsRestjson1_deserializeDocumentDateFilterList(v *[]types.DateFilter, value return nil } +func awsRestjson1_deserializeDocumentDaysList(v *[]types.Day, 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.Day + if *v == nil { + cv = []types.Day{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Day + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Day to be of type string, got %T instead", value) + } + col = types.Day(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentDelegatedAdmin(v **types.DelegatedAdmin, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13386,6 +16148,51 @@ func awsRestjson1_deserializeDocumentMemberList(v *[]types.Member, value interfa return nil } +func awsRestjson1_deserializeDocumentMonthlySchedule(v **types.MonthlySchedule, 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.MonthlySchedule + if *v == nil { + sv = &types.MonthlySchedule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "day": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Day to be of type string, got %T instead", value) + } + sv.Day = types.Day(jtv) + } + + case "startTime": + if err := awsRestjson1_deserializeDocumentTime(&sv.StartTime, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentNetworkPath(v **types.NetworkPath, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13637,7 +16444,38 @@ func awsRestjson1_deserializeDocumentNumberFilterList(v *[]types.NumberFilter, v cv = append(cv, col) } - *v = cv + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentOneTimeSchedule(v **types.OneTimeSchedule, 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.OneTimeSchedule + if *v == nil { + sv = &types.OneTimeSchedule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv return nil } @@ -15066,6 +17904,76 @@ func awsRestjson1_deserializeDocumentScanStatus(v **types.ScanStatus, value inte return nil } +func awsRestjson1_deserializeDocumentSchedule(v *types.Schedule, 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 uv types.Schedule +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "daily": + var mv types.DailySchedule + destAddr := &mv + if err := awsRestjson1_deserializeDocumentDailySchedule(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ScheduleMemberDaily{Value: mv} + break loop + + case "monthly": + var mv types.MonthlySchedule + destAddr := &mv + if err := awsRestjson1_deserializeDocumentMonthlySchedule(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ScheduleMemberMonthly{Value: mv} + break loop + + case "oneTime": + var mv types.OneTimeSchedule + destAddr := &mv + if err := awsRestjson1_deserializeDocumentOneTimeSchedule(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ScheduleMemberOneTime{Value: mv} + break loop + + case "weekly": + var mv types.WeeklySchedule + destAddr := &mv + if err := awsRestjson1_deserializeDocumentWeeklySchedule(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ScheduleMemberWeekly{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + func awsRestjson1_deserializeDocumentSecurityGroupIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15292,6 +18200,76 @@ func awsRestjson1_deserializeDocumentState(v **types.State, value interface{}) e return nil } +func awsRestjson1_deserializeDocumentStatusCounts(v **types.StatusCounts, 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.StatusCounts + if *v == nil { + sv = &types.StatusCounts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failed": + 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.Failed = ptr.Int32(int32(i64)) + } + + case "passed": + 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.Passed = ptr.Int32(int32(i64)) + } + + case "skipped": + 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.Skipped = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentStep(v **types.Step, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15685,6 +18663,76 @@ func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interfac return nil } +func awsRestjson1_deserializeDocumentTagValueList(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 String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTargetResourceTags(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_deserializeDocumentTagValueList(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentTargets(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15774,6 +18822,55 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc return nil } +func awsRestjson1_deserializeDocumentTime(v **types.Time, 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.Time + if *v == nil { + sv = &types.Time{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "timeOfDay": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeOfDay to be of type string, got %T instead", value) + } + sv.TimeOfDay = ptr.String(jtv) + } + + case "timezone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timezone to be of type string, got %T instead", value) + } + sv.Timezone = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentTitleAggregationResponse(v **types.TitleAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16707,3 +19804,44 @@ func awsRestjson1_deserializeDocumentVulnerablePackageList(v *[]types.Vulnerable *v = cv return nil } + +func awsRestjson1_deserializeDocumentWeeklySchedule(v **types.WeeklySchedule, 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.WeeklySchedule + if *v == nil { + sv = &types.WeeklySchedule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "days": + if err := awsRestjson1_deserializeDocumentDaysList(&sv.Days, value); err != nil { + return err + } + + case "startTime": + if err := awsRestjson1_deserializeDocumentTime(&sv.StartTime, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/inspector2/endpoints.go b/service/inspector2/endpoints.go index 813f2583447..4ec8a753177 100644 --- a/service/inspector2/endpoints.go +++ b/service/inspector2/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://inspector2-fips.") diff --git a/service/inspector2/generated.json b/service/inspector2/generated.json index 74d055a0104..36db86ced37 100644 --- a/service/inspector2/generated.json +++ b/service/inspector2/generated.json @@ -18,9 +18,11 @@ "api_op_BatchUpdateMemberEc2DeepInspectionStatus.go", "api_op_CancelFindingsReport.go", "api_op_CancelSbomExport.go", + "api_op_CreateCisScanConfiguration.go", "api_op_CreateFilter.go", "api_op_CreateFindingsReport.go", "api_op_CreateSbomExport.go", + "api_op_DeleteCisScanConfiguration.go", "api_op_DeleteFilter.go", "api_op_DescribeOrganizationConfiguration.go", "api_op_Disable.go", @@ -28,6 +30,8 @@ "api_op_DisassociateMember.go", "api_op_Enable.go", "api_op_EnableDelegatedAdminAccount.go", + "api_op_GetCisScanReport.go", + "api_op_GetCisScanResultDetails.go", "api_op_GetConfiguration.go", "api_op_GetDelegatedAdminAccount.go", "api_op_GetEc2DeepInspectionConfiguration.go", @@ -36,6 +40,10 @@ "api_op_GetMember.go", "api_op_GetSbomExport.go", "api_op_ListAccountPermissions.go", + "api_op_ListCisScanConfigurations.go", + "api_op_ListCisScanResultsAggregatedByChecks.go", + "api_op_ListCisScanResultsAggregatedByTargetResource.go", + "api_op_ListCisScans.go", "api_op_ListCoverage.go", "api_op_ListCoverageStatistics.go", "api_op_ListDelegatedAdminAccounts.go", @@ -47,8 +55,13 @@ "api_op_ListUsageTotals.go", "api_op_ResetEncryptionKey.go", "api_op_SearchVulnerabilities.go", + "api_op_SendCisSessionHealth.go", + "api_op_SendCisSessionTelemetry.go", + "api_op_StartCisSession.go", + "api_op_StopCisSession.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateCisScanConfiguration.go", "api_op_UpdateConfiguration.go", "api_op_UpdateEc2DeepInspectionConfiguration.go", "api_op_UpdateEncryptionKey.go", diff --git a/service/inspector2/serializers.go b/service/inspector2/serializers.go index cb9a1f30ecb..96d4c621264 100644 --- a/service/inspector2/serializers.go +++ b/service/inspector2/serializers.go @@ -703,6 +703,107 @@ func awsRestjson1_serializeOpDocumentCancelSbomExportInput(v *CancelSbomExportIn return nil } +type awsRestjson1_serializeOpCreateCisScanConfiguration struct { +} + +func (*awsRestjson1_serializeOpCreateCisScanConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateCisScanConfiguration) 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.(*CreateCisScanConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/cis/scan-configuration/create") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateCisScanConfigurationInput(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_serializeOpHttpBindingsCreateCisScanConfigurationInput(v *CreateCisScanConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateCisScanConfigurationInput(v *CreateCisScanConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ScanName != nil { + ok := object.Key("scanName") + ok.String(*v.ScanName) + } + + if v.Schedule != nil { + ok := object.Key("schedule") + if err := awsRestjson1_serializeDocumentSchedule(v.Schedule, ok); err != nil { + return err + } + } + + if len(v.SecurityLevel) > 0 { + ok := object.Key("securityLevel") + ok.String(string(v.SecurityLevel)) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentCisTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.Targets != nil { + ok := object.Key("targets") + if err := awsRestjson1_serializeDocumentCreateCisTargets(v.Targets, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateFilter struct { } @@ -985,6 +1086,81 @@ func awsRestjson1_serializeOpDocumentCreateSbomExportInput(v *CreateSbomExportIn return nil } +type awsRestjson1_serializeOpDeleteCisScanConfiguration struct { +} + +func (*awsRestjson1_serializeOpDeleteCisScanConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteCisScanConfiguration) 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.(*DeleteCisScanConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/cis/scan-configuration/delete") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteCisScanConfigurationInput(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_serializeOpHttpBindingsDeleteCisScanConfigurationInput(v *DeleteCisScanConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteCisScanConfigurationInput(v *DeleteCisScanConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ScanConfigurationArn != nil { + ok := object.Key("scanConfigurationArn") + ok.String(*v.ScanConfigurationArn) + } + + return nil +} + type awsRestjson1_serializeOpDeleteFilter struct { } @@ -1515,14 +1691,14 @@ func awsRestjson1_serializeOpDocumentEnableDelegatedAdminAccountInput(v *EnableD return nil } -type awsRestjson1_serializeOpGetConfiguration struct { +type awsRestjson1_serializeOpGetCisScanReport struct { } -func (*awsRestjson1_serializeOpGetConfiguration) ID() string { +func (*awsRestjson1_serializeOpGetCisScanReport) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetCisScanReport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1530,13 +1706,13 @@ func (m *awsRestjson1_serializeOpGetConfiguration) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetConfigurationInput) + input, ok := in.Parameters.(*GetCisScanReportInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/configuration/get") + opPath, opQuery := httpbinding.SplitURI("/cis/scan/report/get") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1552,6 +1728,17 @@ func (m *awsRestjson1_serializeOpGetConfiguration) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetCisScanReportInput(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} } @@ -1559,7 +1746,7 @@ func (m *awsRestjson1_serializeOpGetConfiguration) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetConfigurationInput(v *GetConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetCisScanReportInput(v *GetCisScanReportInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1567,14 +1754,33 @@ func awsRestjson1_serializeOpHttpBindingsGetConfigurationInput(v *GetConfigurati return nil } -type awsRestjson1_serializeOpGetDelegatedAdminAccount struct { +func awsRestjson1_serializeOpDocumentGetCisScanReportInput(v *GetCisScanReportInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ScanArn != nil { + ok := object.Key("scanArn") + ok.String(*v.ScanArn) + } + + if v.TargetAccounts != nil { + ok := object.Key("targetAccounts") + if err := awsRestjson1_serializeDocumentReportTargetAccounts(v.TargetAccounts, ok); err != nil { + return err + } + } + + return nil } -func (*awsRestjson1_serializeOpGetDelegatedAdminAccount) ID() string { +type awsRestjson1_serializeOpGetCisScanResultDetails struct { +} + +func (*awsRestjson1_serializeOpGetCisScanResultDetails) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetDelegatedAdminAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetCisScanResultDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1582,13 +1788,13 @@ func (m *awsRestjson1_serializeOpGetDelegatedAdminAccount) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetDelegatedAdminAccountInput) + input, ok := in.Parameters.(*GetCisScanResultDetailsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/delegatedadminaccounts/get") + opPath, opQuery := httpbinding.SplitURI("/cis/scan-result/details/get") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1604,6 +1810,17 @@ func (m *awsRestjson1_serializeOpGetDelegatedAdminAccount) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetCisScanResultDetailsInput(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} } @@ -1611,7 +1828,7 @@ func (m *awsRestjson1_serializeOpGetDelegatedAdminAccount) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetDelegatedAdminAccountInput(v *GetDelegatedAdminAccountInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetCisScanResultDetailsInput(v *GetCisScanResultDetailsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1619,14 +1836,63 @@ func awsRestjson1_serializeOpHttpBindingsGetDelegatedAdminAccountInput(v *GetDel return nil } -type awsRestjson1_serializeOpGetEc2DeepInspectionConfiguration struct { +func awsRestjson1_serializeOpDocumentGetCisScanResultDetailsInput(v *GetCisScanResultDetailsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("accountId") + ok.String(*v.AccountId) + } + + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentCisScanResultDetailsFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.ScanArn != nil { + ok := object.Key("scanArn") + ok.String(*v.ScanArn) + } + + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + + if v.TargetResourceId != nil { + ok := object.Key("targetResourceId") + ok.String(*v.TargetResourceId) + } + + return nil } -func (*awsRestjson1_serializeOpGetEc2DeepInspectionConfiguration) ID() string { +type awsRestjson1_serializeOpGetConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetConfiguration) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetEc2DeepInspectionConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1634,13 +1900,13 @@ func (m *awsRestjson1_serializeOpGetEc2DeepInspectionConfiguration) HandleSerial return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetEc2DeepInspectionConfigurationInput) + input, ok := in.Parameters.(*GetConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/ec2deepinspectionconfiguration/get") + opPath, opQuery := httpbinding.SplitURI("/configuration/get") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1663,7 +1929,7 @@ func (m *awsRestjson1_serializeOpGetEc2DeepInspectionConfiguration) HandleSerial return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetEc2DeepInspectionConfigurationInput(v *GetEc2DeepInspectionConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetConfigurationInput(v *GetConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1671,14 +1937,14 @@ func awsRestjson1_serializeOpHttpBindingsGetEc2DeepInspectionConfigurationInput( return nil } -type awsRestjson1_serializeOpGetEncryptionKey struct { +type awsRestjson1_serializeOpGetDelegatedAdminAccount struct { } -func (*awsRestjson1_serializeOpGetEncryptionKey) ID() string { +func (*awsRestjson1_serializeOpGetDelegatedAdminAccount) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetEncryptionKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetDelegatedAdminAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1686,16 +1952,16 @@ func (m *awsRestjson1_serializeOpGetEncryptionKey) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetEncryptionKeyInput) + input, ok := in.Parameters.(*GetDelegatedAdminAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/encryptionkey/get") + opPath, opQuery := httpbinding.SplitURI("/delegatedadminaccounts/get") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1708,7 +1974,111 @@ func (m *awsRestjson1_serializeOpGetEncryptionKey) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetEncryptionKeyInput(input, restEncoder); err != nil { + 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_serializeOpHttpBindingsGetDelegatedAdminAccountInput(v *GetDelegatedAdminAccountInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpGetEc2DeepInspectionConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetEc2DeepInspectionConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetEc2DeepInspectionConfiguration) 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.(*GetEc2DeepInspectionConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ec2deepinspectionconfiguration/get") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + 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_serializeOpHttpBindingsGetEc2DeepInspectionConfigurationInput(v *GetEc2DeepInspectionConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpGetEncryptionKey struct { +} + +func (*awsRestjson1_serializeOpGetEncryptionKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetEncryptionKey) 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.(*GetEncryptionKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/encryptionkey/get") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetEncryptionKeyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2045,14 +2415,14 @@ func awsRestjson1_serializeOpDocumentListAccountPermissionsInput(v *ListAccountP return nil } -type awsRestjson1_serializeOpListCoverage struct { +type awsRestjson1_serializeOpListCisScanConfigurations struct { } -func (*awsRestjson1_serializeOpListCoverage) ID() string { +func (*awsRestjson1_serializeOpListCisScanConfigurations) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListCoverage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListCisScanConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2060,13 +2430,13 @@ func (m *awsRestjson1_serializeOpListCoverage) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListCoverageInput) + input, ok := in.Parameters.(*ListCisScanConfigurationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/coverage/list") + opPath, opQuery := httpbinding.SplitURI("/cis/scan-configuration/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2085,7 +2455,7 @@ func (m *awsRestjson1_serializeOpListCoverage) HandleSerialize(ctx context.Conte restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListCoverageInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListCisScanConfigurationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2100,7 +2470,7 @@ func (m *awsRestjson1_serializeOpListCoverage) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListCoverageInput(v *ListCoverageInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCisScanConfigurationsInput(v *ListCisScanConfigurationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2108,13 +2478,13 @@ func awsRestjson1_serializeOpHttpBindingsListCoverageInput(v *ListCoverageInput, return nil } -func awsRestjson1_serializeOpDocumentListCoverageInput(v *ListCoverageInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListCisScanConfigurationsInput(v *ListCisScanConfigurationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FilterCriteria != nil { ok := object.Key("filterCriteria") - if err := awsRestjson1_serializeDocumentCoverageFilterCriteria(v.FilterCriteria, ok); err != nil { + if err := awsRestjson1_serializeDocumentListCisScanConfigurationsFilterCriteria(v.FilterCriteria, ok); err != nil { return err } } @@ -2129,17 +2499,27 @@ func awsRestjson1_serializeOpDocumentListCoverageInput(v *ListCoverageInput, val ok.String(*v.NextToken) } + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + return nil } -type awsRestjson1_serializeOpListCoverageStatistics struct { +type awsRestjson1_serializeOpListCisScanResultsAggregatedByChecks struct { } -func (*awsRestjson1_serializeOpListCoverageStatistics) ID() string { +func (*awsRestjson1_serializeOpListCisScanResultsAggregatedByChecks) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListCoverageStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListCisScanResultsAggregatedByChecks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2147,13 +2527,13 @@ func (m *awsRestjson1_serializeOpListCoverageStatistics) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListCoverageStatisticsInput) + input, ok := in.Parameters.(*ListCisScanResultsAggregatedByChecksInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/coverage/statistics/list") + opPath, opQuery := httpbinding.SplitURI("/cis/scan-result/check/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2172,7 +2552,7 @@ func (m *awsRestjson1_serializeOpListCoverageStatistics) HandleSerialize(ctx con restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListCoverageStatisticsInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListCisScanResultsAggregatedByChecksInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2187,7 +2567,7 @@ func (m *awsRestjson1_serializeOpListCoverageStatistics) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListCoverageStatisticsInput(v *ListCoverageStatisticsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCisScanResultsAggregatedByChecksInput(v *ListCisScanResultsAggregatedByChecksInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2195,20 +2575,20 @@ func awsRestjson1_serializeOpHttpBindingsListCoverageStatisticsInput(v *ListCove return nil } -func awsRestjson1_serializeOpDocumentListCoverageStatisticsInput(v *ListCoverageStatisticsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListCisScanResultsAggregatedByChecksInput(v *ListCisScanResultsAggregatedByChecksInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FilterCriteria != nil { ok := object.Key("filterCriteria") - if err := awsRestjson1_serializeDocumentCoverageFilterCriteria(v.FilterCriteria, ok); err != nil { + if err := awsRestjson1_serializeDocumentCisScanResultsAggregatedByChecksFilterCriteria(v.FilterCriteria, ok); err != nil { return err } } - if len(v.GroupBy) > 0 { - ok := object.Key("groupBy") - ok.String(string(v.GroupBy)) + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -2216,17 +2596,32 @@ func awsRestjson1_serializeOpDocumentListCoverageStatisticsInput(v *ListCoverage ok.String(*v.NextToken) } + if v.ScanArn != nil { + ok := object.Key("scanArn") + ok.String(*v.ScanArn) + } + + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + return nil } -type awsRestjson1_serializeOpListDelegatedAdminAccounts struct { +type awsRestjson1_serializeOpListCisScanResultsAggregatedByTargetResource struct { } -func (*awsRestjson1_serializeOpListDelegatedAdminAccounts) ID() string { +func (*awsRestjson1_serializeOpListCisScanResultsAggregatedByTargetResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListDelegatedAdminAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListCisScanResultsAggregatedByTargetResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2234,13 +2629,13 @@ func (m *awsRestjson1_serializeOpListDelegatedAdminAccounts) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListDelegatedAdminAccountsInput) + input, ok := in.Parameters.(*ListCisScanResultsAggregatedByTargetResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/delegatedadminaccounts/list") + opPath, opQuery := httpbinding.SplitURI("/cis/scan-result/resource/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2259,7 +2654,7 @@ func (m *awsRestjson1_serializeOpListDelegatedAdminAccounts) HandleSerialize(ctx restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListDelegatedAdminAccountsInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListCisScanResultsAggregatedByTargetResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2274,7 +2669,7 @@ func (m *awsRestjson1_serializeOpListDelegatedAdminAccounts) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListDelegatedAdminAccountsInput(v *ListDelegatedAdminAccountsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCisScanResultsAggregatedByTargetResourceInput(v *ListCisScanResultsAggregatedByTargetResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2282,10 +2677,17 @@ func awsRestjson1_serializeOpHttpBindingsListDelegatedAdminAccountsInput(v *List return nil } -func awsRestjson1_serializeOpDocumentListDelegatedAdminAccountsInput(v *ListDelegatedAdminAccountsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListCisScanResultsAggregatedByTargetResourceInput(v *ListCisScanResultsAggregatedByTargetResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentCisScanResultsAggregatedByTargetResourceFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } + } + if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) @@ -2296,17 +2698,32 @@ func awsRestjson1_serializeOpDocumentListDelegatedAdminAccountsInput(v *ListDele ok.String(*v.NextToken) } + if v.ScanArn != nil { + ok := object.Key("scanArn") + ok.String(*v.ScanArn) + } + + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + return nil } -type awsRestjson1_serializeOpListFilters struct { +type awsRestjson1_serializeOpListCisScans struct { } -func (*awsRestjson1_serializeOpListFilters) ID() string { +func (*awsRestjson1_serializeOpListCisScans) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListCisScans) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2314,13 +2731,13 @@ func (m *awsRestjson1_serializeOpListFilters) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListFiltersInput) + input, ok := in.Parameters.(*ListCisScansInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/filters/list") + opPath, opQuery := httpbinding.SplitURI("/cis/scan/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2339,7 +2756,7 @@ func (m *awsRestjson1_serializeOpListFilters) HandleSerialize(ctx context.Contex restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListFiltersInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListCisScansInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2354,7 +2771,7 @@ func (m *awsRestjson1_serializeOpListFilters) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListFiltersInput(v *ListFiltersInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCisScansInput(v *ListCisScansInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2362,18 +2779,18 @@ func awsRestjson1_serializeOpHttpBindingsListFiltersInput(v *ListFiltersInput, e return nil } -func awsRestjson1_serializeOpDocumentListFiltersInput(v *ListFiltersInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListCisScansInput(v *ListCisScansInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.Action) > 0 { - ok := object.Key("action") - ok.String(string(v.Action)) + if len(v.DetailLevel) > 0 { + ok := object.Key("detailLevel") + ok.String(string(v.DetailLevel)) } - if v.Arns != nil { - ok := object.Key("arns") - if err := awsRestjson1_serializeDocumentFilterArnList(v.Arns, ok); err != nil { + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentListCisScansFilterCriteria(v.FilterCriteria, ok); err != nil { return err } } @@ -2388,17 +2805,27 @@ func awsRestjson1_serializeOpDocumentListFiltersInput(v *ListFiltersInput, value ok.String(*v.NextToken) } + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + return nil } -type awsRestjson1_serializeOpListFindingAggregations struct { +type awsRestjson1_serializeOpListCoverage struct { } -func (*awsRestjson1_serializeOpListFindingAggregations) ID() string { +func (*awsRestjson1_serializeOpListCoverage) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListFindingAggregations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListCoverage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2406,13 +2833,13 @@ func (m *awsRestjson1_serializeOpListFindingAggregations) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListFindingAggregationsInput) + input, ok := in.Parameters.(*ListCoverageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/findings/aggregation/list") + opPath, opQuery := httpbinding.SplitURI("/coverage/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2431,7 +2858,7 @@ func (m *awsRestjson1_serializeOpListFindingAggregations) HandleSerialize(ctx co restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListFindingAggregationsInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListCoverageInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2446,7 +2873,7 @@ func (m *awsRestjson1_serializeOpListFindingAggregations) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListFindingAggregationsInput(v *ListFindingAggregationsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCoverageInput(v *ListCoverageInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2454,29 +2881,17 @@ func awsRestjson1_serializeOpHttpBindingsListFindingAggregationsInput(v *ListFin return nil } -func awsRestjson1_serializeOpDocumentListFindingAggregationsInput(v *ListFindingAggregationsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListCoverageInput(v *ListCoverageInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AccountIds != nil { - ok := object.Key("accountIds") - if err := awsRestjson1_serializeDocumentStringFilterList(v.AccountIds, ok); err != nil { - return err - } - } - - if v.AggregationRequest != nil { - ok := object.Key("aggregationRequest") - if err := awsRestjson1_serializeDocumentAggregationRequest(v.AggregationRequest, ok); err != nil { + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentCoverageFilterCriteria(v.FilterCriteria, ok); err != nil { return err } } - if len(v.AggregationType) > 0 { - ok := object.Key("aggregationType") - ok.String(string(v.AggregationType)) - } - if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) @@ -2490,14 +2905,14 @@ func awsRestjson1_serializeOpDocumentListFindingAggregationsInput(v *ListFinding return nil } -type awsRestjson1_serializeOpListFindings struct { +type awsRestjson1_serializeOpListCoverageStatistics struct { } -func (*awsRestjson1_serializeOpListFindings) ID() string { +func (*awsRestjson1_serializeOpListCoverageStatistics) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListFindings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListCoverageStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2505,13 +2920,13 @@ func (m *awsRestjson1_serializeOpListFindings) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListFindingsInput) + input, ok := in.Parameters.(*ListCoverageStatisticsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/findings/list") + opPath, opQuery := httpbinding.SplitURI("/coverage/statistics/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2530,7 +2945,7 @@ func (m *awsRestjson1_serializeOpListFindings) HandleSerialize(ctx context.Conte restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListFindingsInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListCoverageStatisticsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2545,7 +2960,7 @@ func (m *awsRestjson1_serializeOpListFindings) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListFindingsInput(v *ListFindingsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCoverageStatisticsInput(v *ListCoverageStatisticsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2553,20 +2968,20 @@ func awsRestjson1_serializeOpHttpBindingsListFindingsInput(v *ListFindingsInput, return nil } -func awsRestjson1_serializeOpDocumentListFindingsInput(v *ListFindingsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListCoverageStatisticsInput(v *ListCoverageStatisticsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FilterCriteria != nil { ok := object.Key("filterCriteria") - if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil { + if err := awsRestjson1_serializeDocumentCoverageFilterCriteria(v.FilterCriteria, ok); err != nil { return err } } - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) + if len(v.GroupBy) > 0 { + ok := object.Key("groupBy") + ok.String(string(v.GroupBy)) } if v.NextToken != nil { @@ -2574,24 +2989,17 @@ func awsRestjson1_serializeOpDocumentListFindingsInput(v *ListFindingsInput, val ok.String(*v.NextToken) } - if v.SortCriteria != nil { - ok := object.Key("sortCriteria") - if err := awsRestjson1_serializeDocumentSortCriteria(v.SortCriteria, ok); err != nil { - return err - } - } - return nil } -type awsRestjson1_serializeOpListMembers struct { +type awsRestjson1_serializeOpListDelegatedAdminAccounts struct { } -func (*awsRestjson1_serializeOpListMembers) ID() string { +func (*awsRestjson1_serializeOpListDelegatedAdminAccounts) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListMembers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListDelegatedAdminAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2599,13 +3007,13 @@ func (m *awsRestjson1_serializeOpListMembers) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMembersInput) + input, ok := in.Parameters.(*ListDelegatedAdminAccountsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/members/list") + opPath, opQuery := httpbinding.SplitURI("/delegatedadminaccounts/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2624,7 +3032,7 @@ func (m *awsRestjson1_serializeOpListMembers) HandleSerialize(ctx context.Contex restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListMembersInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListDelegatedAdminAccountsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2639,7 +3047,7 @@ func (m *awsRestjson1_serializeOpListMembers) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListMembersInput(v *ListMembersInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListDelegatedAdminAccountsInput(v *ListDelegatedAdminAccountsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2647,7 +3055,7 @@ func awsRestjson1_serializeOpHttpBindingsListMembersInput(v *ListMembersInput, e return nil } -func awsRestjson1_serializeOpDocumentListMembersInput(v *ListMembersInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListDelegatedAdminAccountsInput(v *ListDelegatedAdminAccountsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2661,22 +3069,17 @@ func awsRestjson1_serializeOpDocumentListMembersInput(v *ListMembersInput, value ok.String(*v.NextToken) } - if v.OnlyAssociated != nil { - ok := object.Key("onlyAssociated") - ok.Boolean(*v.OnlyAssociated) - } - return nil } -type awsRestjson1_serializeOpListTagsForResource struct { +type awsRestjson1_serializeOpListFilters struct { } -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { +func (*awsRestjson1_serializeOpListFilters) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2684,16 +3087,16 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsForResourceInput) + input, ok := in.Parameters.(*ListFiltersInput) _ = 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("/filters/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2706,7 +3109,14 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListFiltersInput(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} } @@ -2717,31 +3127,51 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListFiltersInput(v *ListFiltersInput, 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")} + return nil +} + +func awsRestjson1_serializeOpDocumentListFiltersInput(v *ListFiltersInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Action) > 0 { + ok := object.Key("action") + ok.String(string(v.Action)) } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + + if v.Arns != nil { + ok := object.Key("arns") + if err := awsRestjson1_serializeDocumentFilterArnList(v.Arns, ok); err != nil { return err } } + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + return nil } -type awsRestjson1_serializeOpListUsageTotals struct { +type awsRestjson1_serializeOpListFindingAggregations struct { } -func (*awsRestjson1_serializeOpListUsageTotals) ID() string { +func (*awsRestjson1_serializeOpListFindingAggregations) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListUsageTotals) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListFindingAggregations) 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 +3179,13 @@ func (m *awsRestjson1_serializeOpListUsageTotals) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListUsageTotalsInput) + input, ok := in.Parameters.(*ListFindingAggregationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/usage/list") + opPath, opQuery := httpbinding.SplitURI("/findings/aggregation/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2774,7 +3204,7 @@ func (m *awsRestjson1_serializeOpListUsageTotals) HandleSerialize(ctx context.Co restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListUsageTotalsInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListFindingAggregationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2789,7 +3219,7 @@ func (m *awsRestjson1_serializeOpListUsageTotals) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListUsageTotalsInput(v *ListUsageTotalsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListFindingAggregationsInput(v *ListFindingAggregationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2797,17 +3227,29 @@ func awsRestjson1_serializeOpHttpBindingsListUsageTotalsInput(v *ListUsageTotals return nil } -func awsRestjson1_serializeOpDocumentListUsageTotalsInput(v *ListUsageTotalsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListFindingAggregationsInput(v *ListFindingAggregationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountIds != nil { ok := object.Key("accountIds") - if err := awsRestjson1_serializeDocumentUsageAccountIdList(v.AccountIds, ok); err != nil { + if err := awsRestjson1_serializeDocumentStringFilterList(v.AccountIds, ok); err != nil { + return err + } + } + + if v.AggregationRequest != nil { + ok := object.Key("aggregationRequest") + if err := awsRestjson1_serializeDocumentAggregationRequest(v.AggregationRequest, ok); err != nil { return err } } + if len(v.AggregationType) > 0 { + ok := object.Key("aggregationType") + ok.String(string(v.AggregationType)) + } + if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) @@ -2821,14 +3263,14 @@ func awsRestjson1_serializeOpDocumentListUsageTotalsInput(v *ListUsageTotalsInpu return nil } -type awsRestjson1_serializeOpResetEncryptionKey struct { +type awsRestjson1_serializeOpListFindings struct { } -func (*awsRestjson1_serializeOpResetEncryptionKey) ID() string { +func (*awsRestjson1_serializeOpListFindings) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpResetEncryptionKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListFindings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2836,16 +3278,16 @@ func (m *awsRestjson1_serializeOpResetEncryptionKey) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ResetEncryptionKeyInput) + input, ok := in.Parameters.(*ListFindingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/encryptionkey/reset") + opPath, opQuery := httpbinding.SplitURI("/findings/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2861,7 +3303,7 @@ func (m *awsRestjson1_serializeOpResetEncryptionKey) HandleSerialize(ctx context restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentResetEncryptionKeyInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListFindingsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2876,7 +3318,7 @@ func (m *awsRestjson1_serializeOpResetEncryptionKey) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsResetEncryptionKeyInput(v *ResetEncryptionKeyInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListFindingsInput(v *ListFindingsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2884,31 +3326,45 @@ func awsRestjson1_serializeOpHttpBindingsResetEncryptionKeyInput(v *ResetEncrypt return nil } -func awsRestjson1_serializeOpDocumentResetEncryptionKeyInput(v *ResetEncryptionKeyInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListFindingsInput(v *ListFindingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.ResourceType) > 0 { - ok := object.Key("resourceType") - ok.String(string(v.ResourceType)) + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } } - if len(v.ScanType) > 0 { - ok := object.Key("scanType") - ok.String(string(v.ScanType)) + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.SortCriteria != nil { + ok := object.Key("sortCriteria") + if err := awsRestjson1_serializeDocumentSortCriteria(v.SortCriteria, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpSearchVulnerabilities struct { +type awsRestjson1_serializeOpListMembers struct { } -func (*awsRestjson1_serializeOpSearchVulnerabilities) ID() string { +func (*awsRestjson1_serializeOpListMembers) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpSearchVulnerabilities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListMembers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2916,13 +3372,13 @@ func (m *awsRestjson1_serializeOpSearchVulnerabilities) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*SearchVulnerabilitiesInput) + input, ok := in.Parameters.(*ListMembersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/vulnerabilities/search") + opPath, opQuery := httpbinding.SplitURI("/members/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2941,7 +3397,7 @@ func (m *awsRestjson1_serializeOpSearchVulnerabilities) HandleSerialize(ctx cont restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentSearchVulnerabilitiesInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListMembersInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2956,7 +3412,7 @@ func (m *awsRestjson1_serializeOpSearchVulnerabilities) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsSearchVulnerabilitiesInput(v *SearchVulnerabilitiesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListMembersInput(v *ListMembersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2964,15 +3420,13 @@ func awsRestjson1_serializeOpHttpBindingsSearchVulnerabilitiesInput(v *SearchVul return nil } -func awsRestjson1_serializeOpDocumentSearchVulnerabilitiesInput(v *SearchVulnerabilitiesInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListMembersInput(v *ListMembersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.FilterCriteria != nil { - ok := object.Key("filterCriteria") - if err := awsRestjson1_serializeDocumentSearchVulnerabilitiesFilterCriteria(v.FilterCriteria, ok); err != nil { - return err - } + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -2980,17 +3434,22 @@ func awsRestjson1_serializeOpDocumentSearchVulnerabilitiesInput(v *SearchVulnera ok.String(*v.NextToken) } + if v.OnlyAssociated != nil { + ok := object.Key("onlyAssociated") + ok.Boolean(*v.OnlyAssociated) + } + return nil } -type awsRestjson1_serializeOpTagResource struct { +type awsRestjson1_serializeOpListTagsForResource struct { } -func (*awsRestjson1_serializeOpTagResource) ID() string { +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -2998,7 +3457,7 @@ 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.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3007,7 +3466,7 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex 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" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3020,18 +3479,7 @@ 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 { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3042,7 +3490,7 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3059,28 +3507,14 @@ func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, e 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 { +type awsRestjson1_serializeOpListUsageTotals struct { } -func (*awsRestjson1_serializeOpUntagResource) ID() string { +func (*awsRestjson1_serializeOpListUsageTotals) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListUsageTotals) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3088,16 +3522,16 @@ 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.(*ListUsageTotalsInput) _ = 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("/usage/list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3110,7 +3544,14 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont 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_serializeOpDocumentListUsageTotalsInput(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} } @@ -3121,37 +3562,46 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListUsageTotalsInput(v *ListUsageTotalsInput, 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 +} + +func awsRestjson1_serializeOpDocumentListUsageTotalsInput(v *ListUsageTotalsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("accountIds") + if err := awsRestjson1_serializeDocumentUsageAccountIdList(v.AccountIds, ok); err != nil { + return err } } + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + return nil } -type awsRestjson1_serializeOpUpdateConfiguration struct { +type awsRestjson1_serializeOpResetEncryptionKey struct { } -func (*awsRestjson1_serializeOpUpdateConfiguration) ID() string { +func (*awsRestjson1_serializeOpResetEncryptionKey) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpResetEncryptionKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3159,16 +3609,16 @@ func (m *awsRestjson1_serializeOpUpdateConfiguration) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateConfigurationInput) + input, ok := in.Parameters.(*ResetEncryptionKeyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/configuration/update") + opPath, opQuery := httpbinding.SplitURI("/encryptionkey/reset") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3184,7 +3634,7 @@ func (m *awsRestjson1_serializeOpUpdateConfiguration) HandleSerialize(ctx contex restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateConfigurationInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentResetEncryptionKeyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3199,7 +3649,7 @@ func (m *awsRestjson1_serializeOpUpdateConfiguration) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateConfigurationInput(v *UpdateConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsResetEncryptionKeyInput(v *ResetEncryptionKeyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3207,28 +3657,31 @@ func awsRestjson1_serializeOpHttpBindingsUpdateConfigurationInput(v *UpdateConfi return nil } -func awsRestjson1_serializeOpDocumentUpdateConfigurationInput(v *UpdateConfigurationInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentResetEncryptionKeyInput(v *ResetEncryptionKeyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.EcrConfiguration != nil { - ok := object.Key("ecrConfiguration") - if err := awsRestjson1_serializeDocumentEcrConfiguration(v.EcrConfiguration, ok); err != nil { - return err - } + if len(v.ResourceType) > 0 { + ok := object.Key("resourceType") + ok.String(string(v.ResourceType)) + } + + if len(v.ScanType) > 0 { + ok := object.Key("scanType") + ok.String(string(v.ScanType)) } return nil } -type awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration struct { +type awsRestjson1_serializeOpSearchVulnerabilities struct { } -func (*awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration) ID() string { +func (*awsRestjson1_serializeOpSearchVulnerabilities) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpSearchVulnerabilities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3236,13 +3689,13 @@ func (m *awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration) HandleSer return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateEc2DeepInspectionConfigurationInput) + input, ok := in.Parameters.(*SearchVulnerabilitiesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/ec2deepinspectionconfiguration/update") + opPath, opQuery := httpbinding.SplitURI("/vulnerabilities/search") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -3261,7 +3714,7 @@ func (m *awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration) HandleSer restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateEc2DeepInspectionConfigurationInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentSearchVulnerabilitiesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3276,7 +3729,7 @@ func (m *awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration) HandleSer return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateEc2DeepInspectionConfigurationInput(v *UpdateEc2DeepInspectionConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsSearchVulnerabilitiesInput(v *SearchVulnerabilitiesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3284,33 +3737,33 @@ func awsRestjson1_serializeOpHttpBindingsUpdateEc2DeepInspectionConfigurationInp return nil } -func awsRestjson1_serializeOpDocumentUpdateEc2DeepInspectionConfigurationInput(v *UpdateEc2DeepInspectionConfigurationInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentSearchVulnerabilitiesInput(v *SearchVulnerabilitiesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ActivateDeepInspection != nil { - ok := object.Key("activateDeepInspection") - ok.Boolean(*v.ActivateDeepInspection) - } - - if v.PackagePaths != nil { - ok := object.Key("packagePaths") - if err := awsRestjson1_serializeDocumentPathList(v.PackagePaths, ok); err != nil { + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentSearchVulnerabilitiesFilterCriteria(v.FilterCriteria, ok); err != nil { return err } } + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + return nil } -type awsRestjson1_serializeOpUpdateEncryptionKey struct { +type awsRestjson1_serializeOpSendCisSessionHealth struct { } -func (*awsRestjson1_serializeOpUpdateEncryptionKey) ID() string { +func (*awsRestjson1_serializeOpSendCisSessionHealth) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateEncryptionKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpSendCisSessionHealth) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3318,13 +3771,13 @@ func (m *awsRestjson1_serializeOpUpdateEncryptionKey) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateEncryptionKeyInput) + input, ok := in.Parameters.(*SendCisSessionHealthInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/encryptionkey/update") + opPath, opQuery := httpbinding.SplitURI("/cissession/health/send") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" @@ -3343,7 +3796,7 @@ func (m *awsRestjson1_serializeOpUpdateEncryptionKey) HandleSerialize(ctx contex restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateEncryptionKeyInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentSendCisSessionHealthInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3358,7 +3811,7 @@ func (m *awsRestjson1_serializeOpUpdateEncryptionKey) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateEncryptionKeyInput(v *UpdateEncryptionKeyInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsSendCisSessionHealthInput(v *SendCisSessionHealthInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3366,36 +3819,31 @@ func awsRestjson1_serializeOpHttpBindingsUpdateEncryptionKeyInput(v *UpdateEncry return nil } -func awsRestjson1_serializeOpDocumentUpdateEncryptionKeyInput(v *UpdateEncryptionKeyInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentSendCisSessionHealthInput(v *SendCisSessionHealthInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.KmsKeyId != nil { - ok := object.Key("kmsKeyId") - ok.String(*v.KmsKeyId) - } - - if len(v.ResourceType) > 0 { - ok := object.Key("resourceType") - ok.String(string(v.ResourceType)) + if v.ScanJobId != nil { + ok := object.Key("scanJobId") + ok.String(*v.ScanJobId) } - if len(v.ScanType) > 0 { - ok := object.Key("scanType") - ok.String(string(v.ScanType)) + if v.SessionToken != nil { + ok := object.Key("sessionToken") + ok.String(*v.SessionToken) } return nil } -type awsRestjson1_serializeOpUpdateFilter struct { +type awsRestjson1_serializeOpSendCisSessionTelemetry struct { } -func (*awsRestjson1_serializeOpUpdateFilter) ID() string { +func (*awsRestjson1_serializeOpSendCisSessionTelemetry) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpSendCisSessionTelemetry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3403,16 +3851,16 @@ func (m *awsRestjson1_serializeOpUpdateFilter) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateFilterInput) + input, ok := in.Parameters.(*SendCisSessionTelemetryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/filters/update") + opPath, opQuery := httpbinding.SplitURI("/cissession/telemetry/send") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3428,7 +3876,7 @@ func (m *awsRestjson1_serializeOpUpdateFilter) HandleSerialize(ctx context.Conte restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateFilterInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentSendCisSessionTelemetryInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3443,7 +3891,7 @@ func (m *awsRestjson1_serializeOpUpdateFilter) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateFilterInput(v *UpdateFilterInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsSendCisSessionTelemetryInput(v *SendCisSessionTelemetryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3451,53 +3899,38 @@ func awsRestjson1_serializeOpHttpBindingsUpdateFilterInput(v *UpdateFilterInput, return nil } -func awsRestjson1_serializeOpDocumentUpdateFilterInput(v *UpdateFilterInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentSendCisSessionTelemetryInput(v *SendCisSessionTelemetryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.Action) > 0 { - ok := object.Key("action") - ok.String(string(v.Action)) - } - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } - - if v.FilterArn != nil { - ok := object.Key("filterArn") - ok.String(*v.FilterArn) - } - - if v.FilterCriteria != nil { - ok := object.Key("filterCriteria") - if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil { + if v.Messages != nil { + ok := object.Key("messages") + if err := awsRestjson1_serializeDocumentCisSessionMessages(v.Messages, ok); err != nil { return err } } - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) + if v.ScanJobId != nil { + ok := object.Key("scanJobId") + ok.String(*v.ScanJobId) } - if v.Reason != nil { - ok := object.Key("reason") - ok.String(*v.Reason) + if v.SessionToken != nil { + ok := object.Key("sessionToken") + ok.String(*v.SessionToken) } return nil } -type awsRestjson1_serializeOpUpdateOrganizationConfiguration struct { +type awsRestjson1_serializeOpStartCisSession struct { } -func (*awsRestjson1_serializeOpUpdateOrganizationConfiguration) ID() string { +func (*awsRestjson1_serializeOpStartCisSession) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateOrganizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpStartCisSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3505,16 +3938,16 @@ func (m *awsRestjson1_serializeOpUpdateOrganizationConfiguration) HandleSerializ return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateOrganizationConfigurationInput) + input, ok := in.Parameters.(*StartCisSessionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/organizationconfiguration/update") + opPath, opQuery := httpbinding.SplitURI("/cissession/start") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3530,7 +3963,7 @@ func (m *awsRestjson1_serializeOpUpdateOrganizationConfiguration) HandleSerializ restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateOrganizationConfigurationInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentStartCisSessionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3545,7 +3978,7 @@ func (m *awsRestjson1_serializeOpUpdateOrganizationConfiguration) HandleSerializ return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsStartCisSessionInput(v *StartCisSessionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3553,28 +3986,33 @@ func awsRestjson1_serializeOpHttpBindingsUpdateOrganizationConfigurationInput(v return nil } -func awsRestjson1_serializeOpDocumentUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigurationInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentStartCisSessionInput(v *StartCisSessionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AutoEnable != nil { - ok := object.Key("autoEnable") - if err := awsRestjson1_serializeDocumentAutoEnable(v.AutoEnable, ok); err != nil { + if v.Message != nil { + ok := object.Key("message") + if err := awsRestjson1_serializeDocumentStartCisSessionMessage(v.Message, ok); err != nil { return err } } + if v.ScanJobId != nil { + ok := object.Key("scanJobId") + ok.String(*v.ScanJobId) + } + return nil } -type awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration struct { +type awsRestjson1_serializeOpStopCisSession struct { } -func (*awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration) ID() string { +func (*awsRestjson1_serializeOpStopCisSession) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpStopCisSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3582,16 +4020,16 @@ func (m *awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration) Handle return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateOrgEc2DeepInspectionConfigurationInput) + input, ok := in.Parameters.(*StopCisSessionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/ec2deepinspectionconfiguration/org/update") + opPath, opQuery := httpbinding.SplitURI("/cissession/stop") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3607,7 +4045,7 @@ func (m *awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration) Handle restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateOrgEc2DeepInspectionConfigurationInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentStopCisSessionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3622,7 +4060,7 @@ func (m *awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration) Handle return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateOrgEc2DeepInspectionConfigurationInput(v *UpdateOrgEc2DeepInspectionConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsStopCisSessionInput(v *StopCisSessionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3630,234 +4068,1555 @@ func awsRestjson1_serializeOpHttpBindingsUpdateOrgEc2DeepInspectionConfiguration return nil } -func awsRestjson1_serializeOpDocumentUpdateOrgEc2DeepInspectionConfigurationInput(v *UpdateOrgEc2DeepInspectionConfigurationInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentStopCisSessionInput(v *StopCisSessionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.OrgPackagePaths != nil { - ok := object.Key("orgPackagePaths") - if err := awsRestjson1_serializeDocumentPathList(v.OrgPackagePaths, ok); err != nil { + if v.Message != nil { + ok := object.Key("message") + if err := awsRestjson1_serializeDocumentStopCisSessionMessage(v.Message, ok); err != nil { return err } } + if v.ScanJobId != nil { + ok := object.Key("scanJobId") + ok.String(*v.ScanJobId) + } + + if v.SessionToken != nil { + ok := object.Key("sessionToken") + ok.String(*v.SessionToken) + } + return nil } -func awsRestjson1_serializeDocumentAccountAggregation(v *types.AccountAggregation, value smithyjson.Value) error { - object := value.Object() - defer object.Close() +type awsRestjson1_serializeOpTagResource struct { +} - if len(v.FindingType) > 0 { - ok := object.Key("findingType") - ok.String(string(v.FindingType)) +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)} } - if len(v.ResourceType) > 0 { - ok := object.Key("resourceType") - ok.String(string(v.ResourceType)) + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - if len(v.SortBy) > 0 { - ok := object.Key("sortBy") - ok.String(string(v.SortBy)) + 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" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } - if len(v.SortOrder) > 0 { - ok := object.Key("sortOrder") - ok.String(string(v.SortOrder)) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} } - return nil -} + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } -func awsRestjson1_serializeDocumentAccountIdSet(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() + restEncoder.SetHeader("Content-Type").String("application/json") - for i := range v { - av := array.Value() - av.String(v[i]) + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} } - return nil -} -func awsRestjson1_serializeDocumentAggregationRequest(v types.AggregationRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - switch uv := v.(type) { - case *types.AggregationRequestMemberAccountAggregation: - av := object.Key("accountAggregation") - if err := awsRestjson1_serializeDocumentAccountAggregation(&uv.Value, av); err != nil { - return err - } + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } - case *types.AggregationRequestMemberAmiAggregation: - av := object.Key("amiAggregation") - if err := awsRestjson1_serializeDocumentAmiAggregation(&uv.Value, av); err != nil { - return err - } + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request - case *types.AggregationRequestMemberAwsEcrContainerAggregation: - av := object.Key("awsEcrContainerAggregation") + 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" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_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_serializeOpUpdateCisScanConfiguration struct { +} + +func (*awsRestjson1_serializeOpUpdateCisScanConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCisScanConfiguration) 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.(*UpdateCisScanConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/cis/scan-configuration/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCisScanConfigurationInput(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_serializeOpHttpBindingsUpdateCisScanConfigurationInput(v *UpdateCisScanConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCisScanConfigurationInput(v *UpdateCisScanConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ScanConfigurationArn != nil { + ok := object.Key("scanConfigurationArn") + ok.String(*v.ScanConfigurationArn) + } + + if v.ScanName != nil { + ok := object.Key("scanName") + ok.String(*v.ScanName) + } + + if v.Schedule != nil { + ok := object.Key("schedule") + if err := awsRestjson1_serializeDocumentSchedule(v.Schedule, ok); err != nil { + return err + } + } + + if len(v.SecurityLevel) > 0 { + ok := object.Key("securityLevel") + ok.String(string(v.SecurityLevel)) + } + + if v.Targets != nil { + ok := object.Key("targets") + if err := awsRestjson1_serializeDocumentUpdateCisTargets(v.Targets, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateConfiguration struct { +} + +func (*awsRestjson1_serializeOpUpdateConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateConfiguration) 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.(*UpdateConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/configuration/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateConfigurationInput(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_serializeOpHttpBindingsUpdateConfigurationInput(v *UpdateConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateConfigurationInput(v *UpdateConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EcrConfiguration != nil { + ok := object.Key("ecrConfiguration") + if err := awsRestjson1_serializeDocumentEcrConfiguration(v.EcrConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration struct { +} + +func (*awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateEc2DeepInspectionConfiguration) 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.(*UpdateEc2DeepInspectionConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ec2deepinspectionconfiguration/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateEc2DeepInspectionConfigurationInput(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_serializeOpHttpBindingsUpdateEc2DeepInspectionConfigurationInput(v *UpdateEc2DeepInspectionConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateEc2DeepInspectionConfigurationInput(v *UpdateEc2DeepInspectionConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActivateDeepInspection != nil { + ok := object.Key("activateDeepInspection") + ok.Boolean(*v.ActivateDeepInspection) + } + + if v.PackagePaths != nil { + ok := object.Key("packagePaths") + if err := awsRestjson1_serializeDocumentPathList(v.PackagePaths, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateEncryptionKey struct { +} + +func (*awsRestjson1_serializeOpUpdateEncryptionKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateEncryptionKey) 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.(*UpdateEncryptionKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/encryptionkey/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateEncryptionKeyInput(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_serializeOpHttpBindingsUpdateEncryptionKeyInput(v *UpdateEncryptionKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateEncryptionKeyInput(v *UpdateEncryptionKeyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + + if len(v.ResourceType) > 0 { + ok := object.Key("resourceType") + ok.String(string(v.ResourceType)) + } + + if len(v.ScanType) > 0 { + ok := object.Key("scanType") + ok.String(string(v.ScanType)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateFilter struct { +} + +func (*awsRestjson1_serializeOpUpdateFilter) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateFilter) 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.(*UpdateFilterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/filters/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateFilterInput(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_serializeOpHttpBindingsUpdateFilterInput(v *UpdateFilterInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateFilterInput(v *UpdateFilterInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Action) > 0 { + ok := object.Key("action") + ok.String(string(v.Action)) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.FilterArn != nil { + ok := object.Key("filterArn") + ok.String(*v.FilterArn) + } + + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Reason != nil { + ok := object.Key("reason") + ok.String(*v.Reason) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateOrganizationConfiguration struct { +} + +func (*awsRestjson1_serializeOpUpdateOrganizationConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateOrganizationConfiguration) 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.(*UpdateOrganizationConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/organizationconfiguration/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateOrganizationConfigurationInput(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_serializeOpHttpBindingsUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutoEnable != nil { + ok := object.Key("autoEnable") + if err := awsRestjson1_serializeDocumentAutoEnable(v.AutoEnable, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration struct { +} + +func (*awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateOrgEc2DeepInspectionConfiguration) 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.(*UpdateOrgEc2DeepInspectionConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ec2deepinspectionconfiguration/org/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateOrgEc2DeepInspectionConfigurationInput(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_serializeOpHttpBindingsUpdateOrgEc2DeepInspectionConfigurationInput(v *UpdateOrgEc2DeepInspectionConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateOrgEc2DeepInspectionConfigurationInput(v *UpdateOrgEc2DeepInspectionConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OrgPackagePaths != nil { + ok := object.Key("orgPackagePaths") + if err := awsRestjson1_serializeDocumentPathList(v.OrgPackagePaths, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAccountAggregation(v *types.AccountAggregation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.FindingType) > 0 { + ok := object.Key("findingType") + ok.String(string(v.FindingType)) + } + + if len(v.ResourceType) > 0 { + ok := object.Key("resourceType") + ok.String(string(v.ResourceType)) + } + + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + + return nil +} + +func awsRestjson1_serializeDocumentAccountIdFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAccountIdSet(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_serializeDocumentAggregationRequest(v types.AggregationRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.AggregationRequestMemberAccountAggregation: + av := object.Key("accountAggregation") + if err := awsRestjson1_serializeDocumentAccountAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberAmiAggregation: + av := object.Key("amiAggregation") + if err := awsRestjson1_serializeDocumentAmiAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberAwsEcrContainerAggregation: + av := object.Key("awsEcrContainerAggregation") if err := awsRestjson1_serializeDocumentAwsEcrContainerAggregation(&uv.Value, av); err != nil { return err } - case *types.AggregationRequestMemberEc2InstanceAggregation: - av := object.Key("ec2InstanceAggregation") - if err := awsRestjson1_serializeDocumentEc2InstanceAggregation(&uv.Value, av); err != nil { + case *types.AggregationRequestMemberEc2InstanceAggregation: + av := object.Key("ec2InstanceAggregation") + if err := awsRestjson1_serializeDocumentEc2InstanceAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberFindingTypeAggregation: + av := object.Key("findingTypeAggregation") + if err := awsRestjson1_serializeDocumentFindingTypeAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberImageLayerAggregation: + av := object.Key("imageLayerAggregation") + if err := awsRestjson1_serializeDocumentImageLayerAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberLambdaFunctionAggregation: + av := object.Key("lambdaFunctionAggregation") + if err := awsRestjson1_serializeDocumentLambdaFunctionAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberLambdaLayerAggregation: + av := object.Key("lambdaLayerAggregation") + if err := awsRestjson1_serializeDocumentLambdaLayerAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberPackageAggregation: + av := object.Key("packageAggregation") + if err := awsRestjson1_serializeDocumentPackageAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberRepositoryAggregation: + av := object.Key("repositoryAggregation") + if err := awsRestjson1_serializeDocumentRepositoryAggregation(&uv.Value, av); err != nil { + return err + } + + case *types.AggregationRequestMemberTitleAggregation: + av := object.Key("titleAggregation") + if err := awsRestjson1_serializeDocumentTitleAggregation(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentAmiAggregation(v *types.AmiAggregation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Amis != nil { + ok := object.Key("amis") + if err := awsRestjson1_serializeDocumentStringFilterList(v.Amis, ok); err != nil { + return err + } + } + + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + + return nil +} + +func awsRestjson1_serializeDocumentAutoEnable(v *types.AutoEnable, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Ec2 != nil { + ok := object.Key("ec2") + ok.Boolean(*v.Ec2) + } + + if v.Ecr != nil { + ok := object.Key("ecr") + ok.Boolean(*v.Ecr) + } + + if v.Lambda != nil { + ok := object.Key("lambda") + ok.Boolean(*v.Lambda) + } + + if v.LambdaCode != nil { + ok := object.Key("lambdaCode") + ok.Boolean(*v.LambdaCode) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEcrContainerAggregation(v *types.AwsEcrContainerAggregation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Architectures != nil { + ok := object.Key("architectures") + if err := awsRestjson1_serializeDocumentStringFilterList(v.Architectures, ok); err != nil { + return err + } + } + + if v.ImageShas != nil { + ok := object.Key("imageShas") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ImageShas, ok); err != nil { + return err + } + } + + if v.ImageTags != nil { + ok := object.Key("imageTags") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ImageTags, ok); err != nil { + return err + } + } + + if v.Repositories != nil { + ok := object.Key("repositories") + if err := awsRestjson1_serializeDocumentStringFilterList(v.Repositories, ok); err != nil { + return err + } + } + + if v.ResourceIds != nil { + ok := object.Key("resourceIds") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ResourceIds, ok); err != nil { + return err + } + } + + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCheckIdFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCisDateFilter(v *types.CisDateFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EarliestScanStartTime != nil { + ok := object.Key("earliestScanStartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.EarliestScanStartTime)) + } + + if v.LatestScanStartTime != nil { + ok := object.Key("latestScanStartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.LatestScanStartTime)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCisFindingArnFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCisFindingStatusFilter(v *types.CisFindingStatusFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Comparison) > 0 { + ok := object.Key("comparison") + ok.String(string(v.Comparison)) + } + + if len(v.Value) > 0 { + ok := object.Key("value") + ok.String(string(v.Value)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCisFindingStatusFilterList(v []types.CisFindingStatusFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisFindingStatusFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCisNumberFilter(v *types.CisNumberFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LowerInclusive != nil { + ok := object.Key("lowerInclusive") + ok.Integer(*v.LowerInclusive) + } + + if v.UpperInclusive != nil { + ok := object.Key("upperInclusive") + ok.Integer(*v.UpperInclusive) + } + + return nil +} + +func awsRestjson1_serializeDocumentCisNumberFilterList(v []types.CisNumberFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisNumberFilter(&v[i], av); err != nil { return err } + } + return nil +} - case *types.AggregationRequestMemberFindingTypeAggregation: - av := object.Key("findingTypeAggregation") - if err := awsRestjson1_serializeDocumentFindingTypeAggregation(&uv.Value, av); err != nil { +func awsRestjson1_serializeDocumentCisResultStatusFilter(v *types.CisResultStatusFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Comparison) > 0 { + ok := object.Key("comparison") + ok.String(string(v.Comparison)) + } + + if len(v.Value) > 0 { + ok := object.Key("value") + ok.String(string(v.Value)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCisResultStatusFilterList(v []types.CisResultStatusFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisResultStatusFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCisScanArnFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { return err } + } + return nil +} - case *types.AggregationRequestMemberImageLayerAggregation: - av := object.Key("imageLayerAggregation") - if err := awsRestjson1_serializeDocumentImageLayerAggregation(&uv.Value, av); err != nil { +func awsRestjson1_serializeDocumentCisScanConfigurationArnFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { return err } + } + return nil +} - case *types.AggregationRequestMemberLambdaFunctionAggregation: - av := object.Key("lambdaFunctionAggregation") - if err := awsRestjson1_serializeDocumentLambdaFunctionAggregation(&uv.Value, av); err != nil { +func awsRestjson1_serializeDocumentCisScanDateFilterList(v []types.CisDateFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisDateFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCisScanNameFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCisScanResultDetailsFilterCriteria(v *types.CisScanResultDetailsFilterCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CheckIdFilters != nil { + ok := object.Key("checkIdFilters") + if err := awsRestjson1_serializeDocumentCheckIdFilterList(v.CheckIdFilters, ok); err != nil { + return err + } + } + + if v.FindingArnFilters != nil { + ok := object.Key("findingArnFilters") + if err := awsRestjson1_serializeDocumentCisFindingArnFilterList(v.FindingArnFilters, ok); err != nil { + return err + } + } + + if v.FindingStatusFilters != nil { + ok := object.Key("findingStatusFilters") + if err := awsRestjson1_serializeDocumentCisFindingStatusFilterList(v.FindingStatusFilters, ok); err != nil { + return err + } + } + + if v.SecurityLevelFilters != nil { + ok := object.Key("securityLevelFilters") + if err := awsRestjson1_serializeDocumentCisSecurityLevelFilterList(v.SecurityLevelFilters, ok); err != nil { return err } + } + + if v.TitleFilters != nil { + ok := object.Key("titleFilters") + if err := awsRestjson1_serializeDocumentTitleFilterList(v.TitleFilters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCisScanResultsAggregatedByChecksFilterCriteria(v *types.CisScanResultsAggregatedByChecksFilterCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIdFilters != nil { + ok := object.Key("accountIdFilters") + if err := awsRestjson1_serializeDocumentOneAccountIdFilterList(v.AccountIdFilters, ok); err != nil { + return err + } + } + + if v.CheckIdFilters != nil { + ok := object.Key("checkIdFilters") + if err := awsRestjson1_serializeDocumentCheckIdFilterList(v.CheckIdFilters, ok); err != nil { + return err + } + } + + if v.FailedResourcesFilters != nil { + ok := object.Key("failedResourcesFilters") + if err := awsRestjson1_serializeDocumentCisNumberFilterList(v.FailedResourcesFilters, ok); err != nil { + return err + } + } + + if v.PlatformFilters != nil { + ok := object.Key("platformFilters") + if err := awsRestjson1_serializeDocumentPlatformFilterList(v.PlatformFilters, ok); err != nil { + return err + } + } + + if v.SecurityLevelFilters != nil { + ok := object.Key("securityLevelFilters") + if err := awsRestjson1_serializeDocumentCisSecurityLevelFilterList(v.SecurityLevelFilters, ok); err != nil { + return err + } + } + + if v.TitleFilters != nil { + ok := object.Key("titleFilters") + if err := awsRestjson1_serializeDocumentTitleFilterList(v.TitleFilters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCisScanResultsAggregatedByTargetResourceFilterCriteria(v *types.CisScanResultsAggregatedByTargetResourceFilterCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIdFilters != nil { + ok := object.Key("accountIdFilters") + if err := awsRestjson1_serializeDocumentAccountIdFilterList(v.AccountIdFilters, ok); err != nil { + return err + } + } + + if v.CheckIdFilters != nil { + ok := object.Key("checkIdFilters") + if err := awsRestjson1_serializeDocumentCheckIdFilterList(v.CheckIdFilters, ok); err != nil { + return err + } + } + + if v.FailedChecksFilters != nil { + ok := object.Key("failedChecksFilters") + if err := awsRestjson1_serializeDocumentCisNumberFilterList(v.FailedChecksFilters, ok); err != nil { + return err + } + } + + if v.PlatformFilters != nil { + ok := object.Key("platformFilters") + if err := awsRestjson1_serializeDocumentPlatformFilterList(v.PlatformFilters, ok); err != nil { + return err + } + } + + if v.StatusFilters != nil { + ok := object.Key("statusFilters") + if err := awsRestjson1_serializeDocumentCisResultStatusFilterList(v.StatusFilters, ok); err != nil { + return err + } + } + + if v.TargetResourceIdFilters != nil { + ok := object.Key("targetResourceIdFilters") + if err := awsRestjson1_serializeDocumentResourceIdFilterList(v.TargetResourceIdFilters, ok); err != nil { + return err + } + } + + if v.TargetResourceTagFilters != nil { + ok := object.Key("targetResourceTagFilters") + if err := awsRestjson1_serializeDocumentResourceTagFilterList(v.TargetResourceTagFilters, ok); err != nil { + return err + } + } + + if v.TargetStatusFilters != nil { + ok := object.Key("targetStatusFilters") + if err := awsRestjson1_serializeDocumentTargetStatusFilterList(v.TargetStatusFilters, ok); err != nil { + return err + } + } + + if v.TargetStatusReasonFilters != nil { + ok := object.Key("targetStatusReasonFilters") + if err := awsRestjson1_serializeDocumentTargetStatusReasonFilterList(v.TargetStatusReasonFilters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCisScanStatusFilter(v *types.CisScanStatusFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Comparison) > 0 { + ok := object.Key("comparison") + ok.String(string(v.Comparison)) + } + + if len(v.Value) > 0 { + ok := object.Key("value") + ok.String(string(v.Value)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCisScanStatusFilterList(v []types.CisScanStatusFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisScanStatusFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCisScheduledByFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCisSecurityLevelFilter(v *types.CisSecurityLevelFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Comparison) > 0 { + ok := object.Key("comparison") + ok.String(string(v.Comparison)) + } + + if len(v.Value) > 0 { + ok := object.Key("value") + ok.String(string(v.Value)) + } + + return nil +} - case *types.AggregationRequestMemberLambdaLayerAggregation: - av := object.Key("lambdaLayerAggregation") - if err := awsRestjson1_serializeDocumentLambdaLayerAggregation(&uv.Value, av); err != nil { - return err - } +func awsRestjson1_serializeDocumentCisSecurityLevelFilterList(v []types.CisSecurityLevelFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() - case *types.AggregationRequestMemberPackageAggregation: - av := object.Key("packageAggregation") - if err := awsRestjson1_serializeDocumentPackageAggregation(&uv.Value, av); err != nil { + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisSecurityLevelFilter(&v[i], av); err != nil { return err } + } + return nil +} - case *types.AggregationRequestMemberRepositoryAggregation: - av := object.Key("repositoryAggregation") - if err := awsRestjson1_serializeDocumentRepositoryAggregation(&uv.Value, av); err != nil { - return err - } +func awsRestjson1_serializeDocumentCisSessionMessage(v *types.CisSessionMessage, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - case *types.AggregationRequestMemberTitleAggregation: - av := object.Key("titleAggregation") - if err := awsRestjson1_serializeDocumentTitleAggregation(&uv.Value, av); err != nil { - return err - } + if v.CisRuleDetails != nil { + ok := object.Key("cisRuleDetails") + ok.Base64EncodeBytes(v.CisRuleDetails) + } - default: - return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + if v.RuleId != nil { + ok := object.Key("ruleId") + ok.String(*v.RuleId) + } + if len(v.Status) > 0 { + ok := object.Key("status") + ok.String(string(v.Status)) } + return nil } -func awsRestjson1_serializeDocumentAmiAggregation(v *types.AmiAggregation, value smithyjson.Value) error { - object := value.Object() - defer object.Close() +func awsRestjson1_serializeDocumentCisSessionMessages(v []types.CisSessionMessage, value smithyjson.Value) error { + array := value.Array() + defer array.Close() - if v.Amis != nil { - ok := object.Key("amis") - if err := awsRestjson1_serializeDocumentStringFilterList(v.Amis, ok); err != nil { + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisSessionMessage(&v[i], av); err != nil { return err } } + return nil +} - if len(v.SortBy) > 0 { - ok := object.Key("sortBy") - ok.String(string(v.SortBy)) +func awsRestjson1_serializeDocumentCisStringFilter(v *types.CisStringFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Comparison) > 0 { + ok := object.Key("comparison") + ok.String(string(v.Comparison)) } - if len(v.SortOrder) > 0 { - ok := object.Key("sortOrder") - ok.String(string(v.SortOrder)) + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) } return nil } -func awsRestjson1_serializeDocumentAutoEnable(v *types.AutoEnable, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentCisTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Ec2 != nil { - ok := object.Key("ec2") - ok.Boolean(*v.Ec2) + for key := range v { + om := object.Key(key) + om.String(v[key]) } + return nil +} - if v.Ecr != nil { - ok := object.Key("ecr") - ok.Boolean(*v.Ecr) - } +func awsRestjson1_serializeDocumentCisTargetStatusFilter(v *types.CisTargetStatusFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - if v.Lambda != nil { - ok := object.Key("lambda") - ok.Boolean(*v.Lambda) + if len(v.Comparison) > 0 { + ok := object.Key("comparison") + ok.String(string(v.Comparison)) } - if v.LambdaCode != nil { - ok := object.Key("lambdaCode") - ok.Boolean(*v.LambdaCode) + if len(v.Value) > 0 { + ok := object.Key("value") + ok.String(string(v.Value)) } return nil } -func awsRestjson1_serializeDocumentAwsEcrContainerAggregation(v *types.AwsEcrContainerAggregation, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentCisTargetStatusReasonFilter(v *types.CisTargetStatusReasonFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Architectures != nil { - ok := object.Key("architectures") - if err := awsRestjson1_serializeDocumentStringFilterList(v.Architectures, ok); err != nil { - return err - } + if len(v.Comparison) > 0 { + ok := object.Key("comparison") + ok.String(string(v.Comparison)) } - if v.ImageShas != nil { - ok := object.Key("imageShas") - if err := awsRestjson1_serializeDocumentStringFilterList(v.ImageShas, ok); err != nil { - return err - } + if len(v.Value) > 0 { + ok := object.Key("value") + ok.String(string(v.Value)) } - if v.ImageTags != nil { - ok := object.Key("imageTags") - if err := awsRestjson1_serializeDocumentStringFilterList(v.ImageTags, ok); err != nil { - return err - } - } + return nil +} - if v.Repositories != nil { - ok := object.Key("repositories") - if err := awsRestjson1_serializeDocumentStringFilterList(v.Repositories, ok); err != nil { - return err - } - } +func awsRestjson1_serializeDocumentComputePlatform(v *types.ComputePlatform, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - if v.ResourceIds != nil { - ok := object.Key("resourceIds") - if err := awsRestjson1_serializeDocumentStringFilterList(v.ResourceIds, ok); err != nil { - return err - } + if v.Product != nil { + ok := object.Key("product") + ok.String(*v.Product) } - if len(v.SortBy) > 0 { - ok := object.Key("sortBy") - ok.String(string(v.SortBy)) + if v.Vendor != nil { + ok := object.Key("vendor") + ok.String(*v.Vendor) } - if len(v.SortOrder) > 0 { - ok := object.Key("sortOrder") - ok.String(string(v.SortOrder)) + if v.Version != nil { + ok := object.Key("version") + ok.String(*v.Version) } return nil @@ -4056,6 +5815,41 @@ func awsRestjson1_serializeDocumentCoverageStringFilterList(v []types.CoverageSt return nil } +func awsRestjson1_serializeDocumentCreateCisTargets(v *types.CreateCisTargets, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("accountIds") + if err := awsRestjson1_serializeDocumentTargetAccountList(v.AccountIds, ok); err != nil { + return err + } + } + + if v.TargetResourceTags != nil { + ok := object.Key("targetResourceTags") + if err := awsRestjson1_serializeDocumentTargetResourceTags(v.TargetResourceTags, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentDailySchedule(v *types.DailySchedule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StartTime != nil { + ok := object.Key("startTime") + if err := awsRestjson1_serializeDocumentTime(v.StartTime, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentDateFilter(v *types.DateFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4086,6 +5880,17 @@ func awsRestjson1_serializeDocumentDateFilterList(v []types.DateFilter, value sm return nil } +func awsRestjson1_serializeDocumentDaysList(v []types.Day, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentDestination(v *types.Destination, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4669,6 +6474,111 @@ func awsRestjson1_serializeDocumentLambdaLayerAggregation(v *types.LambdaLayerAg return nil } +func awsRestjson1_serializeDocumentListCisScanConfigurationsFilterCriteria(v *types.ListCisScanConfigurationsFilterCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ScanConfigurationArnFilters != nil { + ok := object.Key("scanConfigurationArnFilters") + if err := awsRestjson1_serializeDocumentCisScanConfigurationArnFilterList(v.ScanConfigurationArnFilters, ok); err != nil { + return err + } + } + + if v.ScanNameFilters != nil { + ok := object.Key("scanNameFilters") + if err := awsRestjson1_serializeDocumentCisScanNameFilterList(v.ScanNameFilters, ok); err != nil { + return err + } + } + + if v.TargetResourceTagFilters != nil { + ok := object.Key("targetResourceTagFilters") + if err := awsRestjson1_serializeDocumentResourceTagFilterList(v.TargetResourceTagFilters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentListCisScansFilterCriteria(v *types.ListCisScansFilterCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FailedChecksFilters != nil { + ok := object.Key("failedChecksFilters") + if err := awsRestjson1_serializeDocumentCisNumberFilterList(v.FailedChecksFilters, ok); err != nil { + return err + } + } + + if v.ScanArnFilters != nil { + ok := object.Key("scanArnFilters") + if err := awsRestjson1_serializeDocumentCisScanArnFilterList(v.ScanArnFilters, ok); err != nil { + return err + } + } + + if v.ScanAtFilters != nil { + ok := object.Key("scanAtFilters") + if err := awsRestjson1_serializeDocumentCisScanDateFilterList(v.ScanAtFilters, ok); err != nil { + return err + } + } + + if v.ScanConfigurationArnFilters != nil { + ok := object.Key("scanConfigurationArnFilters") + if err := awsRestjson1_serializeDocumentCisScanConfigurationArnFilterList(v.ScanConfigurationArnFilters, ok); err != nil { + return err + } + } + + if v.ScanNameFilters != nil { + ok := object.Key("scanNameFilters") + if err := awsRestjson1_serializeDocumentCisScanNameFilterList(v.ScanNameFilters, ok); err != nil { + return err + } + } + + if v.ScanStatusFilters != nil { + ok := object.Key("scanStatusFilters") + if err := awsRestjson1_serializeDocumentCisScanStatusFilterList(v.ScanStatusFilters, ok); err != nil { + return err + } + } + + if v.ScheduledByFilters != nil { + ok := object.Key("scheduledByFilters") + if err := awsRestjson1_serializeDocumentCisScheduledByFilterList(v.ScheduledByFilters, ok); err != nil { + return err + } + } + + if v.TargetAccountIdFilters != nil { + ok := object.Key("targetAccountIdFilters") + if err := awsRestjson1_serializeDocumentAccountIdFilterList(v.TargetAccountIdFilters, ok); err != nil { + return err + } + } + + if v.TargetResourceIdFilters != nil { + ok := object.Key("targetResourceIdFilters") + if err := awsRestjson1_serializeDocumentResourceIdFilterList(v.TargetResourceIdFilters, ok); err != nil { + return err + } + } + + if v.TargetResourceTagFilters != nil { + ok := object.Key("targetResourceTagFilters") + if err := awsRestjson1_serializeDocumentResourceTagFilterList(v.TargetResourceTagFilters, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentMapFilter(v *types.MapFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4745,6 +6655,25 @@ func awsRestjson1_serializeDocumentMeteringAccountIdList(v []string, value smith return nil } +func awsRestjson1_serializeDocumentMonthlySchedule(v *types.MonthlySchedule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Day) > 0 { + ok := object.Key("day") + ok.String(string(v.Day)) + } + + if v.StartTime != nil { + ok := object.Key("startTime") + if err := awsRestjson1_serializeDocumentTime(v.StartTime, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentNumberFilter(v *types.NumberFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4784,23 +6713,43 @@ func awsRestjson1_serializeDocumentNumberFilter(v *types.NumberFilter, value smi } } - + + return nil +} + +func awsRestjson1_serializeDocumentNumberFilterList(v []types.NumberFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentNumberFilter(&v[i], av); err != nil { + return err + } + } return nil } -func awsRestjson1_serializeDocumentNumberFilterList(v []types.NumberFilter, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentOneAccountIdFilterList(v []types.CisStringFilter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() - if err := awsRestjson1_serializeDocumentNumberFilter(&v[i], av); err != nil { + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { return err } } return nil } +func awsRestjson1_serializeDocumentOneTimeSchedule(v *types.OneTimeSchedule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + func awsRestjson1_serializeDocumentPackageAggregation(v *types.PackageAggregation, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4905,6 +6854,19 @@ func awsRestjson1_serializeDocumentPathList(v []string, value smithyjson.Value) return nil } +func awsRestjson1_serializeDocumentPlatformFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentPortRangeFilter(v *types.PortRangeFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4935,6 +6897,17 @@ func awsRestjson1_serializeDocumentPortRangeFilterList(v []types.PortRangeFilter return nil } +func awsRestjson1_serializeDocumentReportTargetAccounts(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_serializeDocumentRepositoryAggregation(v *types.RepositoryAggregation, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5022,6 +6995,19 @@ func awsRestjson1_serializeDocumentResourceFilterCriteria(v *types.ResourceFilte return nil } +func awsRestjson1_serializeDocumentResourceIdFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentResourceMapFilter(v *types.ResourceMapFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5087,6 +7073,55 @@ func awsRestjson1_serializeDocumentResourceStringFilterList(v []types.ResourceSt return nil } +func awsRestjson1_serializeDocumentResourceTagFilterList(v []types.TagFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTagFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSchedule(v types.Schedule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ScheduleMemberDaily: + av := object.Key("daily") + if err := awsRestjson1_serializeDocumentDailySchedule(&uv.Value, av); err != nil { + return err + } + + case *types.ScheduleMemberMonthly: + av := object.Key("monthly") + if err := awsRestjson1_serializeDocumentMonthlySchedule(&uv.Value, av); err != nil { + return err + } + + case *types.ScheduleMemberOneTime: + av := object.Key("oneTime") + if err := awsRestjson1_serializeDocumentOneTimeSchedule(&uv.Value, av); err != nil { + return err + } + + case *types.ScheduleMemberWeekly: + av := object.Key("weekly") + if err := awsRestjson1_serializeDocumentWeeklySchedule(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + func awsRestjson1_serializeDocumentSearchVulnerabilitiesFilterCriteria(v *types.SearchVulnerabilitiesFilterCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5118,6 +7153,106 @@ func awsRestjson1_serializeDocumentSortCriteria(v *types.SortCriteria, value smi return nil } +func awsRestjson1_serializeDocumentStartCisSessionMessage(v *types.StartCisSessionMessage, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SessionToken != nil { + ok := object.Key("sessionToken") + ok.String(*v.SessionToken) + } + + return nil +} + +func awsRestjson1_serializeDocumentStopCisMessageProgress(v *types.StopCisMessageProgress, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ErrorChecks != 0 { + ok := object.Key("errorChecks") + ok.Integer(v.ErrorChecks) + } + + if v.FailedChecks != 0 { + ok := object.Key("failedChecks") + ok.Integer(v.FailedChecks) + } + + if v.InformationalChecks != 0 { + ok := object.Key("informationalChecks") + ok.Integer(v.InformationalChecks) + } + + if v.NotApplicableChecks != 0 { + ok := object.Key("notApplicableChecks") + ok.Integer(v.NotApplicableChecks) + } + + if v.NotEvaluatedChecks != 0 { + ok := object.Key("notEvaluatedChecks") + ok.Integer(v.NotEvaluatedChecks) + } + + if v.SuccessfulChecks != 0 { + ok := object.Key("successfulChecks") + ok.Integer(v.SuccessfulChecks) + } + + if v.TotalChecks != 0 { + ok := object.Key("totalChecks") + ok.Integer(v.TotalChecks) + } + + if v.UnknownChecks != 0 { + ok := object.Key("unknownChecks") + ok.Integer(v.UnknownChecks) + } + + return nil +} + +func awsRestjson1_serializeDocumentStopCisSessionMessage(v *types.StopCisSessionMessage, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BenchmarkProfile != nil { + ok := object.Key("benchmarkProfile") + ok.String(*v.BenchmarkProfile) + } + + if v.BenchmarkVersion != nil { + ok := object.Key("benchmarkVersion") + ok.String(*v.BenchmarkVersion) + } + + if v.ComputePlatform != nil { + ok := object.Key("computePlatform") + if err := awsRestjson1_serializeDocumentComputePlatform(v.ComputePlatform, ok); err != nil { + return err + } + } + + if v.Progress != nil { + ok := object.Key("progress") + if err := awsRestjson1_serializeDocumentStopCisMessageProgress(v.Progress, ok); err != nil { + return err + } + } + + if v.Reason != nil { + ok := object.Key("reason") + ok.String(*v.Reason) + } + + if len(v.Status) > 0 { + ok := object.Key("status") + ok.String(string(v.Status)) + } + + return nil +} + func awsRestjson1_serializeDocumentStringFilter(v *types.StringFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5148,6 +7283,28 @@ func awsRestjson1_serializeDocumentStringFilterList(v []types.StringFilter, valu return nil } +func awsRestjson1_serializeDocumentTagFilter(v *types.TagFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Comparison) > 0 { + ok := object.Key("comparison") + ok.String(string(v.Comparison)) + } + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5159,6 +7316,87 @@ func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson. return nil } +func awsRestjson1_serializeDocumentTagValueList(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_serializeDocumentTargetAccountList(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_serializeDocumentTargetResourceTags(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_serializeDocumentTagValueList(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTargetStatusFilterList(v []types.CisTargetStatusFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisTargetStatusFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTargetStatusReasonFilterList(v []types.CisTargetStatusReasonFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisTargetStatusReasonFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTime(v *types.Time, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TimeOfDay != nil { + ok := object.Key("timeOfDay") + ok.String(*v.TimeOfDay) + } + + if v.Timezone != nil { + ok := object.Key("timezone") + ok.String(*v.Timezone) + } + + return nil +} + func awsRestjson1_serializeDocumentTitleAggregation(v *types.TitleAggregation, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5200,6 +7438,40 @@ func awsRestjson1_serializeDocumentTitleAggregation(v *types.TitleAggregation, v return nil } +func awsRestjson1_serializeDocumentTitleFilterList(v []types.CisStringFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCisStringFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentUpdateCisTargets(v *types.UpdateCisTargets, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("accountIds") + if err := awsRestjson1_serializeDocumentTargetAccountList(v.AccountIds, ok); err != nil { + return err + } + } + + if v.TargetResourceTags != nil { + ok := object.Key("targetResourceTags") + if err := awsRestjson1_serializeDocumentTargetResourceTags(v.TargetResourceTags, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentUsageAccountIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -5221,3 +7493,24 @@ func awsRestjson1_serializeDocumentVulnIdList(v []string, value smithyjson.Value } return nil } + +func awsRestjson1_serializeDocumentWeeklySchedule(v *types.WeeklySchedule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Days != nil { + ok := object.Key("days") + if err := awsRestjson1_serializeDocumentDaysList(v.Days, ok); err != nil { + return err + } + } + + if v.StartTime != nil { + ok := object.Key("startTime") + if err := awsRestjson1_serializeDocumentTime(v.StartTime, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/inspector2/types/enums.go b/service/inspector2/types/enums.go index 6a6e07d38a7..f98ada6ca04 100644 --- a/service/inspector2/types/enums.go +++ b/service/inspector2/types/enums.go @@ -158,6 +158,380 @@ func (AwsEcrContainerSortBy) Values() []AwsEcrContainerSortBy { } } +type CisFindingStatus string + +// Enum values for CisFindingStatus +const ( + CisFindingStatusPassed CisFindingStatus = "PASSED" + CisFindingStatusFailed CisFindingStatus = "FAILED" + CisFindingStatusSkipped CisFindingStatus = "SKIPPED" +) + +// Values returns all known values for CisFindingStatus. 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 (CisFindingStatus) Values() []CisFindingStatus { + return []CisFindingStatus{ + "PASSED", + "FAILED", + "SKIPPED", + } +} + +type CisFindingStatusComparison string + +// Enum values for CisFindingStatusComparison +const ( + CisFindingStatusComparisonEquals CisFindingStatusComparison = "EQUALS" +) + +// Values returns all known values for CisFindingStatusComparison. 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 (CisFindingStatusComparison) Values() []CisFindingStatusComparison { + return []CisFindingStatusComparison{ + "EQUALS", + } +} + +type CisReportStatus string + +// Enum values for CisReportStatus +const ( + CisReportStatusSucceeded CisReportStatus = "SUCCEEDED" + CisReportStatusFailed CisReportStatus = "FAILED" + CisReportStatusInProgress CisReportStatus = "IN_PROGRESS" +) + +// Values returns all known values for CisReportStatus. 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 (CisReportStatus) Values() []CisReportStatus { + return []CisReportStatus{ + "SUCCEEDED", + "FAILED", + "IN_PROGRESS", + } +} + +type CisResultStatus string + +// Enum values for CisResultStatus +const ( + CisResultStatusPassed CisResultStatus = "PASSED" + CisResultStatusFailed CisResultStatus = "FAILED" + CisResultStatusSkipped CisResultStatus = "SKIPPED" +) + +// Values returns all known values for CisResultStatus. 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 (CisResultStatus) Values() []CisResultStatus { + return []CisResultStatus{ + "PASSED", + "FAILED", + "SKIPPED", + } +} + +type CisResultStatusComparison string + +// Enum values for CisResultStatusComparison +const ( + CisResultStatusComparisonEquals CisResultStatusComparison = "EQUALS" +) + +// Values returns all known values for CisResultStatusComparison. 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 (CisResultStatusComparison) Values() []CisResultStatusComparison { + return []CisResultStatusComparison{ + "EQUALS", + } +} + +type CisRuleStatus string + +// Enum values for CisRuleStatus +const ( + CisRuleStatusFailed CisRuleStatus = "FAILED" + CisRuleStatusPassed CisRuleStatus = "PASSED" + CisRuleStatusNotEvaluated CisRuleStatus = "NOT_EVALUATED" + CisRuleStatusInformational CisRuleStatus = "INFORMATIONAL" + CisRuleStatusUnknown CisRuleStatus = "UNKNOWN" + CisRuleStatusNotApplicable CisRuleStatus = "NOT_APPLICABLE" + CisRuleStatusError CisRuleStatus = "ERROR" +) + +// Values returns all known values for CisRuleStatus. 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 (CisRuleStatus) Values() []CisRuleStatus { + return []CisRuleStatus{ + "FAILED", + "PASSED", + "NOT_EVALUATED", + "INFORMATIONAL", + "UNKNOWN", + "NOT_APPLICABLE", + "ERROR", + } +} + +type CisScanConfigurationsSortBy string + +// Enum values for CisScanConfigurationsSortBy +const ( + CisScanConfigurationsSortByScanName CisScanConfigurationsSortBy = "SCAN_NAME" + CisScanConfigurationsSortByScanConfigurationArn CisScanConfigurationsSortBy = "SCAN_CONFIGURATION_ARN" +) + +// Values returns all known values for CisScanConfigurationsSortBy. 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 (CisScanConfigurationsSortBy) Values() []CisScanConfigurationsSortBy { + return []CisScanConfigurationsSortBy{ + "SCAN_NAME", + "SCAN_CONFIGURATION_ARN", + } +} + +type CisScanResultDetailsSortBy string + +// Enum values for CisScanResultDetailsSortBy +const ( + CisScanResultDetailsSortByCheckId CisScanResultDetailsSortBy = "CHECK_ID" + CisScanResultDetailsSortByStatus CisScanResultDetailsSortBy = "STATUS" +) + +// Values returns all known values for CisScanResultDetailsSortBy. 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 (CisScanResultDetailsSortBy) Values() []CisScanResultDetailsSortBy { + return []CisScanResultDetailsSortBy{ + "CHECK_ID", + "STATUS", + } +} + +type CisScanResultsAggregatedByChecksSortBy string + +// Enum values for CisScanResultsAggregatedByChecksSortBy +const ( + CisScanResultsAggregatedByChecksSortByCheckId CisScanResultsAggregatedByChecksSortBy = "CHECK_ID" + CisScanResultsAggregatedByChecksSortByTitle CisScanResultsAggregatedByChecksSortBy = "TITLE" + CisScanResultsAggregatedByChecksSortByPlatform CisScanResultsAggregatedByChecksSortBy = "PLATFORM" + CisScanResultsAggregatedByChecksSortByFailedCounts CisScanResultsAggregatedByChecksSortBy = "FAILED_COUNTS" + CisScanResultsAggregatedByChecksSortBySecurityLevel CisScanResultsAggregatedByChecksSortBy = "SECURITY_LEVEL" +) + +// Values returns all known values for CisScanResultsAggregatedByChecksSortBy. +// 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 (CisScanResultsAggregatedByChecksSortBy) Values() []CisScanResultsAggregatedByChecksSortBy { + return []CisScanResultsAggregatedByChecksSortBy{ + "CHECK_ID", + "TITLE", + "PLATFORM", + "FAILED_COUNTS", + "SECURITY_LEVEL", + } +} + +type CisScanResultsAggregatedByTargetResourceSortBy string + +// Enum values for CisScanResultsAggregatedByTargetResourceSortBy +const ( + CisScanResultsAggregatedByTargetResourceSortByResourceId CisScanResultsAggregatedByTargetResourceSortBy = "RESOURCE_ID" + CisScanResultsAggregatedByTargetResourceSortByFailedCounts CisScanResultsAggregatedByTargetResourceSortBy = "FAILED_COUNTS" + CisScanResultsAggregatedByTargetResourceSortByAccountId CisScanResultsAggregatedByTargetResourceSortBy = "ACCOUNT_ID" + CisScanResultsAggregatedByTargetResourceSortByPlatform CisScanResultsAggregatedByTargetResourceSortBy = "PLATFORM" + CisScanResultsAggregatedByTargetResourceSortByTargetStatus CisScanResultsAggregatedByTargetResourceSortBy = "TARGET_STATUS" + CisScanResultsAggregatedByTargetResourceSortByTargetStatusReason CisScanResultsAggregatedByTargetResourceSortBy = "TARGET_STATUS_REASON" +) + +// Values returns all known values for +// CisScanResultsAggregatedByTargetResourceSortBy. 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 (CisScanResultsAggregatedByTargetResourceSortBy) Values() []CisScanResultsAggregatedByTargetResourceSortBy { + return []CisScanResultsAggregatedByTargetResourceSortBy{ + "RESOURCE_ID", + "FAILED_COUNTS", + "ACCOUNT_ID", + "PLATFORM", + "TARGET_STATUS", + "TARGET_STATUS_REASON", + } +} + +type CisScanStatus string + +// Enum values for CisScanStatus +const ( + CisScanStatusFailed CisScanStatus = "FAILED" + CisScanStatusCompleted CisScanStatus = "COMPLETED" + CisScanStatusCancelled CisScanStatus = "CANCELLED" + CisScanStatusInProgress CisScanStatus = "IN_PROGRESS" +) + +// Values returns all known values for CisScanStatus. 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 (CisScanStatus) Values() []CisScanStatus { + return []CisScanStatus{ + "FAILED", + "COMPLETED", + "CANCELLED", + "IN_PROGRESS", + } +} + +type CisScanStatusComparison string + +// Enum values for CisScanStatusComparison +const ( + CisScanStatusComparisonEquals CisScanStatusComparison = "EQUALS" +) + +// Values returns all known values for CisScanStatusComparison. 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 (CisScanStatusComparison) Values() []CisScanStatusComparison { + return []CisScanStatusComparison{ + "EQUALS", + } +} + +type CisSecurityLevel string + +// Enum values for CisSecurityLevel +const ( + CisSecurityLevelLevel1 CisSecurityLevel = "LEVEL_1" + CisSecurityLevelLevel2 CisSecurityLevel = "LEVEL_2" +) + +// Values returns all known values for CisSecurityLevel. 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 (CisSecurityLevel) Values() []CisSecurityLevel { + return []CisSecurityLevel{ + "LEVEL_1", + "LEVEL_2", + } +} + +type CisSecurityLevelComparison string + +// Enum values for CisSecurityLevelComparison +const ( + CisSecurityLevelComparisonEquals CisSecurityLevelComparison = "EQUALS" +) + +// Values returns all known values for CisSecurityLevelComparison. 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 (CisSecurityLevelComparison) Values() []CisSecurityLevelComparison { + return []CisSecurityLevelComparison{ + "EQUALS", + } +} + +type CisSortOrder string + +// Enum values for CisSortOrder +const ( + CisSortOrderAsc CisSortOrder = "ASC" + CisSortOrderDesc CisSortOrder = "DESC" +) + +// Values returns all known values for CisSortOrder. 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 (CisSortOrder) Values() []CisSortOrder { + return []CisSortOrder{ + "ASC", + "DESC", + } +} + +type CisStringComparison string + +// Enum values for CisStringComparison +const ( + CisStringComparisonEquals CisStringComparison = "EQUALS" + CisStringComparisonPrefix CisStringComparison = "PREFIX" + CisStringComparisonNotEquals CisStringComparison = "NOT_EQUALS" +) + +// Values returns all known values for CisStringComparison. 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 (CisStringComparison) Values() []CisStringComparison { + return []CisStringComparison{ + "EQUALS", + "PREFIX", + "NOT_EQUALS", + } +} + +type CisTargetStatus string + +// Enum values for CisTargetStatus +const ( + CisTargetStatusTimedOut CisTargetStatus = "TIMED_OUT" + CisTargetStatusCancelled CisTargetStatus = "CANCELLED" + CisTargetStatusCompleted CisTargetStatus = "COMPLETED" +) + +// Values returns all known values for CisTargetStatus. 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 (CisTargetStatus) Values() []CisTargetStatus { + return []CisTargetStatus{ + "TIMED_OUT", + "CANCELLED", + "COMPLETED", + } +} + +type CisTargetStatusComparison string + +// Enum values for CisTargetStatusComparison +const ( + CisTargetStatusComparisonEquals CisTargetStatusComparison = "EQUALS" +) + +// Values returns all known values for CisTargetStatusComparison. 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 (CisTargetStatusComparison) Values() []CisTargetStatusComparison { + return []CisTargetStatusComparison{ + "EQUALS", + } +} + +type CisTargetStatusReason string + +// Enum values for CisTargetStatusReason +const ( + CisTargetStatusReasonScanInProgress CisTargetStatusReason = "SCAN_IN_PROGRESS" + CisTargetStatusReasonUnsupportedOs CisTargetStatusReason = "UNSUPPORTED_OS" + CisTargetStatusReasonSsmUnmanaged CisTargetStatusReason = "SSM_UNMANAGED" +) + +// Values returns all known values for CisTargetStatusReason. 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 (CisTargetStatusReason) Values() []CisTargetStatusReason { + return []CisTargetStatusReason{ + "SCAN_IN_PROGRESS", + "UNSUPPORTED_OS", + "SSM_UNMANAGED", + } +} + type CodeSnippetErrorCode string // Enum values for CodeSnippetErrorCode @@ -252,6 +626,34 @@ func (Currency) Values() []Currency { } } +type Day string + +// Enum values for Day +const ( + DaySun Day = "SUN" + DayMon Day = "MON" + DayTue Day = "TUE" + DayWed Day = "WED" + DayThu Day = "THU" + DayFri Day = "FRI" + DaySat Day = "SAT" +) + +// Values returns all known values for Day. 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 (Day) Values() []Day { + return []Day{ + "SUN", + "MON", + "TUE", + "WED", + "THU", + "FRI", + "SAT", + } +} + type DelegatedAdminStatus string // Enum values for DelegatedAdminStatus @@ -740,6 +1142,46 @@ func (LambdaLayerSortBy) Values() []LambdaLayerSortBy { } } +type ListCisScansDetailLevel string + +// Enum values for ListCisScansDetailLevel +const ( + ListCisScansDetailLevelOrganization ListCisScansDetailLevel = "ORGANIZATION" + ListCisScansDetailLevelMember ListCisScansDetailLevel = "MEMBER" +) + +// Values returns all known values for ListCisScansDetailLevel. 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 (ListCisScansDetailLevel) Values() []ListCisScansDetailLevel { + return []ListCisScansDetailLevel{ + "ORGANIZATION", + "MEMBER", + } +} + +type ListCisScansSortBy string + +// Enum values for ListCisScansSortBy +const ( + ListCisScansSortByStatus ListCisScansSortBy = "STATUS" + ListCisScansSortByScheduledBy ListCisScansSortBy = "SCHEDULED_BY" + ListCisScansSortByScanStartDate ListCisScansSortBy = "SCAN_START_DATE" + ListCisScansSortByFailedChecks ListCisScansSortBy = "FAILED_CHECKS" +) + +// Values returns all known values for ListCisScansSortBy. 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 (ListCisScansSortBy) Values() []ListCisScansSortBy { + return []ListCisScansSortBy{ + "STATUS", + "SCHEDULED_BY", + "SCAN_START_DATE", + "FAILED_CHECKS", + } +} + type MapComparison string // Enum values for MapComparison @@ -1364,6 +1806,28 @@ func (Status) Values() []Status { } } +type StopCisSessionStatus string + +// Enum values for StopCisSessionStatus +const ( + StopCisSessionStatusSuccess StopCisSessionStatus = "SUCCESS" + StopCisSessionStatusFailed StopCisSessionStatus = "FAILED" + StopCisSessionStatusInterrupted StopCisSessionStatus = "INTERRUPTED" + StopCisSessionStatusUnsupportedOs StopCisSessionStatus = "UNSUPPORTED_OS" +) + +// Values returns all known values for StopCisSessionStatus. 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 (StopCisSessionStatus) Values() []StopCisSessionStatus { + return []StopCisSessionStatus{ + "SUCCESS", + "FAILED", + "INTERRUPTED", + "UNSUPPORTED_OS", + } +} + type StringComparison string // Enum values for StringComparison @@ -1384,6 +1848,22 @@ func (StringComparison) Values() []StringComparison { } } +type TagComparison string + +// Enum values for TagComparison +const ( + TagComparisonEquals TagComparison = "EQUALS" +) + +// Values returns all known values for TagComparison. 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 (TagComparison) Values() []TagComparison { + return []TagComparison{ + "EQUALS", + } +} + type TitleSortBy string // Enum values for TitleSortBy diff --git a/service/inspector2/types/types.go b/service/inspector2/types/types.go index 56d81549fe8..1dab8030df2 100644 --- a/service/inspector2/types/types.go +++ b/service/inspector2/types/types.go @@ -613,6 +613,433 @@ type CisaData struct { noSmithyDocumentSerde } +// A CIS check. +type CisCheckAggregation struct { + + // The scan ARN for the CIS check scan ARN. + // + // This member is required. + ScanArn *string + + // The account ID for the CIS check. + AccountId *string + + // The description for the CIS check. + CheckDescription *string + + // The check ID for the CIS check. + CheckId *string + + // The CIS check level. + Level CisSecurityLevel + + // The CIS check platform. + Platform *string + + // The CIS check status counts. + StatusCounts *StatusCounts + + // The CIS check title. + Title *string + + noSmithyDocumentSerde +} + +// The CIS date filter. +type CisDateFilter struct { + + // The CIS date filter's earliest scan start time. + EarliestScanStartTime *time.Time + + // The CIS date filter's latest scan start time. + LatestScanStartTime *time.Time + + noSmithyDocumentSerde +} + +// The CIS finding status filter. +type CisFindingStatusFilter struct { + + // The comparison value of the CIS finding status filter. + // + // This member is required. + Comparison CisFindingStatusComparison + + // The value of the CIS finding status filter. + // + // This member is required. + Value CisFindingStatus + + noSmithyDocumentSerde +} + +// The CIS number filter. +type CisNumberFilter struct { + + // The CIS number filter's lower inclusive. + LowerInclusive *int32 + + // The CIS number filter's upper inclusive. + UpperInclusive *int32 + + noSmithyDocumentSerde +} + +// The CIS result status filter. +type CisResultStatusFilter struct { + + // The comparison value of the CIS result status filter. + // + // This member is required. + Comparison CisResultStatusComparison + + // The value of the CIS result status filter. + // + // This member is required. + Value CisResultStatus + + noSmithyDocumentSerde +} + +// The CIS scan. +type CisScan struct { + + // The CIS scan's ARN. + // + // This member is required. + ScanArn *string + + // The CIS scan's configuration ARN. + // + // This member is required. + ScanConfigurationArn *string + + // The CIS scan's failed checks. + FailedChecks *int32 + + // The CIS scan's date. + ScanDate *time.Time + + // The the name of the scan configuration that's associated with this scan. + ScanName *string + + // The account or organization that schedules the CIS scan. + ScheduledBy *string + + // The security level for the CIS scan. Security level refers to the Benchmark + // levels that CIS assigns to a profile. + SecurityLevel CisSecurityLevel + + // The CIS scan's status. + Status CisScanStatus + + // The CIS scan's targets. + Targets *CisTargets + + // The CIS scan's total checks. + TotalChecks *int32 + + noSmithyDocumentSerde +} + +// The CIS scan configuration. +type CisScanConfiguration struct { + + // The CIS scan configuration's scan configuration ARN. + // + // This member is required. + ScanConfigurationArn *string + + // The CIS scan configuration's owner ID. + OwnerId *string + + // The name of the CIS scan configuration. + ScanName *string + + // The CIS scan configuration's schedule. + Schedule Schedule + + // The CIS scan configuration's security level. + SecurityLevel CisSecurityLevel + + // The CIS scan configuration's tags. + Tags map[string]string + + // The CIS scan configuration's targets. + Targets *CisTargets + + noSmithyDocumentSerde +} + +// The CIS scan result details. +type CisScanResultDetails struct { + + // The CIS scan result details' scan ARN. + // + // This member is required. + ScanArn *string + + // The CIS scan result details' account ID. + AccountId *string + + // The account ID that's associated with the CIS scan result details. + CheckDescription *string + + // The CIS scan result details' check ID. + CheckId *string + + // The CIS scan result details' finding ARN. + FindingArn *string + + // The CIS scan result details' level. + Level CisSecurityLevel + + // The CIS scan result details' platform. + Platform *string + + // The CIS scan result details' remediation. + Remediation *string + + // The CIS scan result details' status. + Status CisFindingStatus + + // The CIS scan result details' status reason. + StatusReason *string + + // The CIS scan result details' target resource ID. + TargetResourceId *string + + // The CIS scan result details' title. + Title *string + + noSmithyDocumentSerde +} + +// The CIS scan result details filter criteria. +type CisScanResultDetailsFilterCriteria struct { + + // The criteria's check ID filters. + CheckIdFilters []CisStringFilter + + // The criteria's finding ARN filters. + FindingArnFilters []CisStringFilter + + // The criteria's finding status filters. + FindingStatusFilters []CisFindingStatusFilter + + // The criteria's security level filters. . Security level refers to the Benchmark + // levels that CIS assigns to a profile. + SecurityLevelFilters []CisSecurityLevelFilter + + // The criteria's title filters. + TitleFilters []CisStringFilter + + noSmithyDocumentSerde +} + +// The scan results aggregated by checks filter criteria. +type CisScanResultsAggregatedByChecksFilterCriteria struct { + + // The criteria's account ID filters. + AccountIdFilters []CisStringFilter + + // The criteria's check ID filters. + CheckIdFilters []CisStringFilter + + // The criteria's failed resources filters. + FailedResourcesFilters []CisNumberFilter + + // The criteria's platform filters. + PlatformFilters []CisStringFilter + + // The criteria's security level filters. + SecurityLevelFilters []CisSecurityLevelFilter + + // The criteria's title filters. + TitleFilters []CisStringFilter + + noSmithyDocumentSerde +} + +// The scan results aggregated by target resource filter criteria. +type CisScanResultsAggregatedByTargetResourceFilterCriteria struct { + + // The criteria's account ID filters. + AccountIdFilters []CisStringFilter + + // The criteria's check ID filters. + CheckIdFilters []CisStringFilter + + // The criteria's failed checks filters. + FailedChecksFilters []CisNumberFilter + + // The criteria's platform filters. + PlatformFilters []CisStringFilter + + // The criteria's status filter. + StatusFilters []CisResultStatusFilter + + // The criteria's target resource ID filters. + TargetResourceIdFilters []CisStringFilter + + // The criteria's target resource tag filters. + TargetResourceTagFilters []TagFilter + + // The criteria's target status filters. + TargetStatusFilters []CisTargetStatusFilter + + // The criteria's target status reason filters. + TargetStatusReasonFilters []CisTargetStatusReasonFilter + + noSmithyDocumentSerde +} + +// The CIS scan status filter. +type CisScanStatusFilter struct { + + // The filter comparison value. + // + // This member is required. + Comparison CisScanStatusComparison + + // The filter value. + // + // This member is required. + Value CisScanStatus + + noSmithyDocumentSerde +} + +// The CIS security level filter. Security level refers to the Benchmark levels +// that CIS assigns to a profile. +type CisSecurityLevelFilter struct { + + // The CIS security filter comparison value. + // + // This member is required. + Comparison CisSecurityLevelComparison + + // The CIS security filter value. + // + // This member is required. + Value CisSecurityLevel + + noSmithyDocumentSerde +} + +// The CIS session message. +type CisSessionMessage struct { + + // The CIS rule details for the CIS session message. + // + // This member is required. + CisRuleDetails []byte + + // The rule ID for the CIS session message. + // + // This member is required. + RuleId *string + + // The status of the CIS session message. + // + // This member is required. + Status CisRuleStatus + + noSmithyDocumentSerde +} + +// The CIS string filter. +type CisStringFilter struct { + + // The comparison value of the CIS string filter. + // + // This member is required. + Comparison CisStringComparison + + // The value of the CIS string filter. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The CIS target resource aggregation. +type CisTargetResourceAggregation struct { + + // The scan ARN for the CIS target resource. + // + // This member is required. + ScanArn *string + + // The account ID for the CIS target resource. + AccountId *string + + // The platform for the CIS target resource. + Platform *string + + // The target resource status counts. + StatusCounts *StatusCounts + + // The ID of the target resource. + TargetResourceId *string + + // The tag for the target resource. + TargetResourceTags map[string][]string + + // The status of the target resource. + TargetStatus CisTargetStatus + + // The reason for the target resource. + TargetStatusReason CisTargetStatusReason + + noSmithyDocumentSerde +} + +// The CIS targets. +type CisTargets struct { + + // The CIS target account ids. + AccountIds []string + + // The CIS target resource tags. + TargetResourceTags map[string][]string + + noSmithyDocumentSerde +} + +// The CIS target status filter. +type CisTargetStatusFilter struct { + + // The comparison value of the CIS target status filter. + // + // This member is required. + Comparison CisTargetStatusComparison + + // The value of the CIS target status filter. + // + // This member is required. + Value CisTargetStatus + + noSmithyDocumentSerde +} + +// The CIS target status reason filter. +type CisTargetStatusReasonFilter struct { + + // The comparison value of the CIS target status reason filter. + // + // This member is required. + Comparison CisTargetStatusComparison + + // The value of the CIS target status reason filter. + // + // This member is required. + Value CisTargetStatusReason + + noSmithyDocumentSerde +} + // Contains information on where a code vulnerability is located in your Lambda // function. type CodeFilePath struct { @@ -750,6 +1177,21 @@ type CodeVulnerabilityDetails struct { noSmithyDocumentSerde } +// A compute platform. +type ComputePlatform struct { + + // The compute platform product. + Product *string + + // The compute platform vendor. + Vendor *string + + // The compute platform version. + Version *string + + noSmithyDocumentSerde +} + // a structure that contains information on the count of resources within a group. type Counts struct { @@ -806,8 +1248,8 @@ type CoverageFilterCriteria struct { ResourceId []CoverageStringFilter // An array of Amazon Web Services resource types to return coverage statistics - // for. The values can be AWS_EC2_INSTANCE , AWS_LAMBDA_FUNCTION or - // AWS_ECR_REPOSITORY . + // for. The values can be AWS_EC2_INSTANCE , AWS_LAMBDA_FUNCTION , + // AWS_ECR_CONTAINER_IMAGE , AWS_ECR_REPOSITORY or AWS_ACCOUNT . ResourceType []CoverageStringFilter // The scan status code to filter on. Valid values are: ValidationException , @@ -894,6 +1336,22 @@ type CoveredResource struct { noSmithyDocumentSerde } +// Creates CIS targets. +type CreateCisTargets struct { + + // The CIS target account ids. + // + // This member is required. + AccountIds []string + + // The CIS target resource tags. + // + // This member is required. + TargetResourceTags map[string][]string + + noSmithyDocumentSerde +} + // The Common Vulnerability Scoring System (CVSS) version 2 details for the // vulnerability. type Cvss2 struct { @@ -995,6 +1453,17 @@ type CvssScoreDetails struct { noSmithyDocumentSerde } +// A daily schedule. +type DailySchedule struct { + + // The schedule start time. + // + // This member is required. + StartTime *Time + + noSmithyDocumentSerde +} + // Contains details on the time range used to filter findings. type DateFilter struct { @@ -1951,6 +2420,57 @@ type LambdaVpcConfig struct { noSmithyDocumentSerde } +// A list of CIS scan configurations filter criteria. +type ListCisScanConfigurationsFilterCriteria struct { + + // The list of scan configuration ARN filters. + ScanConfigurationArnFilters []CisStringFilter + + // The list of scan name filters. + ScanNameFilters []CisStringFilter + + // The list of target resource tag filters. + TargetResourceTagFilters []TagFilter + + noSmithyDocumentSerde +} + +// A list of CIS scans filter criteria. +type ListCisScansFilterCriteria struct { + + // The list of failed checks filters. + FailedChecksFilters []CisNumberFilter + + // The list of scan ARN filters. + ScanArnFilters []CisStringFilter + + // The list of scan at filters. + ScanAtFilters []CisDateFilter + + // The list of scan configuration ARN filters. + ScanConfigurationArnFilters []CisStringFilter + + // The list of scan name filters. + ScanNameFilters []CisStringFilter + + // The list of scan status filters. + ScanStatusFilters []CisScanStatusFilter + + // The list of scheduled by filters. + ScheduledByFilters []CisStringFilter + + // The list of target account ID filters. + TargetAccountIdFilters []CisStringFilter + + // The list of target resource ID filters. + TargetResourceIdFilters []CisStringFilter + + // The list of target resource tag filters. + TargetResourceTagFilters []TagFilter + + noSmithyDocumentSerde +} + // An object that describes details of a map filter. type MapFilter struct { @@ -2028,6 +2548,22 @@ type MemberAccountEc2DeepInspectionStatusState struct { noSmithyDocumentSerde } +// A monthly schedule. +type MonthlySchedule struct { + + // The monthly schedule's day. + // + // This member is required. + Day Day + + // The monthly schedule's start time. + // + // This member is required. + StartTime *Time + + noSmithyDocumentSerde +} + // Information on the network path associated with a finding. type NetworkPath struct { @@ -2071,6 +2607,11 @@ type NumberFilter struct { noSmithyDocumentSerde } +// A one time schedule. +type OneTimeSchedule struct { + noSmithyDocumentSerde +} + // The details that define an aggregation based on operating system package type. type PackageAggregation struct { @@ -2525,6 +3066,54 @@ type ScanStatus struct { noSmithyDocumentSerde } +// A schedule. +// +// The following types satisfy this interface: +// +// ScheduleMemberDaily +// ScheduleMemberMonthly +// ScheduleMemberOneTime +// ScheduleMemberWeekly +type Schedule interface { + isSchedule() +} + +// The schedule's daily. +type ScheduleMemberDaily struct { + Value DailySchedule + + noSmithyDocumentSerde +} + +func (*ScheduleMemberDaily) isSchedule() {} + +// The schedule's monthly. +type ScheduleMemberMonthly struct { + Value MonthlySchedule + + noSmithyDocumentSerde +} + +func (*ScheduleMemberMonthly) isSchedule() {} + +// The schedule's one time. +type ScheduleMemberOneTime struct { + Value OneTimeSchedule + + noSmithyDocumentSerde +} + +func (*ScheduleMemberOneTime) isSchedule() {} + +// The schedule's weekly. +type ScheduleMemberWeekly struct { + Value WeeklySchedule + + noSmithyDocumentSerde +} + +func (*ScheduleMemberWeekly) isSchedule() {} + // Details on the criteria used to define the filter for a vulnerability search. type SearchVulnerabilitiesFilterCriteria struct { @@ -2570,6 +3159,17 @@ type SortCriteria struct { noSmithyDocumentSerde } +// The start CIS session message. +type StartCisSessionMessage struct { + + // The unique token that identifies the CIS session. + // + // This member is required. + SessionToken *string + + noSmithyDocumentSerde +} + // An object that described the state of Amazon Inspector scans for an account. type State struct { @@ -2591,6 +3191,21 @@ type State struct { noSmithyDocumentSerde } +// The status counts. +type StatusCounts struct { + + // The number of checks that failed. + Failed *int32 + + // The number of checks that passed. + Passed *int32 + + // The number of checks that were skipped. + Skipped *int32 + + noSmithyDocumentSerde +} + // Details about the step associated with a finding. type Step struct { @@ -2607,6 +3222,64 @@ type Step struct { noSmithyDocumentSerde } +// The stop CIS message progress. +type StopCisMessageProgress struct { + + // The progress' error checks. + ErrorChecks int32 + + // The progress' failed checks. + FailedChecks int32 + + // The progress' informational checks. + InformationalChecks int32 + + // The progress' not applicable checks. + NotApplicableChecks int32 + + // The progress' not evaluated checks. + NotEvaluatedChecks int32 + + // The progress' successful checks. + SuccessfulChecks int32 + + // The progress' total checks. + TotalChecks int32 + + // The progress' unknown checks. + UnknownChecks int32 + + noSmithyDocumentSerde +} + +// The stop CIS session message. +type StopCisSessionMessage struct { + + // The progress of the message. + // + // This member is required. + Progress *StopCisMessageProgress + + // The status of the message. + // + // This member is required. + Status StopCisSessionStatus + + // The message benchmark profile. + BenchmarkProfile *string + + // The message benchmark version. + BenchmarkVersion *string + + // The message compute platform. + ComputePlatform *ComputePlatform + + // The reason for the message. + Reason *string + + noSmithyDocumentSerde +} + // An object that describes the details of a string filter. type StringFilter struct { @@ -2635,6 +3308,43 @@ type SuggestedFix struct { noSmithyDocumentSerde } +// The tag filter. +type TagFilter struct { + + // The tag filter comparison value. + // + // This member is required. + Comparison TagComparison + + // The tag filter key. + // + // This member is required. + Key *string + + // The tag filter value. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The time. +type Time struct { + + // The time of day in 24-hour format (00:00). + // + // This member is required. + TimeOfDay *string + + // The timezone. + // + // This member is required. + Timezone *string + + noSmithyDocumentSerde +} + // The details that define an aggregation based on finding title. type TitleAggregation struct { @@ -2680,6 +3390,18 @@ type TitleAggregationResponse struct { noSmithyDocumentSerde } +// Updates CIS targets. +type UpdateCisTargets struct { + + // The target account ids. + AccountIds []string + + // The target resource tags. + TargetResourceTags map[string][]string + + noSmithyDocumentSerde +} + // Contains usage information about the cost of Amazon Inspector operation. type Usage struct { @@ -2835,6 +3557,22 @@ type VulnerablePackage struct { noSmithyDocumentSerde } +// A weekly schedule. +type WeeklySchedule struct { + + // The weekly schedule's days. + // + // This member is required. + Days []Day + + // The weekly schedule's start time. + // + // This member is required. + StartTime *Time + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, @@ -2848,3 +3586,4 @@ type UnknownUnionMember struct { func (*UnknownUnionMember) isAggregationRequest() {} func (*UnknownUnionMember) isAggregationResponse() {} +func (*UnknownUnionMember) isSchedule() {} diff --git a/service/inspector2/types/types_exported_test.go b/service/inspector2/types/types_exported_test.go index 1bd3d38fd35..0f13a6699a8 100644 --- a/service/inspector2/types/types_exported_test.go +++ b/service/inspector2/types/types_exported_test.go @@ -122,3 +122,33 @@ var _ *types.FindingTypeAggregationResponse var _ *types.LambdaFunctionAggregationResponse var _ *types.AwsEcrContainerAggregationResponse var _ *types.Ec2InstanceAggregationResponse + +func ExampleSchedule_outputUsage() { + var union types.Schedule + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ScheduleMemberDaily: + _ = v.Value // Value is types.DailySchedule + + case *types.ScheduleMemberMonthly: + _ = v.Value // Value is types.MonthlySchedule + + case *types.ScheduleMemberOneTime: + _ = v.Value // Value is types.OneTimeSchedule + + case *types.ScheduleMemberWeekly: + _ = v.Value // Value is types.WeeklySchedule + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.DailySchedule +var _ *types.WeeklySchedule +var _ *types.OneTimeSchedule +var _ *types.MonthlySchedule diff --git a/service/inspector2/validators.go b/service/inspector2/validators.go index 44817202ca5..44d23da5a07 100644 --- a/service/inspector2/validators.go +++ b/service/inspector2/validators.go @@ -150,6 +150,26 @@ func (m *validateOpCancelSbomExport) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpCreateCisScanConfiguration struct { +} + +func (*validateOpCreateCisScanConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateCisScanConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateCisScanConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateCisScanConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateFilter struct { } @@ -210,6 +230,26 @@ func (m *validateOpCreateSbomExport) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpDeleteCisScanConfiguration struct { +} + +func (*validateOpDeleteCisScanConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCisScanConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCisScanConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCisScanConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteFilter struct { } @@ -310,6 +350,46 @@ func (m *validateOpEnable) HandleInitialize(ctx context.Context, in middleware.I return next.HandleInitialize(ctx, in) } +type validateOpGetCisScanReport struct { +} + +func (*validateOpGetCisScanReport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCisScanReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCisScanReportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCisScanReportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCisScanResultDetails struct { +} + +func (*validateOpGetCisScanResultDetails) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCisScanResultDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCisScanResultDetailsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCisScanResultDetailsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetEncryptionKey struct { } @@ -370,6 +450,86 @@ func (m *validateOpGetSbomExport) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpListCisScanConfigurations struct { +} + +func (*validateOpListCisScanConfigurations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCisScanConfigurations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCisScanConfigurationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCisScanConfigurationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListCisScanResultsAggregatedByChecks struct { +} + +func (*validateOpListCisScanResultsAggregatedByChecks) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCisScanResultsAggregatedByChecks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCisScanResultsAggregatedByChecksInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCisScanResultsAggregatedByChecksInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListCisScanResultsAggregatedByTargetResource struct { +} + +func (*validateOpListCisScanResultsAggregatedByTargetResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCisScanResultsAggregatedByTargetResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCisScanResultsAggregatedByTargetResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCisScanResultsAggregatedByTargetResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListCisScans struct { +} + +func (*validateOpListCisScans) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCisScans) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCisScansInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCisScansInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListCoverage struct { } @@ -510,6 +670,86 @@ func (m *validateOpSearchVulnerabilities) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpSendCisSessionHealth struct { +} + +func (*validateOpSendCisSessionHealth) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendCisSessionHealth) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendCisSessionHealthInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendCisSessionHealthInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendCisSessionTelemetry struct { +} + +func (*validateOpSendCisSessionTelemetry) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendCisSessionTelemetry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendCisSessionTelemetryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendCisSessionTelemetryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartCisSession struct { +} + +func (*validateOpStartCisSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartCisSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartCisSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartCisSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopCisSession struct { +} + +func (*validateOpStopCisSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopCisSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopCisSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopCisSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -550,6 +790,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateCisScanConfiguration struct { +} + +func (*validateOpUpdateCisScanConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCisScanConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCisScanConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCisScanConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateConfiguration struct { } @@ -678,6 +938,10 @@ func addOpCancelSbomExportValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelSbomExport{}, middleware.After) } +func addOpCreateCisScanConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateCisScanConfiguration{}, middleware.After) +} + func addOpCreateFilterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateFilter{}, middleware.After) } @@ -690,6 +954,10 @@ func addOpCreateSbomExportValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSbomExport{}, middleware.After) } +func addOpDeleteCisScanConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCisScanConfiguration{}, middleware.After) +} + func addOpDeleteFilterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteFilter{}, middleware.After) } @@ -710,6 +978,14 @@ func addOpEnableValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnable{}, middleware.After) } +func addOpGetCisScanReportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCisScanReport{}, middleware.After) +} + +func addOpGetCisScanResultDetailsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCisScanResultDetails{}, middleware.After) +} + func addOpGetEncryptionKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEncryptionKey{}, middleware.After) } @@ -722,6 +998,22 @@ func addOpGetSbomExportValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSbomExport{}, middleware.After) } +func addOpListCisScanConfigurationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCisScanConfigurations{}, middleware.After) +} + +func addOpListCisScanResultsAggregatedByChecksValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCisScanResultsAggregatedByChecks{}, middleware.After) +} + +func addOpListCisScanResultsAggregatedByTargetResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCisScanResultsAggregatedByTargetResource{}, middleware.After) +} + +func addOpListCisScansValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCisScans{}, middleware.After) +} + func addOpListCoverageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListCoverage{}, middleware.After) } @@ -750,6 +1042,22 @@ func addOpSearchVulnerabilitiesValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpSearchVulnerabilities{}, middleware.After) } +func addOpSendCisSessionHealthValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendCisSessionHealth{}, middleware.After) +} + +func addOpSendCisSessionTelemetryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendCisSessionTelemetry{}, middleware.After) +} + +func addOpStartCisSessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartCisSession{}, middleware.After) +} + +func addOpStopCisSessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopCisSession{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -758,6 +1066,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateCisScanConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCisScanConfiguration{}, middleware.After) +} + func addOpUpdateConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateConfiguration{}, middleware.After) } @@ -778,6 +1090,23 @@ func addOpUpdateOrgEc2DeepInspectionConfigurationValidationMiddleware(stack *mid return stack.Initialize.Add(&validateOpUpdateOrgEc2DeepInspectionConfiguration{}, middleware.After) } +func validateAccountIdFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AccountIdFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAggregationRequest(v types.AggregationRequest) error { if v == nil { return nil @@ -909,27 +1238,487 @@ func validateAwsEcrContainerAggregation(v *types.AwsEcrContainerAggregation) err } } -func validateCoverageFilterCriteria(v *types.CoverageFilterCriteria) error { +func validateCheckIdFilterList(v []types.CisStringFilter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "CoverageFilterCriteria"} - if v.ScanStatusCode != nil { - if err := validateCoverageStringFilterList(v.ScanStatusCode); err != nil { - invalidParams.AddNested("ScanStatusCode", err.(smithy.InvalidParamsError)) - } - } - if v.ScanStatusReason != nil { - if err := validateCoverageStringFilterList(v.ScanStatusReason); err != nil { - invalidParams.AddNested("ScanStatusReason", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "CheckIdFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } - if v.AccountId != nil { - if err := validateCoverageStringFilterList(v.AccountId); err != nil { - invalidParams.AddNested("AccountId", err.(smithy.InvalidParamsError)) - } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil } - if v.ResourceId != nil { +} + +func validateCisFindingArnFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisFindingArnFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisFindingStatusFilter(v *types.CisFindingStatusFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisFindingStatusFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if len(v.Value) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisFindingStatusFilterList(v []types.CisFindingStatusFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisFindingStatusFilterList"} + for i := range v { + if err := validateCisFindingStatusFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisResultStatusFilter(v *types.CisResultStatusFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisResultStatusFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if len(v.Value) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisResultStatusFilterList(v []types.CisResultStatusFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisResultStatusFilterList"} + for i := range v { + if err := validateCisResultStatusFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScanArnFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScanArnFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScanConfigurationArnFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScanConfigurationArnFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScanNameFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScanNameFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScanResultDetailsFilterCriteria(v *types.CisScanResultDetailsFilterCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScanResultDetailsFilterCriteria"} + if v.FindingStatusFilters != nil { + if err := validateCisFindingStatusFilterList(v.FindingStatusFilters); err != nil { + invalidParams.AddNested("FindingStatusFilters", err.(smithy.InvalidParamsError)) + } + } + if v.CheckIdFilters != nil { + if err := validateCheckIdFilterList(v.CheckIdFilters); err != nil { + invalidParams.AddNested("CheckIdFilters", err.(smithy.InvalidParamsError)) + } + } + if v.TitleFilters != nil { + if err := validateTitleFilterList(v.TitleFilters); err != nil { + invalidParams.AddNested("TitleFilters", err.(smithy.InvalidParamsError)) + } + } + if v.SecurityLevelFilters != nil { + if err := validateCisSecurityLevelFilterList(v.SecurityLevelFilters); err != nil { + invalidParams.AddNested("SecurityLevelFilters", err.(smithy.InvalidParamsError)) + } + } + if v.FindingArnFilters != nil { + if err := validateCisFindingArnFilterList(v.FindingArnFilters); err != nil { + invalidParams.AddNested("FindingArnFilters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScanResultsAggregatedByChecksFilterCriteria(v *types.CisScanResultsAggregatedByChecksFilterCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScanResultsAggregatedByChecksFilterCriteria"} + if v.AccountIdFilters != nil { + if err := validateOneAccountIdFilterList(v.AccountIdFilters); err != nil { + invalidParams.AddNested("AccountIdFilters", err.(smithy.InvalidParamsError)) + } + } + if v.CheckIdFilters != nil { + if err := validateCheckIdFilterList(v.CheckIdFilters); err != nil { + invalidParams.AddNested("CheckIdFilters", err.(smithy.InvalidParamsError)) + } + } + if v.TitleFilters != nil { + if err := validateTitleFilterList(v.TitleFilters); err != nil { + invalidParams.AddNested("TitleFilters", err.(smithy.InvalidParamsError)) + } + } + if v.PlatformFilters != nil { + if err := validatePlatformFilterList(v.PlatformFilters); err != nil { + invalidParams.AddNested("PlatformFilters", err.(smithy.InvalidParamsError)) + } + } + if v.SecurityLevelFilters != nil { + if err := validateCisSecurityLevelFilterList(v.SecurityLevelFilters); err != nil { + invalidParams.AddNested("SecurityLevelFilters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScanResultsAggregatedByTargetResourceFilterCriteria(v *types.CisScanResultsAggregatedByTargetResourceFilterCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScanResultsAggregatedByTargetResourceFilterCriteria"} + if v.AccountIdFilters != nil { + if err := validateAccountIdFilterList(v.AccountIdFilters); err != nil { + invalidParams.AddNested("AccountIdFilters", err.(smithy.InvalidParamsError)) + } + } + if v.StatusFilters != nil { + if err := validateCisResultStatusFilterList(v.StatusFilters); err != nil { + invalidParams.AddNested("StatusFilters", err.(smithy.InvalidParamsError)) + } + } + if v.CheckIdFilters != nil { + if err := validateCheckIdFilterList(v.CheckIdFilters); err != nil { + invalidParams.AddNested("CheckIdFilters", err.(smithy.InvalidParamsError)) + } + } + if v.TargetResourceIdFilters != nil { + if err := validateResourceIdFilterList(v.TargetResourceIdFilters); err != nil { + invalidParams.AddNested("TargetResourceIdFilters", err.(smithy.InvalidParamsError)) + } + } + if v.TargetResourceTagFilters != nil { + if err := validateResourceTagFilterList(v.TargetResourceTagFilters); err != nil { + invalidParams.AddNested("TargetResourceTagFilters", err.(smithy.InvalidParamsError)) + } + } + if v.PlatformFilters != nil { + if err := validatePlatformFilterList(v.PlatformFilters); err != nil { + invalidParams.AddNested("PlatformFilters", err.(smithy.InvalidParamsError)) + } + } + if v.TargetStatusFilters != nil { + if err := validateTargetStatusFilterList(v.TargetStatusFilters); err != nil { + invalidParams.AddNested("TargetStatusFilters", err.(smithy.InvalidParamsError)) + } + } + if v.TargetStatusReasonFilters != nil { + if err := validateTargetStatusReasonFilterList(v.TargetStatusReasonFilters); err != nil { + invalidParams.AddNested("TargetStatusReasonFilters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScanStatusFilter(v *types.CisScanStatusFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScanStatusFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if len(v.Value) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScanStatusFilterList(v []types.CisScanStatusFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScanStatusFilterList"} + for i := range v { + if err := validateCisScanStatusFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisScheduledByFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisScheduledByFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisSecurityLevelFilter(v *types.CisSecurityLevelFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisSecurityLevelFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if len(v.Value) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisSecurityLevelFilterList(v []types.CisSecurityLevelFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisSecurityLevelFilterList"} + for i := range v { + if err := validateCisSecurityLevelFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisSessionMessage(v *types.CisSessionMessage) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisSessionMessage"} + if v.RuleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleId")) + } + if len(v.Status) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Status")) + } + if v.CisRuleDetails == nil { + invalidParams.Add(smithy.NewErrParamRequired("CisRuleDetails")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisSessionMessages(v []types.CisSessionMessage) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisSessionMessages"} + for i := range v { + if err := validateCisSessionMessage(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisStringFilter(v *types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisStringFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisTargetStatusFilter(v *types.CisTargetStatusFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisTargetStatusFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if len(v.Value) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCisTargetStatusReasonFilter(v *types.CisTargetStatusReasonFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CisTargetStatusReasonFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if len(v.Value) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCoverageFilterCriteria(v *types.CoverageFilterCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CoverageFilterCriteria"} + if v.ScanStatusCode != nil { + if err := validateCoverageStringFilterList(v.ScanStatusCode); err != nil { + invalidParams.AddNested("ScanStatusCode", err.(smithy.InvalidParamsError)) + } + } + if v.ScanStatusReason != nil { + if err := validateCoverageStringFilterList(v.ScanStatusReason); err != nil { + invalidParams.AddNested("ScanStatusReason", err.(smithy.InvalidParamsError)) + } + } + if v.AccountId != nil { + if err := validateCoverageStringFilterList(v.AccountId); err != nil { + invalidParams.AddNested("AccountId", err.(smithy.InvalidParamsError)) + } + } + if v.ResourceId != nil { if err := validateCoverageStringFilterList(v.ResourceId); err != nil { invalidParams.AddNested("ResourceId", err.(smithy.InvalidParamsError)) } @@ -1051,6 +1840,43 @@ func validateCoverageStringFilterList(v []types.CoverageStringFilter) error { } } +func validateCreateCisTargets(v *types.CreateCisTargets) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateCisTargets"} + if v.AccountIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountIds")) + } + if v.TargetResourceTags == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetResourceTags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDailySchedule(v *types.DailySchedule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DailySchedule"} + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } else if v.StartTime != nil { + if err := validateTime(v.StartTime); err != nil { + invalidParams.AddNested("StartTime", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDestination(v *types.Destination) error { if v == nil { return nil @@ -1325,29 +2151,83 @@ func validateImageLayerAggregation(v *types.ImageLayerAggregation) error { } } -func validateLambdaFunctionAggregation(v *types.LambdaFunctionAggregation) error { +func validateLambdaFunctionAggregation(v *types.LambdaFunctionAggregation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaFunctionAggregation"} + if v.ResourceIds != nil { + if err := validateStringFilterList(v.ResourceIds); err != nil { + invalidParams.AddNested("ResourceIds", err.(smithy.InvalidParamsError)) + } + } + if v.FunctionNames != nil { + if err := validateStringFilterList(v.FunctionNames); err != nil { + invalidParams.AddNested("FunctionNames", err.(smithy.InvalidParamsError)) + } + } + if v.Runtimes != nil { + if err := validateStringFilterList(v.Runtimes); err != nil { + invalidParams.AddNested("Runtimes", err.(smithy.InvalidParamsError)) + } + } + if v.FunctionTags != nil { + if err := validateMapFilterList(v.FunctionTags); err != nil { + invalidParams.AddNested("FunctionTags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaLayerAggregation(v *types.LambdaLayerAggregation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaLayerAggregation"} + if v.FunctionNames != nil { + if err := validateStringFilterList(v.FunctionNames); err != nil { + invalidParams.AddNested("FunctionNames", err.(smithy.InvalidParamsError)) + } + } + if v.ResourceIds != nil { + if err := validateStringFilterList(v.ResourceIds); err != nil { + invalidParams.AddNested("ResourceIds", err.(smithy.InvalidParamsError)) + } + } + if v.LayerArns != nil { + if err := validateStringFilterList(v.LayerArns); err != nil { + invalidParams.AddNested("LayerArns", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateListCisScanConfigurationsFilterCriteria(v *types.ListCisScanConfigurationsFilterCriteria) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "LambdaFunctionAggregation"} - if v.ResourceIds != nil { - if err := validateStringFilterList(v.ResourceIds); err != nil { - invalidParams.AddNested("ResourceIds", err.(smithy.InvalidParamsError)) - } - } - if v.FunctionNames != nil { - if err := validateStringFilterList(v.FunctionNames); err != nil { - invalidParams.AddNested("FunctionNames", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "ListCisScanConfigurationsFilterCriteria"} + if v.ScanNameFilters != nil { + if err := validateCisScanNameFilterList(v.ScanNameFilters); err != nil { + invalidParams.AddNested("ScanNameFilters", err.(smithy.InvalidParamsError)) } } - if v.Runtimes != nil { - if err := validateStringFilterList(v.Runtimes); err != nil { - invalidParams.AddNested("Runtimes", err.(smithy.InvalidParamsError)) + if v.TargetResourceTagFilters != nil { + if err := validateResourceTagFilterList(v.TargetResourceTagFilters); err != nil { + invalidParams.AddNested("TargetResourceTagFilters", err.(smithy.InvalidParamsError)) } } - if v.FunctionTags != nil { - if err := validateMapFilterList(v.FunctionTags); err != nil { - invalidParams.AddNested("FunctionTags", err.(smithy.InvalidParamsError)) + if v.ScanConfigurationArnFilters != nil { + if err := validateCisScanConfigurationArnFilterList(v.ScanConfigurationArnFilters); err != nil { + invalidParams.AddNested("ScanConfigurationArnFilters", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1357,24 +2237,49 @@ func validateLambdaFunctionAggregation(v *types.LambdaFunctionAggregation) error } } -func validateLambdaLayerAggregation(v *types.LambdaLayerAggregation) error { +func validateListCisScansFilterCriteria(v *types.ListCisScansFilterCriteria) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "LambdaLayerAggregation"} - if v.FunctionNames != nil { - if err := validateStringFilterList(v.FunctionNames); err != nil { - invalidParams.AddNested("FunctionNames", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "ListCisScansFilterCriteria"} + if v.ScanNameFilters != nil { + if err := validateCisScanNameFilterList(v.ScanNameFilters); err != nil { + invalidParams.AddNested("ScanNameFilters", err.(smithy.InvalidParamsError)) } } - if v.ResourceIds != nil { - if err := validateStringFilterList(v.ResourceIds); err != nil { - invalidParams.AddNested("ResourceIds", err.(smithy.InvalidParamsError)) + if v.TargetResourceTagFilters != nil { + if err := validateResourceTagFilterList(v.TargetResourceTagFilters); err != nil { + invalidParams.AddNested("TargetResourceTagFilters", err.(smithy.InvalidParamsError)) } } - if v.LayerArns != nil { - if err := validateStringFilterList(v.LayerArns); err != nil { - invalidParams.AddNested("LayerArns", err.(smithy.InvalidParamsError)) + if v.TargetResourceIdFilters != nil { + if err := validateResourceIdFilterList(v.TargetResourceIdFilters); err != nil { + invalidParams.AddNested("TargetResourceIdFilters", err.(smithy.InvalidParamsError)) + } + } + if v.ScanStatusFilters != nil { + if err := validateCisScanStatusFilterList(v.ScanStatusFilters); err != nil { + invalidParams.AddNested("ScanStatusFilters", err.(smithy.InvalidParamsError)) + } + } + if v.ScanConfigurationArnFilters != nil { + if err := validateCisScanConfigurationArnFilterList(v.ScanConfigurationArnFilters); err != nil { + invalidParams.AddNested("ScanConfigurationArnFilters", err.(smithy.InvalidParamsError)) + } + } + if v.ScanArnFilters != nil { + if err := validateCisScanArnFilterList(v.ScanArnFilters); err != nil { + invalidParams.AddNested("ScanArnFilters", err.(smithy.InvalidParamsError)) + } + } + if v.ScheduledByFilters != nil { + if err := validateCisScheduledByFilterList(v.ScheduledByFilters); err != nil { + invalidParams.AddNested("ScheduledByFilters", err.(smithy.InvalidParamsError)) + } + } + if v.TargetAccountIdFilters != nil { + if err := validateAccountIdFilterList(v.TargetAccountIdFilters); err != nil { + invalidParams.AddNested("TargetAccountIdFilters", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1454,6 +2359,45 @@ func validateMemberAccountEc2DeepInspectionStatusList(v []types.MemberAccountEc2 } } +func validateMonthlySchedule(v *types.MonthlySchedule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MonthlySchedule"} + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } else if v.StartTime != nil { + if err := validateTime(v.StartTime); err != nil { + invalidParams.AddNested("StartTime", err.(smithy.InvalidParamsError)) + } + } + if len(v.Day) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Day")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOneAccountIdFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OneAccountIdFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validatePackageAggregation(v *types.PackageAggregation) error { if v == nil { return nil @@ -1530,6 +2474,23 @@ func validatePackageFilterList(v []types.PackageFilter) error { } } +func validatePlatformFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PlatformFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRepositoryAggregation(v *types.RepositoryAggregation) error { if v == nil { return nil @@ -1582,15 +2543,214 @@ func validateResourceFilterCriteria(v *types.ResourceFilterCriteria) error { invalidParams.AddNested("EcrImageTags", err.(smithy.InvalidParamsError)) } } - if v.Ec2InstanceTags != nil { - if err := validateResourceMapFilterList(v.Ec2InstanceTags); err != nil { - invalidParams.AddNested("Ec2InstanceTags", err.(smithy.InvalidParamsError)) - } + if v.Ec2InstanceTags != nil { + if err := validateResourceMapFilterList(v.Ec2InstanceTags); err != nil { + invalidParams.AddNested("Ec2InstanceTags", err.(smithy.InvalidParamsError)) + } + } + if v.LambdaFunctionTags != nil { + if err := validateResourceMapFilterList(v.LambdaFunctionTags); err != nil { + invalidParams.AddNested("LambdaFunctionTags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceIdFilterList(v []types.CisStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceIdFilterList"} + for i := range v { + if err := validateCisStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceMapFilter(v *types.ResourceMapFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceMapFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceMapFilterList(v []types.ResourceMapFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceMapFilterList"} + for i := range v { + if err := validateResourceMapFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceStringFilter(v *types.ResourceStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceStringFilter"} + if len(v.Comparison) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceStringFilterList(v []types.ResourceStringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceStringFilterList"} + for i := range v { + if err := validateResourceStringFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceTagFilterList(v []types.TagFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceTagFilterList"} + for i := range v { + if err := validateTagFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSchedule(v types.Schedule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Schedule"} + switch uv := v.(type) { + case *types.ScheduleMemberDaily: + if err := validateDailySchedule(&uv.Value); err != nil { + invalidParams.AddNested("[daily]", err.(smithy.InvalidParamsError)) + } + + case *types.ScheduleMemberMonthly: + if err := validateMonthlySchedule(&uv.Value); err != nil { + invalidParams.AddNested("[monthly]", err.(smithy.InvalidParamsError)) + } + + case *types.ScheduleMemberWeekly: + if err := validateWeeklySchedule(&uv.Value); err != nil { + invalidParams.AddNested("[weekly]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSearchVulnerabilitiesFilterCriteria(v *types.SearchVulnerabilitiesFilterCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchVulnerabilitiesFilterCriteria"} + if v.VulnerabilityIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("VulnerabilityIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSortCriteria(v *types.SortCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SortCriteria"} + if len(v.Field) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Field")) + } + if len(v.SortOrder) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SortOrder")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStartCisSessionMessage(v *types.StartCisSessionMessage) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartCisSessionMessage"} + if v.SessionToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStopCisSessionMessage(v *types.StopCisSessionMessage) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopCisSessionMessage"} + if len(v.Status) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Status")) } - if v.LambdaFunctionTags != nil { - if err := validateResourceMapFilterList(v.LambdaFunctionTags); err != nil { - invalidParams.AddNested("LambdaFunctionTags", err.(smithy.InvalidParamsError)) - } + if v.Progress == nil { + invalidParams.Add(smithy.NewErrParamRequired("Progress")) } if invalidParams.Len() > 0 { return invalidParams @@ -1599,16 +2759,16 @@ func validateResourceFilterCriteria(v *types.ResourceFilterCriteria) error { } } -func validateResourceMapFilter(v *types.ResourceMapFilter) error { +func validateStringFilter(v *types.StringFilter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ResourceMapFilter"} + invalidParams := smithy.InvalidParamsError{Context: "StringFilter"} if len(v.Comparison) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Comparison")) } - if v.Key == nil { - invalidParams.Add(smithy.NewErrParamRequired("Key")) + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams @@ -1617,13 +2777,13 @@ func validateResourceMapFilter(v *types.ResourceMapFilter) error { } } -func validateResourceMapFilterList(v []types.ResourceMapFilter) error { +func validateStringFilterList(v []types.StringFilter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ResourceMapFilterList"} + invalidParams := smithy.InvalidParamsError{Context: "StringFilterList"} for i := range v { - if err := validateResourceMapFilter(&v[i]); err != nil { + if err := validateStringFilter(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } @@ -1634,14 +2794,17 @@ func validateResourceMapFilterList(v []types.ResourceMapFilter) error { } } -func validateResourceStringFilter(v *types.ResourceStringFilter) error { +func validateTagFilter(v *types.TagFilter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ResourceStringFilter"} + invalidParams := smithy.InvalidParamsError{Context: "TagFilter"} if len(v.Comparison) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Comparison")) } + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } @@ -1652,13 +2815,13 @@ func validateResourceStringFilter(v *types.ResourceStringFilter) error { } } -func validateResourceStringFilterList(v []types.ResourceStringFilter) error { +func validateTargetStatusFilterList(v []types.CisTargetStatusFilter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ResourceStringFilterList"} + invalidParams := smithy.InvalidParamsError{Context: "TargetStatusFilterList"} for i := range v { - if err := validateResourceStringFilter(&v[i]); err != nil { + if err := validateCisTargetStatusFilter(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } @@ -1669,13 +2832,15 @@ func validateResourceStringFilterList(v []types.ResourceStringFilter) error { } } -func validateSearchVulnerabilitiesFilterCriteria(v *types.SearchVulnerabilitiesFilterCriteria) error { +func validateTargetStatusReasonFilterList(v []types.CisTargetStatusReasonFilter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "SearchVulnerabilitiesFilterCriteria"} - if v.VulnerabilityIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("VulnerabilityIds")) + invalidParams := smithy.InvalidParamsError{Context: "TargetStatusReasonFilterList"} + for i := range v { + if err := validateCisTargetStatusReasonFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1684,16 +2849,16 @@ func validateSearchVulnerabilitiesFilterCriteria(v *types.SearchVulnerabilitiesF } } -func validateSortCriteria(v *types.SortCriteria) error { +func validateTime(v *types.Time) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "SortCriteria"} - if len(v.Field) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Field")) + invalidParams := smithy.InvalidParamsError{Context: "Time"} + if v.TimeOfDay == nil { + invalidParams.Add(smithy.NewErrParamRequired("TimeOfDay")) } - if len(v.SortOrder) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("SortOrder")) + if v.Timezone == nil { + invalidParams.Add(smithy.NewErrParamRequired("Timezone")) } if invalidParams.Len() > 0 { return invalidParams @@ -1702,16 +2867,20 @@ func validateSortCriteria(v *types.SortCriteria) error { } } -func validateStringFilter(v *types.StringFilter) error { +func validateTitleAggregation(v *types.TitleAggregation) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "StringFilter"} - if len(v.Comparison) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Comparison")) + invalidParams := smithy.InvalidParamsError{Context: "TitleAggregation"} + if v.Titles != nil { + if err := validateStringFilterList(v.Titles); err != nil { + invalidParams.AddNested("Titles", err.(smithy.InvalidParamsError)) + } } - if v.Value == nil { - invalidParams.Add(smithy.NewErrParamRequired("Value")) + if v.VulnerabilityIds != nil { + if err := validateStringFilterList(v.VulnerabilityIds); err != nil { + invalidParams.AddNested("VulnerabilityIds", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1720,13 +2889,13 @@ func validateStringFilter(v *types.StringFilter) error { } } -func validateStringFilterList(v []types.StringFilter) error { +func validateTitleFilterList(v []types.CisStringFilter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "StringFilterList"} + invalidParams := smithy.InvalidParamsError{Context: "TitleFilterList"} for i := range v { - if err := validateStringFilter(&v[i]); err != nil { + if err := validateCisStringFilter(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } @@ -1737,20 +2906,20 @@ func validateStringFilterList(v []types.StringFilter) error { } } -func validateTitleAggregation(v *types.TitleAggregation) error { +func validateWeeklySchedule(v *types.WeeklySchedule) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "TitleAggregation"} - if v.Titles != nil { - if err := validateStringFilterList(v.Titles); err != nil { - invalidParams.AddNested("Titles", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "WeeklySchedule"} + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } else if v.StartTime != nil { + if err := validateTime(v.StartTime); err != nil { + invalidParams.AddNested("StartTime", err.(smithy.InvalidParamsError)) } } - if v.VulnerabilityIds != nil { - if err := validateStringFilterList(v.VulnerabilityIds); err != nil { - invalidParams.AddNested("VulnerabilityIds", err.(smithy.InvalidParamsError)) - } + if v.Days == nil { + invalidParams.Add(smithy.NewErrParamRequired("Days")) } if invalidParams.Len() > 0 { return invalidParams @@ -1868,6 +3037,38 @@ func validateOpCancelSbomExportInput(v *CancelSbomExportInput) error { } } +func validateOpCreateCisScanConfigurationInput(v *CreateCisScanConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateCisScanConfigurationInput"} + if v.ScanName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanName")) + } + if len(v.SecurityLevel) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SecurityLevel")) + } + if v.Schedule == nil { + invalidParams.Add(smithy.NewErrParamRequired("Schedule")) + } else if v.Schedule != nil { + if err := validateSchedule(v.Schedule); err != nil { + invalidParams.AddNested("Schedule", err.(smithy.InvalidParamsError)) + } + } + if v.Targets == nil { + invalidParams.Add(smithy.NewErrParamRequired("Targets")) + } else if v.Targets != nil { + if err := validateCreateCisTargets(v.Targets); err != nil { + invalidParams.AddNested("Targets", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateFilterInput(v *CreateFilterInput) error { if v == nil { return nil @@ -1947,6 +3148,21 @@ func validateOpCreateSbomExportInput(v *CreateSbomExportInput) error { } } +func validateOpDeleteCisScanConfigurationInput(v *DeleteCisScanConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCisScanConfigurationInput"} + if v.ScanConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanConfigurationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteFilterInput(v *DeleteFilterInput) error { if v == nil { return nil @@ -2022,6 +3238,47 @@ func validateOpEnableInput(v *EnableInput) error { } } +func validateOpGetCisScanReportInput(v *GetCisScanReportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCisScanReportInput"} + if v.ScanArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCisScanResultDetailsInput(v *GetCisScanResultDetailsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCisScanResultDetailsInput"} + if v.ScanArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanArn")) + } + if v.TargetResourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetResourceId")) + } + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.FilterCriteria != nil { + if err := validateCisScanResultDetailsFilterCriteria(v.FilterCriteria); err != nil { + invalidParams.AddNested("FilterCriteria", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetEncryptionKeyInput(v *GetEncryptionKeyInput) error { if v == nil { return nil @@ -2070,6 +3327,80 @@ func validateOpGetSbomExportInput(v *GetSbomExportInput) error { } } +func validateOpListCisScanConfigurationsInput(v *ListCisScanConfigurationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCisScanConfigurationsInput"} + if v.FilterCriteria != nil { + if err := validateListCisScanConfigurationsFilterCriteria(v.FilterCriteria); err != nil { + invalidParams.AddNested("FilterCriteria", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListCisScanResultsAggregatedByChecksInput(v *ListCisScanResultsAggregatedByChecksInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCisScanResultsAggregatedByChecksInput"} + if v.ScanArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanArn")) + } + if v.FilterCriteria != nil { + if err := validateCisScanResultsAggregatedByChecksFilterCriteria(v.FilterCriteria); err != nil { + invalidParams.AddNested("FilterCriteria", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListCisScanResultsAggregatedByTargetResourceInput(v *ListCisScanResultsAggregatedByTargetResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCisScanResultsAggregatedByTargetResourceInput"} + if v.ScanArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanArn")) + } + if v.FilterCriteria != nil { + if err := validateCisScanResultsAggregatedByTargetResourceFilterCriteria(v.FilterCriteria); err != nil { + invalidParams.AddNested("FilterCriteria", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListCisScansInput(v *ListCisScansInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCisScansInput"} + if v.FilterCriteria != nil { + if err := validateListCisScansFilterCriteria(v.FilterCriteria); err != nil { + invalidParams.AddNested("FilterCriteria", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListCoverageInput(v *ListCoverageInput) error { if v == nil { return nil @@ -2203,6 +3534,96 @@ func validateOpSearchVulnerabilitiesInput(v *SearchVulnerabilitiesInput) error { } } +func validateOpSendCisSessionHealthInput(v *SendCisSessionHealthInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendCisSessionHealthInput"} + if v.ScanJobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanJobId")) + } + if v.SessionToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendCisSessionTelemetryInput(v *SendCisSessionTelemetryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendCisSessionTelemetryInput"} + if v.ScanJobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanJobId")) + } + if v.SessionToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionToken")) + } + if v.Messages == nil { + invalidParams.Add(smithy.NewErrParamRequired("Messages")) + } else if v.Messages != nil { + if err := validateCisSessionMessages(v.Messages); err != nil { + invalidParams.AddNested("Messages", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartCisSessionInput(v *StartCisSessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartCisSessionInput"} + if v.ScanJobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanJobId")) + } + if v.Message == nil { + invalidParams.Add(smithy.NewErrParamRequired("Message")) + } else if v.Message != nil { + if err := validateStartCisSessionMessage(v.Message); err != nil { + invalidParams.AddNested("Message", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopCisSessionInput(v *StopCisSessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopCisSessionInput"} + if v.ScanJobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanJobId")) + } + if v.SessionToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionToken")) + } + if v.Message == nil { + invalidParams.Add(smithy.NewErrParamRequired("Message")) + } else if v.Message != nil { + if err := validateStopCisSessionMessage(v.Message); err != nil { + invalidParams.AddNested("Message", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil @@ -2239,6 +3660,26 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateCisScanConfigurationInput(v *UpdateCisScanConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCisScanConfigurationInput"} + if v.ScanConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanConfigurationArn")) + } + if v.Schedule != nil { + if err := validateSchedule(v.Schedule); err != nil { + invalidParams.AddNested("Schedule", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateConfigurationInput(v *UpdateConfigurationInput) error { if v == nil { return nil