repo_name stringlengths 1 52 | repo_creator stringclasses 6
values | programming_language stringclasses 4
values | code stringlengths 0 9.68M | num_lines int64 1 234k |
|---|---|---|---|---|
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// List the Packages that are associated with an Image Build Version, as
// determined by Amazon Web Services Systems Manager Inventory at build time.
func (c *Client) ListImagePackages(ctx context.Context, params *ListImagePackagesInput, optFns ...func(*Options)) (*ListImagePackagesOutput, error) {
if params == nil {
params = &ListImagePackagesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImagePackages", params, optFns, c.addOperationListImagePackagesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImagePackagesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListImagePackagesInput struct {
// Filter results for the ListImagePackages request by the Image Build Version ARN
//
// This member is required.
ImageBuildVersionArn *string
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
noSmithyDocumentSerde
}
type ListImagePackagesOutput struct {
// The list of Image Packages returned in the response.
ImagePackageList []types.ImagePackage
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImagePackagesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImagePackages{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImagePackages{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListImagePackagesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImagePackages(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
}
return nil
}
// ListImagePackagesAPIClient is a client that implements the ListImagePackages
// operation.
type ListImagePackagesAPIClient interface {
ListImagePackages(context.Context, *ListImagePackagesInput, ...func(*Options)) (*ListImagePackagesOutput, error)
}
var _ ListImagePackagesAPIClient = (*Client)(nil)
// ListImagePackagesPaginatorOptions is the paginator options for ListImagePackages
type ListImagePackagesPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListImagePackagesPaginator is a paginator for ListImagePackages
type ListImagePackagesPaginator struct {
options ListImagePackagesPaginatorOptions
client ListImagePackagesAPIClient
params *ListImagePackagesInput
nextToken *string
firstPage bool
}
// NewListImagePackagesPaginator returns a new ListImagePackagesPaginator
func NewListImagePackagesPaginator(client ListImagePackagesAPIClient, params *ListImagePackagesInput, optFns ...func(*ListImagePackagesPaginatorOptions)) *ListImagePackagesPaginator {
if params == nil {
params = &ListImagePackagesInput{}
}
options := ListImagePackagesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListImagePackagesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImagePackagesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImagePackages page.
func (p *ListImagePackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagePackagesOutput, 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.ListImagePackages(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_opListImagePackages(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListImagePackages",
}
}
| 232 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of images created by the specified pipeline.
func (c *Client) ListImagePipelineImages(ctx context.Context, params *ListImagePipelineImagesInput, optFns ...func(*Options)) (*ListImagePipelineImagesOutput, error) {
if params == nil {
params = &ListImagePipelineImagesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImagePipelineImages", params, optFns, c.addOperationListImagePipelineImagesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImagePipelineImagesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListImagePipelineImagesInput struct {
// The Amazon Resource Name (ARN) of the image pipeline whose images you want to
// view.
//
// This member is required.
ImagePipelineArn *string
// Use the following filters to streamline results:
// - name
// - version
Filters []types.Filter
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
noSmithyDocumentSerde
}
type ListImagePipelineImagesOutput struct {
// The list of images built by this pipeline.
ImageSummaryList []types.ImageSummary
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImagePipelineImagesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImagePipelineImages{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImagePipelineImages{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListImagePipelineImagesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImagePipelineImages(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
}
return nil
}
// ListImagePipelineImagesAPIClient is a client that implements the
// ListImagePipelineImages operation.
type ListImagePipelineImagesAPIClient interface {
ListImagePipelineImages(context.Context, *ListImagePipelineImagesInput, ...func(*Options)) (*ListImagePipelineImagesOutput, error)
}
var _ ListImagePipelineImagesAPIClient = (*Client)(nil)
// ListImagePipelineImagesPaginatorOptions is the paginator options for
// ListImagePipelineImages
type ListImagePipelineImagesPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListImagePipelineImagesPaginator is a paginator for ListImagePipelineImages
type ListImagePipelineImagesPaginator struct {
options ListImagePipelineImagesPaginatorOptions
client ListImagePipelineImagesAPIClient
params *ListImagePipelineImagesInput
nextToken *string
firstPage bool
}
// NewListImagePipelineImagesPaginator returns a new
// ListImagePipelineImagesPaginator
func NewListImagePipelineImagesPaginator(client ListImagePipelineImagesAPIClient, params *ListImagePipelineImagesInput, optFns ...func(*ListImagePipelineImagesPaginatorOptions)) *ListImagePipelineImagesPaginator {
if params == nil {
params = &ListImagePipelineImagesInput{}
}
options := ListImagePipelineImagesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListImagePipelineImagesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImagePipelineImagesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImagePipelineImages page.
func (p *ListImagePipelineImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagePipelineImagesOutput, 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.ListImagePipelineImages(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_opListImagePipelineImages(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListImagePipelineImages",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of image pipelines.
func (c *Client) ListImagePipelines(ctx context.Context, params *ListImagePipelinesInput, optFns ...func(*Options)) (*ListImagePipelinesOutput, error) {
if params == nil {
params = &ListImagePipelinesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImagePipelines", params, optFns, c.addOperationListImagePipelinesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImagePipelinesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListImagePipelinesInput struct {
// Use the following filters to streamline results:
// - description
// - distributionConfigurationArn
// - imageRecipeArn
// - infrastructureConfigurationArn
// - name
// - status
Filters []types.Filter
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
noSmithyDocumentSerde
}
type ListImagePipelinesOutput struct {
// The list of image pipelines.
ImagePipelineList []types.ImagePipeline
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImagePipelinesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImagePipelines{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImagePipelines{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImagePipelines(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
}
return nil
}
// ListImagePipelinesAPIClient is a client that implements the ListImagePipelines
// operation.
type ListImagePipelinesAPIClient interface {
ListImagePipelines(context.Context, *ListImagePipelinesInput, ...func(*Options)) (*ListImagePipelinesOutput, error)
}
var _ ListImagePipelinesAPIClient = (*Client)(nil)
// ListImagePipelinesPaginatorOptions is the paginator options for
// ListImagePipelines
type ListImagePipelinesPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListImagePipelinesPaginator is a paginator for ListImagePipelines
type ListImagePipelinesPaginator struct {
options ListImagePipelinesPaginatorOptions
client ListImagePipelinesAPIClient
params *ListImagePipelinesInput
nextToken *string
firstPage bool
}
// NewListImagePipelinesPaginator returns a new ListImagePipelinesPaginator
func NewListImagePipelinesPaginator(client ListImagePipelinesAPIClient, params *ListImagePipelinesInput, optFns ...func(*ListImagePipelinesPaginatorOptions)) *ListImagePipelinesPaginator {
if params == nil {
params = &ListImagePipelinesInput{}
}
options := ListImagePipelinesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListImagePipelinesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImagePipelinesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImagePipelines page.
func (p *ListImagePipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagePipelinesOutput, 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.ListImagePipelines(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_opListImagePipelines(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListImagePipelines",
}
}
| 233 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of image recipes.
func (c *Client) ListImageRecipes(ctx context.Context, params *ListImageRecipesInput, optFns ...func(*Options)) (*ListImageRecipesOutput, error) {
if params == nil {
params = &ListImageRecipesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImageRecipes", params, optFns, c.addOperationListImageRecipesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImageRecipesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListImageRecipesInput struct {
// Use the following filters to streamline results:
// - name
// - parentImage
// - platform
Filters []types.Filter
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
// The owner defines which image recipes you want to list. By default, this
// request will only show image recipes owned by your account. You can use this
// field to specify if you want to view image recipes owned by yourself, by Amazon,
// or those image recipes that have been shared with you by other customers.
Owner types.Ownership
noSmithyDocumentSerde
}
type ListImageRecipesOutput struct {
// The list of image pipelines.
ImageRecipeSummaryList []types.ImageRecipeSummary
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImageRecipesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImageRecipes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImageRecipes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImageRecipes(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
}
return nil
}
// ListImageRecipesAPIClient is a client that implements the ListImageRecipes
// operation.
type ListImageRecipesAPIClient interface {
ListImageRecipes(context.Context, *ListImageRecipesInput, ...func(*Options)) (*ListImageRecipesOutput, error)
}
var _ ListImageRecipesAPIClient = (*Client)(nil)
// ListImageRecipesPaginatorOptions is the paginator options for ListImageRecipes
type ListImageRecipesPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListImageRecipesPaginator is a paginator for ListImageRecipes
type ListImageRecipesPaginator struct {
options ListImageRecipesPaginatorOptions
client ListImageRecipesAPIClient
params *ListImageRecipesInput
nextToken *string
firstPage bool
}
// NewListImageRecipesPaginator returns a new ListImageRecipesPaginator
func NewListImageRecipesPaginator(client ListImageRecipesAPIClient, params *ListImageRecipesInput, optFns ...func(*ListImageRecipesPaginatorOptions)) *ListImageRecipesPaginator {
if params == nil {
params = &ListImageRecipesInput{}
}
options := ListImageRecipesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListImageRecipesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImageRecipesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImageRecipes page.
func (p *ListImageRecipesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageRecipesOutput, 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.ListImageRecipes(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_opListImageRecipes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListImageRecipes",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the list of images that you have access to. Newly created images can
// take up to two minutes to appear in the ListImages API Results.
func (c *Client) ListImages(ctx context.Context, params *ListImagesInput, optFns ...func(*Options)) (*ListImagesOutput, error) {
if params == nil {
params = &ListImagesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImages", params, optFns, c.addOperationListImagesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImagesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListImagesInput struct {
// Requests a list of images with a specific recipe name.
ByName bool
// Use the following filters to streamline results:
// - name
// - osVersion
// - platform
// - type
// - version
Filters []types.Filter
// Includes deprecated images in the response list.
IncludeDeprecated *bool
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
// The owner defines which images you want to list. By default, this request will
// only show images owned by your account. You can use this field to specify if you
// want to view images owned by yourself, by Amazon, or those images that have been
// shared with you by other customers.
Owner types.Ownership
noSmithyDocumentSerde
}
type ListImagesOutput struct {
// The list of image semantic versions. The semantic version has four nodes: ../.
// You can assign values for the first three, and can filter on all of them.
// Filtering: With semantic versioning, you have the flexibility to use wildcards
// (x) to specify the most recent versions or nodes when selecting the base image
// or components for your recipe. When you use a wildcard in any node, all nodes to
// the right of the first wildcard must also be wildcards.
ImageVersionList []types.ImageVersion
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImages{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImages{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImages(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
}
return nil
}
// ListImagesAPIClient is a client that implements the ListImages operation.
type ListImagesAPIClient interface {
ListImages(context.Context, *ListImagesInput, ...func(*Options)) (*ListImagesOutput, error)
}
var _ ListImagesAPIClient = (*Client)(nil)
// ListImagesPaginatorOptions is the paginator options for ListImages
type ListImagesPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListImagesPaginator is a paginator for ListImages
type ListImagesPaginator struct {
options ListImagesPaginatorOptions
client ListImagesAPIClient
params *ListImagesInput
nextToken *string
firstPage bool
}
// NewListImagesPaginator returns a new ListImagesPaginator
func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator {
if params == nil {
params = &ListImagesInput{}
}
options := ListImagesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListImagesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImagesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImages page.
func (p *ListImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesOutput, 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.ListImages(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_opListImages(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListImages",
}
}
| 248 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of image scan aggregations for your account. You can filter by
// the type of key that Image Builder uses to group results. For example, if you
// want to get a list of findings by severity level for one of your pipelines, you
// might specify your pipeline with the imagePipelineArn filter. If you don't
// specify a filter, Image Builder returns an aggregation for your account. To
// streamline results, you can use the following filters in your request:
// - accountId
// - imageBuildVersionArn
// - imagePipelineArn
// - vulnerabilityId
func (c *Client) ListImageScanFindingAggregations(ctx context.Context, params *ListImageScanFindingAggregationsInput, optFns ...func(*Options)) (*ListImageScanFindingAggregationsOutput, error) {
if params == nil {
params = &ListImageScanFindingAggregationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImageScanFindingAggregations", params, optFns, c.addOperationListImageScanFindingAggregationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImageScanFindingAggregationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListImageScanFindingAggregationsInput struct {
// A filter name and value pair that is used to return a more specific list of
// results from a list operation. Filters can be used to match a set of resources
// by specific criteria, such as tags, attributes, or IDs.
Filter *types.Filter
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
noSmithyDocumentSerde
}
type ListImageScanFindingAggregationsOutput struct {
// The aggregation type specifies what type of key is used to group the image scan
// findings. Image Builder returns results based on the request filter. If you
// didn't specify a filter in the request, the type defaults to accountId .
// Aggregation types
// - accountId
// - imageBuildVersionArn
// - imagePipelineArn
// - vulnerabilityId
// Each aggregation includes counts by severity level for medium severity and
// higher level findings, plus a total for all of the findings for each key value.
AggregationType *string
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// An array of image scan finding aggregations that match the filter criteria.
Responses []types.ImageScanFindingAggregation
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImageScanFindingAggregationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImageScanFindingAggregations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImageScanFindingAggregations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImageScanFindingAggregations(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
}
return nil
}
// ListImageScanFindingAggregationsAPIClient is a client that implements the
// ListImageScanFindingAggregations operation.
type ListImageScanFindingAggregationsAPIClient interface {
ListImageScanFindingAggregations(context.Context, *ListImageScanFindingAggregationsInput, ...func(*Options)) (*ListImageScanFindingAggregationsOutput, error)
}
var _ ListImageScanFindingAggregationsAPIClient = (*Client)(nil)
// ListImageScanFindingAggregationsPaginatorOptions is the paginator options for
// ListImageScanFindingAggregations
type ListImageScanFindingAggregationsPaginatorOptions struct {
// 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
}
// ListImageScanFindingAggregationsPaginator is a paginator for
// ListImageScanFindingAggregations
type ListImageScanFindingAggregationsPaginator struct {
options ListImageScanFindingAggregationsPaginatorOptions
client ListImageScanFindingAggregationsAPIClient
params *ListImageScanFindingAggregationsInput
nextToken *string
firstPage bool
}
// NewListImageScanFindingAggregationsPaginator returns a new
// ListImageScanFindingAggregationsPaginator
func NewListImageScanFindingAggregationsPaginator(client ListImageScanFindingAggregationsAPIClient, params *ListImageScanFindingAggregationsInput, optFns ...func(*ListImageScanFindingAggregationsPaginatorOptions)) *ListImageScanFindingAggregationsPaginator {
if params == nil {
params = &ListImageScanFindingAggregationsInput{}
}
options := ListImageScanFindingAggregationsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListImageScanFindingAggregationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImageScanFindingAggregationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImageScanFindingAggregations page.
func (p *ListImageScanFindingAggregationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageScanFindingAggregationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
result, err := p.client.ListImageScanFindingAggregations(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_opListImageScanFindingAggregations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListImageScanFindingAggregations",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of image scan findings for your account.
func (c *Client) ListImageScanFindings(ctx context.Context, params *ListImageScanFindingsInput, optFns ...func(*Options)) (*ListImageScanFindingsOutput, error) {
if params == nil {
params = &ListImageScanFindingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImageScanFindings", params, optFns, c.addOperationListImageScanFindingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImageScanFindingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListImageScanFindingsInput struct {
// An array of name value pairs that you can use to filter your results. You can
// use the following filters to streamline results:
// - imageBuildVersionArn
// - imagePipelineArn
// - vulnerabilityId
// - severity
// If you don't request a filter, then all findings in your account are listed.
Filters []types.ImageScanFindingsFilter
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
noSmithyDocumentSerde
}
type ListImageScanFindingsOutput struct {
// The image scan findings for your account that meet your request filter criteria.
Findings []types.ImageScanFinding
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImageScanFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImageScanFindings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImageScanFindings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImageScanFindings(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
}
return nil
}
// ListImageScanFindingsAPIClient is a client that implements the
// ListImageScanFindings operation.
type ListImageScanFindingsAPIClient interface {
ListImageScanFindings(context.Context, *ListImageScanFindingsInput, ...func(*Options)) (*ListImageScanFindingsOutput, error)
}
var _ ListImageScanFindingsAPIClient = (*Client)(nil)
// ListImageScanFindingsPaginatorOptions is the paginator options for
// ListImageScanFindings
type ListImageScanFindingsPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListImageScanFindingsPaginator is a paginator for ListImageScanFindings
type ListImageScanFindingsPaginator struct {
options ListImageScanFindingsPaginatorOptions
client ListImageScanFindingsAPIClient
params *ListImageScanFindingsInput
nextToken *string
firstPage bool
}
// NewListImageScanFindingsPaginator returns a new ListImageScanFindingsPaginator
func NewListImageScanFindingsPaginator(client ListImageScanFindingsAPIClient, params *ListImageScanFindingsInput, optFns ...func(*ListImageScanFindingsPaginatorOptions)) *ListImageScanFindingsPaginator {
if params == nil {
params = &ListImageScanFindingsInput{}
}
options := ListImageScanFindingsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListImageScanFindingsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImageScanFindingsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImageScanFindings page.
func (p *ListImageScanFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageScanFindingsOutput, 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.ListImageScanFindings(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_opListImageScanFindings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListImageScanFindings",
}
}
| 233 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of infrastructure configurations.
func (c *Client) ListInfrastructureConfigurations(ctx context.Context, params *ListInfrastructureConfigurationsInput, optFns ...func(*Options)) (*ListInfrastructureConfigurationsOutput, error) {
if params == nil {
params = &ListInfrastructureConfigurationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListInfrastructureConfigurations", params, optFns, c.addOperationListInfrastructureConfigurationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListInfrastructureConfigurationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListInfrastructureConfigurationsInput struct {
// You can filter on name to streamline results.
Filters []types.Filter
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
noSmithyDocumentSerde
}
type ListInfrastructureConfigurationsOutput struct {
// The list of infrastructure configurations.
InfrastructureConfigurationSummaryList []types.InfrastructureConfigurationSummary
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListInfrastructureConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListInfrastructureConfigurations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListInfrastructureConfigurations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInfrastructureConfigurations(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
}
return nil
}
// ListInfrastructureConfigurationsAPIClient is a client that implements the
// ListInfrastructureConfigurations operation.
type ListInfrastructureConfigurationsAPIClient interface {
ListInfrastructureConfigurations(context.Context, *ListInfrastructureConfigurationsInput, ...func(*Options)) (*ListInfrastructureConfigurationsOutput, error)
}
var _ ListInfrastructureConfigurationsAPIClient = (*Client)(nil)
// ListInfrastructureConfigurationsPaginatorOptions is the paginator options for
// ListInfrastructureConfigurations
type ListInfrastructureConfigurationsPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListInfrastructureConfigurationsPaginator is a paginator for
// ListInfrastructureConfigurations
type ListInfrastructureConfigurationsPaginator struct {
options ListInfrastructureConfigurationsPaginatorOptions
client ListInfrastructureConfigurationsAPIClient
params *ListInfrastructureConfigurationsInput
nextToken *string
firstPage bool
}
// NewListInfrastructureConfigurationsPaginator returns a new
// ListInfrastructureConfigurationsPaginator
func NewListInfrastructureConfigurationsPaginator(client ListInfrastructureConfigurationsAPIClient, params *ListInfrastructureConfigurationsInput, optFns ...func(*ListInfrastructureConfigurationsPaginatorOptions)) *ListInfrastructureConfigurationsPaginator {
if params == nil {
params = &ListInfrastructureConfigurationsInput{}
}
options := ListInfrastructureConfigurationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListInfrastructureConfigurationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListInfrastructureConfigurationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListInfrastructureConfigurations page.
func (p *ListInfrastructureConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInfrastructureConfigurationsOutput, 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.ListInfrastructureConfigurations(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_opListInfrastructureConfigurations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListInfrastructureConfigurations",
}
}
| 229 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the list of tags for the specified resource.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tags for the specified resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = 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
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListTagsForResource",
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of workflow runtime instance metadata objects for a specific
// image build version.
func (c *Client) ListWorkflowExecutions(ctx context.Context, params *ListWorkflowExecutionsInput, optFns ...func(*Options)) (*ListWorkflowExecutionsOutput, error) {
if params == nil {
params = &ListWorkflowExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListWorkflowExecutions", params, optFns, c.addOperationListWorkflowExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListWorkflowExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListWorkflowExecutionsInput struct {
// List all workflow runtime instances for the specified image build version
// resource ARN.
//
// This member is required.
ImageBuildVersionArn *string
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
noSmithyDocumentSerde
}
type ListWorkflowExecutionsOutput struct {
// The resource ARN of the image build version for which you requested a list of
// workflow runtime details.
ImageBuildVersionArn *string
// The output message from the list action, if applicable.
Message *string
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Contains an array of runtime details that represents each time a workflow ran
// for the requested image build version.
WorkflowExecutions []types.WorkflowExecutionMetadata
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListWorkflowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListWorkflowExecutionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkflowExecutions(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
}
return nil
}
// ListWorkflowExecutionsAPIClient is a client that implements the
// ListWorkflowExecutions operation.
type ListWorkflowExecutionsAPIClient interface {
ListWorkflowExecutions(context.Context, *ListWorkflowExecutionsInput, ...func(*Options)) (*ListWorkflowExecutionsOutput, error)
}
var _ ListWorkflowExecutionsAPIClient = (*Client)(nil)
// ListWorkflowExecutionsPaginatorOptions is the paginator options for
// ListWorkflowExecutions
type ListWorkflowExecutionsPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListWorkflowExecutionsPaginator is a paginator for ListWorkflowExecutions
type ListWorkflowExecutionsPaginator struct {
options ListWorkflowExecutionsPaginatorOptions
client ListWorkflowExecutionsAPIClient
params *ListWorkflowExecutionsInput
nextToken *string
firstPage bool
}
// NewListWorkflowExecutionsPaginator returns a new ListWorkflowExecutionsPaginator
func NewListWorkflowExecutionsPaginator(client ListWorkflowExecutionsAPIClient, params *ListWorkflowExecutionsInput, optFns ...func(*ListWorkflowExecutionsPaginatorOptions)) *ListWorkflowExecutionsPaginator {
if params == nil {
params = &ListWorkflowExecutionsInput{}
}
options := ListWorkflowExecutionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListWorkflowExecutionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListWorkflowExecutionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListWorkflowExecutions page.
func (p *ListWorkflowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowExecutionsOutput, 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.ListWorkflowExecutions(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_opListWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListWorkflowExecutions",
}
}
| 242 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Shows runtime data for each step in a runtime instance of the workflow that you
// specify in the request.
func (c *Client) ListWorkflowStepExecutions(ctx context.Context, params *ListWorkflowStepExecutionsInput, optFns ...func(*Options)) (*ListWorkflowStepExecutionsOutput, error) {
if params == nil {
params = &ListWorkflowStepExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListWorkflowStepExecutions", params, optFns, c.addOperationListWorkflowStepExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListWorkflowStepExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListWorkflowStepExecutionsInput struct {
// The unique identifier that Image Builder assigned to keep track of runtime
// details when it ran the workflow.
//
// This member is required.
WorkflowExecutionId *string
// The maximum items to return in a request.
MaxResults *int32
// A token to specify where to start paginating. This is the NextToken from a
// previously truncated response.
NextToken *string
noSmithyDocumentSerde
}
type ListWorkflowStepExecutionsOutput struct {
// The image build version resource ARN that's associated with the specified
// runtime instance of the workflow.
ImageBuildVersionArn *string
// The output message from the list action, if applicable.
Message *string
// The next token used for paginated responses. When this field isn't empty, there
// are additional elements that the service has'ot included in this request. Use
// this token with the next request to retrieve additional objects.
NextToken *string
// The request ID that uniquely identifies this request.
RequestId *string
// Contains an array of runtime details that represents each step in this runtime
// instance of the workflow.
Steps []types.WorkflowStepMetadata
// The build version ARN for the Image Builder workflow resource that defines the
// steps for this runtime instance of the workflow.
WorkflowBuildVersionArn *string
// The unique identifier that Image Builder assigned to keep track of runtime
// details when it ran the workflow.
WorkflowExecutionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListWorkflowStepExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkflowStepExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkflowStepExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListWorkflowStepExecutionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkflowStepExecutions(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
}
return nil
}
// ListWorkflowStepExecutionsAPIClient is a client that implements the
// ListWorkflowStepExecutions operation.
type ListWorkflowStepExecutionsAPIClient interface {
ListWorkflowStepExecutions(context.Context, *ListWorkflowStepExecutionsInput, ...func(*Options)) (*ListWorkflowStepExecutionsOutput, error)
}
var _ ListWorkflowStepExecutionsAPIClient = (*Client)(nil)
// ListWorkflowStepExecutionsPaginatorOptions is the paginator options for
// ListWorkflowStepExecutions
type ListWorkflowStepExecutionsPaginatorOptions struct {
// The maximum items to return in a request.
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
}
// ListWorkflowStepExecutionsPaginator is a paginator for
// ListWorkflowStepExecutions
type ListWorkflowStepExecutionsPaginator struct {
options ListWorkflowStepExecutionsPaginatorOptions
client ListWorkflowStepExecutionsAPIClient
params *ListWorkflowStepExecutionsInput
nextToken *string
firstPage bool
}
// NewListWorkflowStepExecutionsPaginator returns a new
// ListWorkflowStepExecutionsPaginator
func NewListWorkflowStepExecutionsPaginator(client ListWorkflowStepExecutionsAPIClient, params *ListWorkflowStepExecutionsInput, optFns ...func(*ListWorkflowStepExecutionsPaginatorOptions)) *ListWorkflowStepExecutionsPaginator {
if params == nil {
params = &ListWorkflowStepExecutionsInput{}
}
options := ListWorkflowStepExecutionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListWorkflowStepExecutionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListWorkflowStepExecutionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListWorkflowStepExecutions page.
func (p *ListWorkflowStepExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowStepExecutionsOutput, 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.ListWorkflowStepExecutions(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_opListWorkflowStepExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "ListWorkflowStepExecutions",
}
}
| 252 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Applies a policy to a component. We recommend that you call the RAM API
// CreateResourceShare (https://docs.aws.amazon.com/ram/latest/APIReference/API_CreateResourceShare.html)
// to share resources. If you call the Image Builder API PutComponentPolicy , you
// must also call the RAM API PromoteResourceShareCreatedFromPolicy (https://docs.aws.amazon.com/ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html)
// in order for the resource to be visible to all principals with whom the resource
// is shared.
func (c *Client) PutComponentPolicy(ctx context.Context, params *PutComponentPolicyInput, optFns ...func(*Options)) (*PutComponentPolicyOutput, error) {
if params == nil {
params = &PutComponentPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutComponentPolicy", params, optFns, c.addOperationPutComponentPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutComponentPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutComponentPolicyInput struct {
// The Amazon Resource Name (ARN) of the component that this policy should be
// applied to.
//
// This member is required.
ComponentArn *string
// The policy to apply.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
type PutComponentPolicyOutput struct {
// The Amazon Resource Name (ARN) of the component that this policy was applied to.
ComponentArn *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutComponentPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutComponentPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutComponentPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutComponentPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutComponentPolicy(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
}
return nil
}
func newServiceMetadataMiddleware_opPutComponentPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "PutComponentPolicy",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Applies a policy to a container image. We recommend that you call the RAM API
// CreateResourceShare
// (https://docs.aws.amazon.com//ram/latest/APIReference/API_CreateResourceShare.html)
// to share resources. If you call the Image Builder API PutContainerImagePolicy ,
// you must also call the RAM API PromoteResourceShareCreatedFromPolicy
// (https://docs.aws.amazon.com//ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html)
// in order for the resource to be visible to all principals with whom the resource
// is shared.
func (c *Client) PutContainerRecipePolicy(ctx context.Context, params *PutContainerRecipePolicyInput, optFns ...func(*Options)) (*PutContainerRecipePolicyOutput, error) {
if params == nil {
params = &PutContainerRecipePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutContainerRecipePolicy", params, optFns, c.addOperationPutContainerRecipePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutContainerRecipePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutContainerRecipePolicyInput struct {
// The Amazon Resource Name (ARN) of the container recipe that this policy should
// be applied to.
//
// This member is required.
ContainerRecipeArn *string
// The policy to apply to the container recipe.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
type PutContainerRecipePolicyOutput struct {
// The Amazon Resource Name (ARN) of the container recipe that this policy was
// applied to.
ContainerRecipeArn *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutContainerRecipePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutContainerRecipePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutContainerRecipePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutContainerRecipePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutContainerRecipePolicy(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
}
return nil
}
func newServiceMetadataMiddleware_opPutContainerRecipePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "PutContainerRecipePolicy",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Applies a policy to an image. We recommend that you call the RAM API
// CreateResourceShare (https://docs.aws.amazon.com/ram/latest/APIReference/API_CreateResourceShare.html)
// to share resources. If you call the Image Builder API PutImagePolicy , you must
// also call the RAM API PromoteResourceShareCreatedFromPolicy (https://docs.aws.amazon.com/ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html)
// in order for the resource to be visible to all principals with whom the resource
// is shared.
func (c *Client) PutImagePolicy(ctx context.Context, params *PutImagePolicyInput, optFns ...func(*Options)) (*PutImagePolicyOutput, error) {
if params == nil {
params = &PutImagePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutImagePolicy", params, optFns, c.addOperationPutImagePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutImagePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutImagePolicyInput struct {
// The Amazon Resource Name (ARN) of the image that this policy should be applied
// to.
//
// This member is required.
ImageArn *string
// The policy to apply.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
type PutImagePolicyOutput struct {
// The Amazon Resource Name (ARN) of the image that this policy was applied to.
ImageArn *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutImagePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutImagePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutImagePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutImagePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImagePolicy(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
}
return nil
}
func newServiceMetadataMiddleware_opPutImagePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "PutImagePolicy",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Applies a policy to an image recipe. We recommend that you call the RAM API
// CreateResourceShare (https://docs.aws.amazon.com/ram/latest/APIReference/API_CreateResourceShare.html)
// to share resources. If you call the Image Builder API PutImageRecipePolicy , you
// must also call the RAM API PromoteResourceShareCreatedFromPolicy (https://docs.aws.amazon.com/ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html)
// in order for the resource to be visible to all principals with whom the resource
// is shared.
func (c *Client) PutImageRecipePolicy(ctx context.Context, params *PutImageRecipePolicyInput, optFns ...func(*Options)) (*PutImageRecipePolicyOutput, error) {
if params == nil {
params = &PutImageRecipePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutImageRecipePolicy", params, optFns, c.addOperationPutImageRecipePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutImageRecipePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutImageRecipePolicyInput struct {
// The Amazon Resource Name (ARN) of the image recipe that this policy should be
// applied to.
//
// This member is required.
ImageRecipeArn *string
// The policy to apply.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
type PutImageRecipePolicyOutput struct {
// The Amazon Resource Name (ARN) of the image recipe that this policy was applied
// to.
ImageRecipeArn *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutImageRecipePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutImageRecipePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutImageRecipePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutImageRecipePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImageRecipePolicy(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
}
return nil
}
func newServiceMetadataMiddleware_opPutImageRecipePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "PutImageRecipePolicy",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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"
)
// Manually triggers a pipeline to create an image.
func (c *Client) StartImagePipelineExecution(ctx context.Context, params *StartImagePipelineExecutionInput, optFns ...func(*Options)) (*StartImagePipelineExecutionOutput, error) {
if params == nil {
params = &StartImagePipelineExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartImagePipelineExecution", params, optFns, c.addOperationStartImagePipelineExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartImagePipelineExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartImagePipelineExecutionInput struct {
// The idempotency token used to make this request idempotent.
//
// This member is required.
ClientToken *string
// The Amazon Resource Name (ARN) of the image pipeline that you want to manually
// invoke.
//
// This member is required.
ImagePipelineArn *string
noSmithyDocumentSerde
}
type StartImagePipelineExecutionOutput struct {
// The idempotency token used to make this request idempotent.
ClientToken *string
// The Amazon Resource Name (ARN) of the image that was created by this request.
ImageBuildVersionArn *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartImagePipelineExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartImagePipelineExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartImagePipelineExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opStartImagePipelineExecutionMiddleware(stack, options); err != nil {
return err
}
if err = addOpStartImagePipelineExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartImagePipelineExecution(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
}
return nil
}
type idempotencyToken_initializeOpStartImagePipelineExecution struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpStartImagePipelineExecution) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpStartImagePipelineExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*StartImagePipelineExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *StartImagePipelineExecutionInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opStartImagePipelineExecutionMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpStartImagePipelineExecution{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opStartImagePipelineExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "StartImagePipelineExecution",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a tag to a resource.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource that you want to tag.
//
// This member is required.
ResourceArn *string
// The tags to apply to the resource.
//
// This member is required.
Tags map[string]string
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = 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
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "TagResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a tag from a resource.
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource that you want to untag.
//
// This member is required.
ResourceArn *string
// The tag keys to remove from the resource.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = 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
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "UntagResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a new distribution configuration. Distribution configurations define
// and configure the outputs of your pipeline.
func (c *Client) UpdateDistributionConfiguration(ctx context.Context, params *UpdateDistributionConfigurationInput, optFns ...func(*Options)) (*UpdateDistributionConfigurationOutput, error) {
if params == nil {
params = &UpdateDistributionConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateDistributionConfiguration", params, optFns, c.addOperationUpdateDistributionConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateDistributionConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateDistributionConfigurationInput struct {
// The idempotency token of the distribution configuration.
//
// This member is required.
ClientToken *string
// The Amazon Resource Name (ARN) of the distribution configuration that you want
// to update.
//
// This member is required.
DistributionConfigurationArn *string
// The distributions of the distribution configuration.
//
// This member is required.
Distributions []types.Distribution
// The description of the distribution configuration.
Description *string
noSmithyDocumentSerde
}
type UpdateDistributionConfigurationOutput struct {
// The idempotency token used to make this request idempotent.
ClientToken *string
// The Amazon Resource Name (ARN) of the distribution configuration that was
// updated by this request.
DistributionConfigurationArn *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateDistributionConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDistributionConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDistributionConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateDistributionConfigurationMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateDistributionConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDistributionConfiguration(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
}
return nil
}
type idempotencyToken_initializeOpUpdateDistributionConfiguration struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateDistributionConfiguration) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateDistributionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*UpdateDistributionConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateDistributionConfigurationInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opUpdateDistributionConfigurationMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateDistributionConfiguration{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateDistributionConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "UpdateDistributionConfiguration",
}
}
| 184 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an image pipeline. Image pipelines enable you to automate the creation
// and distribution of images. UpdateImagePipeline does not support selective
// updates for the pipeline. You must specify all of the required properties in the
// update request, not just the properties that have changed.
func (c *Client) UpdateImagePipeline(ctx context.Context, params *UpdateImagePipelineInput, optFns ...func(*Options)) (*UpdateImagePipelineOutput, error) {
if params == nil {
params = &UpdateImagePipelineInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateImagePipeline", params, optFns, c.addOperationUpdateImagePipelineMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateImagePipelineOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateImagePipelineInput struct {
// The idempotency token used to make this request idempotent.
//
// This member is required.
ClientToken *string
// The Amazon Resource Name (ARN) of the image pipeline that you want to update.
//
// This member is required.
ImagePipelineArn *string
// The Amazon Resource Name (ARN) of the infrastructure configuration that Image
// Builder uses to build images that this image pipeline has updated.
//
// This member is required.
InfrastructureConfigurationArn *string
// The Amazon Resource Name (ARN) of the container pipeline to update.
ContainerRecipeArn *string
// The description of the image pipeline.
Description *string
// The Amazon Resource Name (ARN) of the distribution configuration that Image
// Builder uses to configure and distribute images that this image pipeline has
// updated.
DistributionConfigurationArn *string
// Collects additional information about the image being created, including the
// operating system (OS) version and package list. This information is used to
// enhance the overall experience of using EC2 Image Builder. Enabled by default.
EnhancedImageMetadataEnabled *bool
// The Amazon Resource Name (ARN) of the image recipe that will be used to
// configure images updated by this image pipeline.
ImageRecipeArn *string
// Contains settings for vulnerability scans.
ImageScanningConfiguration *types.ImageScanningConfiguration
// The image test configuration of the image pipeline.
ImageTestsConfiguration *types.ImageTestsConfiguration
// The schedule of the image pipeline.
Schedule *types.Schedule
// The status of the image pipeline.
Status types.PipelineStatus
noSmithyDocumentSerde
}
type UpdateImagePipelineOutput struct {
// The idempotency token used to make this request idempotent.
ClientToken *string
// The Amazon Resource Name (ARN) of the image pipeline that was updated by this
// request.
ImagePipelineArn *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateImagePipelineMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateImagePipeline{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateImagePipeline{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateImagePipelineMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateImagePipelineValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateImagePipeline(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
}
return nil
}
type idempotencyToken_initializeOpUpdateImagePipeline struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateImagePipeline) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateImagePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*UpdateImagePipelineInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateImagePipelineInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opUpdateImagePipelineMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateImagePipeline{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateImagePipeline(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "UpdateImagePipeline",
}
}
| 215 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
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/imagebuilder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a new infrastructure configuration. An infrastructure configuration
// defines the environment in which your image will be built and tested.
func (c *Client) UpdateInfrastructureConfiguration(ctx context.Context, params *UpdateInfrastructureConfigurationInput, optFns ...func(*Options)) (*UpdateInfrastructureConfigurationOutput, error) {
if params == nil {
params = &UpdateInfrastructureConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateInfrastructureConfiguration", params, optFns, c.addOperationUpdateInfrastructureConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateInfrastructureConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateInfrastructureConfigurationInput struct {
// The idempotency token used to make this request idempotent.
//
// This member is required.
ClientToken *string
// The Amazon Resource Name (ARN) of the infrastructure configuration that you
// want to update.
//
// This member is required.
InfrastructureConfigurationArn *string
// The instance profile to associate with the instance used to customize your
// Amazon EC2 AMI.
//
// This member is required.
InstanceProfileName *string
// The description of the infrastructure configuration.
Description *string
// The instance metadata options that you can set for the HTTP requests that
// pipeline builds use to launch EC2 build and test instances. For more information
// about instance metadata options, see one of the following links:
// - Configure the instance metadata options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html)
// in the Amazon EC2 User Guide for Linux instances.
// - Configure the instance metadata options (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html)
// in the Amazon EC2 Windows Guide for Windows instances.
InstanceMetadataOptions *types.InstanceMetadataOptions
// The instance types of the infrastructure configuration. You can specify one or
// more instance types to use for this build. The service will pick one of these
// instance types based on availability.
InstanceTypes []string
// The key pair of the infrastructure configuration. You can use this to log on to
// and debug the instance used to create your image.
KeyPair *string
// The logging configuration of the infrastructure configuration.
Logging *types.Logging
// The tags attached to the resource created by Image Builder.
ResourceTags map[string]string
// The security group IDs to associate with the instance used to customize your
// Amazon EC2 AMI.
SecurityGroupIds []string
// The Amazon Resource Name (ARN) for the SNS topic to which we send image build
// event notifications. EC2 Image Builder is unable to send notifications to SNS
// topics that are encrypted using keys from other accounts. The key that is used
// to encrypt the SNS topic must reside in the account that the Image Builder
// service runs under.
SnsTopicArn *string
// The subnet ID to place the instance used to customize your Amazon EC2 AMI in.
SubnetId *string
// The terminate instance on failure setting of the infrastructure configuration.
// Set to false if you want Image Builder to retain the instance used to configure
// your AMI if the build or test phase of your workflow fails.
TerminateInstanceOnFailure *bool
noSmithyDocumentSerde
}
type UpdateInfrastructureConfigurationOutput struct {
// The idempotency token used to make this request idempotent.
ClientToken *string
// The Amazon Resource Name (ARN) of the infrastructure configuration that was
// updated by this request.
InfrastructureConfigurationArn *string
// The request ID that uniquely identifies this request.
RequestId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateInfrastructureConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateInfrastructureConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateInfrastructureConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateInfrastructureConfigurationMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateInfrastructureConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateInfrastructureConfiguration(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
}
return nil
}
type idempotencyToken_initializeOpUpdateInfrastructureConfiguration struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateInfrastructureConfiguration) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateInfrastructureConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*UpdateInfrastructureConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateInfrastructureConfigurationInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opUpdateInfrastructureConfigurationMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateInfrastructureConfiguration{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateInfrastructureConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "imagebuilder",
OperationName: "UpdateInfrastructureConfiguration",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/imagebuilder/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"math"
"strings"
)
type awsRestjson1_deserializeOpCancelImageCreation struct {
}
func (*awsRestjson1_deserializeOpCancelImageCreation) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCancelImageCreation) 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_deserializeOpErrorCancelImageCreation(response, &metadata)
}
output := &CancelImageCreationOutput{}
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_deserializeOpDocumentCancelImageCreationOutput(&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_deserializeOpErrorCancelImageCreation(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCancelImageCreationOutput(v **CancelImageCreationOutput, 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 *CancelImageCreationOutput
if *v == nil {
sv = &CancelImageCreationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateComponent struct {
}
func (*awsRestjson1_deserializeOpCreateComponent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateComponent) 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_deserializeOpErrorCreateComponent(response, &metadata)
}
output := &CreateComponentOutput{}
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_deserializeOpDocumentCreateComponentOutput(&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_deserializeOpErrorCreateComponent(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidParameterCombinationException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("InvalidVersionNumberException", errorCode):
return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateComponentOutput(v **CreateComponentOutput, 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 *CreateComponentOutput
if *v == nil {
sv = &CreateComponentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "componentBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value)
}
sv.ComponentBuildVersionArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateContainerRecipe struct {
}
func (*awsRestjson1_deserializeOpCreateContainerRecipe) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateContainerRecipe) 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_deserializeOpErrorCreateContainerRecipe(response, &metadata)
}
output := &CreateContainerRecipeOutput{}
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_deserializeOpDocumentCreateContainerRecipeOutput(&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_deserializeOpErrorCreateContainerRecipe(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("InvalidVersionNumberException", errorCode):
return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateContainerRecipeOutput(v **CreateContainerRecipeOutput, 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 *CreateContainerRecipeOutput
if *v == nil {
sv = &CreateContainerRecipeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "containerRecipeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value)
}
sv.ContainerRecipeArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateDistributionConfiguration struct {
}
func (*awsRestjson1_deserializeOpCreateDistributionConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateDistributionConfiguration) 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_deserializeOpErrorCreateDistributionConfiguration(response, &metadata)
}
output := &CreateDistributionConfigurationOutput{}
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_deserializeOpDocumentCreateDistributionConfigurationOutput(&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_deserializeOpErrorCreateDistributionConfiguration(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidParameterCombinationException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateDistributionConfigurationOutput(v **CreateDistributionConfigurationOutput, 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 *CreateDistributionConfigurationOutput
if *v == nil {
sv = &CreateDistributionConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "distributionConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value)
}
sv.DistributionConfigurationArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateImage struct {
}
func (*awsRestjson1_deserializeOpCreateImage) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateImage) 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_deserializeOpErrorCreateImage(response, &metadata)
}
output := &CreateImageOutput{}
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_deserializeOpDocumentCreateImageOutput(&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_deserializeOpErrorCreateImage(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateImageOutput(v **CreateImageOutput, 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 *CreateImageOutput
if *v == nil {
sv = &CreateImageOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateImagePipeline struct {
}
func (*awsRestjson1_deserializeOpCreateImagePipeline) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateImagePipeline) 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_deserializeOpErrorCreateImagePipeline(response, &metadata)
}
output := &CreateImagePipelineOutput{}
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_deserializeOpDocumentCreateImagePipelineOutput(&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_deserializeOpErrorCreateImagePipeline(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateImagePipelineOutput(v **CreateImagePipelineOutput, 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 *CreateImagePipelineOutput
if *v == nil {
sv = &CreateImagePipelineOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "imagePipelineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value)
}
sv.ImagePipelineArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateImageRecipe struct {
}
func (*awsRestjson1_deserializeOpCreateImageRecipe) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateImageRecipe) 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_deserializeOpErrorCreateImageRecipe(response, &metadata)
}
output := &CreateImageRecipeOutput{}
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_deserializeOpDocumentCreateImageRecipeOutput(&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_deserializeOpErrorCreateImageRecipe(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("InvalidVersionNumberException", errorCode):
return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateImageRecipeOutput(v **CreateImageRecipeOutput, 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 *CreateImageRecipeOutput
if *v == nil {
sv = &CreateImageRecipeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "imageRecipeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value)
}
sv.ImageRecipeArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateInfrastructureConfiguration struct {
}
func (*awsRestjson1_deserializeOpCreateInfrastructureConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateInfrastructureConfiguration) 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_deserializeOpErrorCreateInfrastructureConfiguration(response, &metadata)
}
output := &CreateInfrastructureConfigurationOutput{}
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_deserializeOpDocumentCreateInfrastructureConfigurationOutput(&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_deserializeOpErrorCreateInfrastructureConfiguration(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateInfrastructureConfigurationOutput(v **CreateInfrastructureConfigurationOutput, 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 *CreateInfrastructureConfigurationOutput
if *v == nil {
sv = &CreateInfrastructureConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "infrastructureConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value)
}
sv.InfrastructureConfigurationArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteComponent struct {
}
func (*awsRestjson1_deserializeOpDeleteComponent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteComponent) 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_deserializeOpErrorDeleteComponent(response, &metadata)
}
output := &DeleteComponentOutput{}
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_deserializeOpDocumentDeleteComponentOutput(&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_deserializeOpErrorDeleteComponent(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceDependencyException", errorCode):
return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteComponentOutput(v **DeleteComponentOutput, 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 *DeleteComponentOutput
if *v == nil {
sv = &DeleteComponentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "componentBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value)
}
sv.ComponentBuildVersionArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteContainerRecipe struct {
}
func (*awsRestjson1_deserializeOpDeleteContainerRecipe) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteContainerRecipe) 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_deserializeOpErrorDeleteContainerRecipe(response, &metadata)
}
output := &DeleteContainerRecipeOutput{}
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_deserializeOpDocumentDeleteContainerRecipeOutput(&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_deserializeOpErrorDeleteContainerRecipe(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceDependencyException", errorCode):
return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteContainerRecipeOutput(v **DeleteContainerRecipeOutput, 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 *DeleteContainerRecipeOutput
if *v == nil {
sv = &DeleteContainerRecipeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "containerRecipeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value)
}
sv.ContainerRecipeArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteDistributionConfiguration struct {
}
func (*awsRestjson1_deserializeOpDeleteDistributionConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteDistributionConfiguration) 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_deserializeOpErrorDeleteDistributionConfiguration(response, &metadata)
}
output := &DeleteDistributionConfigurationOutput{}
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_deserializeOpDocumentDeleteDistributionConfigurationOutput(&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_deserializeOpErrorDeleteDistributionConfiguration(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceDependencyException", errorCode):
return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(v **DeleteDistributionConfigurationOutput, 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 *DeleteDistributionConfigurationOutput
if *v == nil {
sv = &DeleteDistributionConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "distributionConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value)
}
sv.DistributionConfigurationArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteImage struct {
}
func (*awsRestjson1_deserializeOpDeleteImage) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteImage) 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_deserializeOpErrorDeleteImage(response, &metadata)
}
output := &DeleteImageOutput{}
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_deserializeOpDocumentDeleteImageOutput(&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_deserializeOpErrorDeleteImage(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceDependencyException", errorCode):
return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteImageOutput(v **DeleteImageOutput, 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 *DeleteImageOutput
if *v == nil {
sv = &DeleteImageOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteImagePipeline struct {
}
func (*awsRestjson1_deserializeOpDeleteImagePipeline) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteImagePipeline) 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_deserializeOpErrorDeleteImagePipeline(response, &metadata)
}
output := &DeleteImagePipelineOutput{}
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_deserializeOpDocumentDeleteImagePipelineOutput(&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_deserializeOpErrorDeleteImagePipeline(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceDependencyException", errorCode):
return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(v **DeleteImagePipelineOutput, 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 *DeleteImagePipelineOutput
if *v == nil {
sv = &DeleteImagePipelineOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imagePipelineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value)
}
sv.ImagePipelineArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteImageRecipe struct {
}
func (*awsRestjson1_deserializeOpDeleteImageRecipe) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteImageRecipe) 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_deserializeOpErrorDeleteImageRecipe(response, &metadata)
}
output := &DeleteImageRecipeOutput{}
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_deserializeOpDocumentDeleteImageRecipeOutput(&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_deserializeOpErrorDeleteImageRecipe(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceDependencyException", errorCode):
return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(v **DeleteImageRecipeOutput, 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 *DeleteImageRecipeOutput
if *v == nil {
sv = &DeleteImageRecipeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageRecipeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value)
}
sv.ImageRecipeArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteInfrastructureConfiguration struct {
}
func (*awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) 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_deserializeOpErrorDeleteInfrastructureConfiguration(response, &metadata)
}
output := &DeleteInfrastructureConfigurationOutput{}
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_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(&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_deserializeOpErrorDeleteInfrastructureConfiguration(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceDependencyException", errorCode):
return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(v **DeleteInfrastructureConfigurationOutput, 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 *DeleteInfrastructureConfigurationOutput
if *v == nil {
sv = &DeleteInfrastructureConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "infrastructureConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value)
}
sv.InfrastructureConfigurationArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetComponent struct {
}
func (*awsRestjson1_deserializeOpGetComponent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetComponent) 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_deserializeOpErrorGetComponent(response, &metadata)
}
output := &GetComponentOutput{}
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_deserializeOpDocumentGetComponentOutput(&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_deserializeOpErrorGetComponent(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetComponentOutput(v **GetComponentOutput, 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 *GetComponentOutput
if *v == nil {
sv = &GetComponentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "component":
if err := awsRestjson1_deserializeDocumentComponent(&sv.Component, value); err != nil {
return err
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetComponentPolicy struct {
}
func (*awsRestjson1_deserializeOpGetComponentPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetComponentPolicy) 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_deserializeOpErrorGetComponentPolicy(response, &metadata)
}
output := &GetComponentPolicyOutput{}
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_deserializeOpDocumentGetComponentPolicyOutput(&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_deserializeOpErrorGetComponentPolicy(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(v **GetComponentPolicyOutput, 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 *GetComponentPolicyOutput
if *v == nil {
sv = &GetComponentPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "policy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value)
}
sv.Policy = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetContainerRecipe struct {
}
func (*awsRestjson1_deserializeOpGetContainerRecipe) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetContainerRecipe) 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_deserializeOpErrorGetContainerRecipe(response, &metadata)
}
output := &GetContainerRecipeOutput{}
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_deserializeOpDocumentGetContainerRecipeOutput(&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_deserializeOpErrorGetContainerRecipe(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetContainerRecipeOutput(v **GetContainerRecipeOutput, 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 *GetContainerRecipeOutput
if *v == nil {
sv = &GetContainerRecipeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "containerRecipe":
if err := awsRestjson1_deserializeDocumentContainerRecipe(&sv.ContainerRecipe, value); err != nil {
return err
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetContainerRecipePolicy struct {
}
func (*awsRestjson1_deserializeOpGetContainerRecipePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetContainerRecipePolicy) 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_deserializeOpErrorGetContainerRecipePolicy(response, &metadata)
}
output := &GetContainerRecipePolicyOutput{}
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_deserializeOpDocumentGetContainerRecipePolicyOutput(&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_deserializeOpErrorGetContainerRecipePolicy(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetContainerRecipePolicyOutput(v **GetContainerRecipePolicyOutput, 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 *GetContainerRecipePolicyOutput
if *v == nil {
sv = &GetContainerRecipePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "policy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value)
}
sv.Policy = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDistributionConfiguration struct {
}
func (*awsRestjson1_deserializeOpGetDistributionConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDistributionConfiguration) 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_deserializeOpErrorGetDistributionConfiguration(response, &metadata)
}
output := &GetDistributionConfigurationOutput{}
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_deserializeOpDocumentGetDistributionConfigurationOutput(&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_deserializeOpErrorGetDistributionConfiguration(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(v **GetDistributionConfigurationOutput, 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 *GetDistributionConfigurationOutput
if *v == nil {
sv = &GetDistributionConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "distributionConfiguration":
if err := awsRestjson1_deserializeDocumentDistributionConfiguration(&sv.DistributionConfiguration, value); err != nil {
return err
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetImage struct {
}
func (*awsRestjson1_deserializeOpGetImage) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetImage) 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_deserializeOpErrorGetImage(response, &metadata)
}
output := &GetImageOutput{}
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_deserializeOpDocumentGetImageOutput(&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_deserializeOpErrorGetImage(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetImageOutput(v **GetImageOutput, 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 *GetImageOutput
if *v == nil {
sv = &GetImageOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "image":
if err := awsRestjson1_deserializeDocumentImage(&sv.Image, value); err != nil {
return err
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetImagePipeline struct {
}
func (*awsRestjson1_deserializeOpGetImagePipeline) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetImagePipeline) 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_deserializeOpErrorGetImagePipeline(response, &metadata)
}
output := &GetImagePipelineOutput{}
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_deserializeOpDocumentGetImagePipelineOutput(&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_deserializeOpErrorGetImagePipeline(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(v **GetImagePipelineOutput, 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 *GetImagePipelineOutput
if *v == nil {
sv = &GetImagePipelineOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imagePipeline":
if err := awsRestjson1_deserializeDocumentImagePipeline(&sv.ImagePipeline, value); err != nil {
return err
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetImagePolicy struct {
}
func (*awsRestjson1_deserializeOpGetImagePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetImagePolicy) 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_deserializeOpErrorGetImagePolicy(response, &metadata)
}
output := &GetImagePolicyOutput{}
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_deserializeOpDocumentGetImagePolicyOutput(&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_deserializeOpErrorGetImagePolicy(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(v **GetImagePolicyOutput, 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 *GetImagePolicyOutput
if *v == nil {
sv = &GetImagePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "policy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value)
}
sv.Policy = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetImageRecipe struct {
}
func (*awsRestjson1_deserializeOpGetImageRecipe) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetImageRecipe) 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_deserializeOpErrorGetImageRecipe(response, &metadata)
}
output := &GetImageRecipeOutput{}
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_deserializeOpDocumentGetImageRecipeOutput(&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_deserializeOpErrorGetImageRecipe(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(v **GetImageRecipeOutput, 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 *GetImageRecipeOutput
if *v == nil {
sv = &GetImageRecipeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageRecipe":
if err := awsRestjson1_deserializeDocumentImageRecipe(&sv.ImageRecipe, value); err != nil {
return err
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetImageRecipePolicy struct {
}
func (*awsRestjson1_deserializeOpGetImageRecipePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetImageRecipePolicy) 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_deserializeOpErrorGetImageRecipePolicy(response, &metadata)
}
output := &GetImageRecipePolicyOutput{}
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_deserializeOpDocumentGetImageRecipePolicyOutput(&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_deserializeOpErrorGetImageRecipePolicy(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(v **GetImageRecipePolicyOutput, 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 *GetImageRecipePolicyOutput
if *v == nil {
sv = &GetImageRecipePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "policy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value)
}
sv.Policy = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetInfrastructureConfiguration struct {
}
func (*awsRestjson1_deserializeOpGetInfrastructureConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetInfrastructureConfiguration) 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_deserializeOpErrorGetInfrastructureConfiguration(response, &metadata)
}
output := &GetInfrastructureConfigurationOutput{}
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_deserializeOpDocumentGetInfrastructureConfigurationOutput(&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_deserializeOpErrorGetInfrastructureConfiguration(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(v **GetInfrastructureConfigurationOutput, 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 *GetInfrastructureConfigurationOutput
if *v == nil {
sv = &GetInfrastructureConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "infrastructureConfiguration":
if err := awsRestjson1_deserializeDocumentInfrastructureConfiguration(&sv.InfrastructureConfiguration, value); err != nil {
return err
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetWorkflowExecution struct {
}
func (*awsRestjson1_deserializeOpGetWorkflowExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetWorkflowExecution) 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_deserializeOpErrorGetWorkflowExecution(response, &metadata)
}
output := &GetWorkflowExecutionOutput{}
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_deserializeOpDocumentGetWorkflowExecutionOutput(&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_deserializeOpErrorGetWorkflowExecution(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetWorkflowExecutionOutput(v **GetWorkflowExecutionOutput, 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 *GetWorkflowExecutionOutput
if *v == nil {
sv = &GetWorkflowExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "endTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.EndTime = ptr.String(jtv)
}
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowExecutionMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
case "startTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.StartTime = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.WorkflowExecutionStatus(jtv)
}
case "totalStepCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TotalStepCount = int32(i64)
}
case "totalStepsFailed":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TotalStepsFailed = int32(i64)
}
case "totalStepsSkipped":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TotalStepsSkipped = int32(i64)
}
case "totalStepsSucceeded":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TotalStepsSucceeded = int32(i64)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowType to be of type string, got %T instead", value)
}
sv.Type = types.WorkflowType(jtv)
}
case "workflowBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value)
}
sv.WorkflowBuildVersionArn = ptr.String(jtv)
}
case "workflowExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value)
}
sv.WorkflowExecutionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetWorkflowStepExecution struct {
}
func (*awsRestjson1_deserializeOpGetWorkflowStepExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetWorkflowStepExecution) 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_deserializeOpErrorGetWorkflowStepExecution(response, &metadata)
}
output := &GetWorkflowStepExecutionOutput{}
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_deserializeOpDocumentGetWorkflowStepExecutionOutput(&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_deserializeOpErrorGetWorkflowStepExecution(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetWorkflowStepExecutionOutput(v **GetWorkflowStepExecutionOutput, 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 *GetWorkflowStepExecutionOutput
if *v == nil {
sv = &GetWorkflowStepExecutionOutput{}
} 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 WorkflowStepAction to be of type string, got %T instead", value)
}
sv.Action = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "endTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.EndTime = ptr.String(jtv)
}
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "inputs":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepInputs to be of type string, got %T instead", value)
}
sv.Inputs = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "onFailure":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.OnFailure = ptr.String(jtv)
}
case "outputs":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepOutputs to be of type string, got %T instead", value)
}
sv.Outputs = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
case "rollbackStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepExecutionRollbackStatus to be of type string, got %T instead", value)
}
sv.RollbackStatus = types.WorkflowStepExecutionRollbackStatus(jtv)
}
case "startTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.StartTime = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.WorkflowStepExecutionStatus(jtv)
}
case "stepExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepExecutionId to be of type string, got %T instead", value)
}
sv.StepExecutionId = ptr.String(jtv)
}
case "timeoutSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepTimeoutSecondsInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutSeconds = ptr.Int32(int32(i64))
}
case "workflowBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value)
}
sv.WorkflowBuildVersionArn = ptr.String(jtv)
}
case "workflowExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value)
}
sv.WorkflowExecutionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpImportComponent struct {
}
func (*awsRestjson1_deserializeOpImportComponent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpImportComponent) 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_deserializeOpErrorImportComponent(response, &metadata)
}
output := &ImportComponentOutput{}
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_deserializeOpDocumentImportComponentOutput(&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_deserializeOpErrorImportComponent(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidParameterCombinationException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("InvalidVersionNumberException", errorCode):
return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponentOutput, 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 *ImportComponentOutput
if *v == nil {
sv = &ImportComponentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "componentBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value)
}
sv.ComponentBuildVersionArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpImportVmImage struct {
}
func (*awsRestjson1_deserializeOpImportVmImage) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpImportVmImage) 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_deserializeOpErrorImportVmImage(response, &metadata)
}
output := &ImportVmImageOutput{}
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_deserializeOpDocumentImportVmImageOutput(&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_deserializeOpErrorImportVmImage(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("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentImportVmImageOutput(v **ImportVmImageOutput, 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 *ImportVmImageOutput
if *v == nil {
sv = &ImportVmImageOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "imageArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ImageArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListComponentBuildVersions struct {
}
func (*awsRestjson1_deserializeOpListComponentBuildVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListComponentBuildVersions) 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_deserializeOpErrorListComponentBuildVersions(response, &metadata)
}
output := &ListComponentBuildVersionsOutput{}
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_deserializeOpDocumentListComponentBuildVersionsOutput(&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_deserializeOpErrorListComponentBuildVersions(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **ListComponentBuildVersionsOutput, 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 *ListComponentBuildVersionsOutput
if *v == nil {
sv = &ListComponentBuildVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "componentSummaryList":
if err := awsRestjson1_deserializeDocumentComponentSummaryList(&sv.ComponentSummaryList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListComponents struct {
}
func (*awsRestjson1_deserializeOpListComponents) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListComponents) 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_deserializeOpErrorListComponents(response, &metadata)
}
output := &ListComponentsOutput{}
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_deserializeOpDocumentListComponentsOutput(&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_deserializeOpErrorListComponents(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOutput, 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 *ListComponentsOutput
if *v == nil {
sv = &ListComponentsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "componentVersionList":
if err := awsRestjson1_deserializeDocumentComponentVersionList(&sv.ComponentVersionList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListContainerRecipes struct {
}
func (*awsRestjson1_deserializeOpListContainerRecipes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListContainerRecipes) 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_deserializeOpErrorListContainerRecipes(response, &metadata)
}
output := &ListContainerRecipesOutput{}
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_deserializeOpDocumentListContainerRecipesOutput(&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_deserializeOpErrorListContainerRecipes(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(v **ListContainerRecipesOutput, 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 *ListContainerRecipesOutput
if *v == nil {
sv = &ListContainerRecipesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "containerRecipeSummaryList":
if err := awsRestjson1_deserializeDocumentContainerRecipeSummaryList(&sv.ContainerRecipeSummaryList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListDistributionConfigurations struct {
}
func (*awsRestjson1_deserializeOpListDistributionConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDistributionConfigurations) 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_deserializeOpErrorListDistributionConfigurations(response, &metadata)
}
output := &ListDistributionConfigurationsOutput{}
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_deserializeOpDocumentListDistributionConfigurationsOutput(&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_deserializeOpErrorListDistributionConfigurations(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v **ListDistributionConfigurationsOutput, 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 *ListDistributionConfigurationsOutput
if *v == nil {
sv = &ListDistributionConfigurationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "distributionConfigurationSummaryList":
if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(&sv.DistributionConfigurationSummaryList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImageBuildVersions struct {
}
func (*awsRestjson1_deserializeOpListImageBuildVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImageBuildVersions) 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_deserializeOpErrorListImageBuildVersions(response, &metadata)
}
output := &ListImageBuildVersionsOutput{}
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_deserializeOpDocumentListImageBuildVersionsOutput(&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_deserializeOpErrorListImageBuildVersions(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImageBuildVersionsOutput, 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 *ListImageBuildVersionsOutput
if *v == nil {
sv = &ListImageBuildVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageSummaryList":
if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImagePackages struct {
}
func (*awsRestjson1_deserializeOpListImagePackages) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImagePackages) 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_deserializeOpErrorListImagePackages(response, &metadata)
}
output := &ListImagePackagesOutput{}
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_deserializeOpDocumentListImagePackagesOutput(&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_deserializeOpErrorListImagePackages(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImagePackagesOutput(v **ListImagePackagesOutput, 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 *ListImagePackagesOutput
if *v == nil {
sv = &ListImagePackagesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imagePackageList":
if err := awsRestjson1_deserializeDocumentImagePackageList(&sv.ImagePackageList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImagePipelineImages struct {
}
func (*awsRestjson1_deserializeOpListImagePipelineImages) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImagePipelineImages) 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_deserializeOpErrorListImagePipelineImages(response, &metadata)
}
output := &ListImagePipelineImagesOutput{}
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_deserializeOpDocumentListImagePipelineImagesOutput(&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_deserializeOpErrorListImagePipelineImages(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListImagePipelineImagesOutput, 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 *ListImagePipelineImagesOutput
if *v == nil {
sv = &ListImagePipelineImagesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageSummaryList":
if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImagePipelines struct {
}
func (*awsRestjson1_deserializeOpListImagePipelines) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImagePipelines) 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_deserializeOpErrorListImagePipelines(response, &metadata)
}
output := &ListImagePipelinesOutput{}
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_deserializeOpDocumentListImagePipelinesOutput(&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_deserializeOpErrorListImagePipelines(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePipelinesOutput, 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 *ListImagePipelinesOutput
if *v == nil {
sv = &ListImagePipelinesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imagePipelineList":
if err := awsRestjson1_deserializeDocumentImagePipelineList(&sv.ImagePipelineList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImageRecipes struct {
}
func (*awsRestjson1_deserializeOpListImageRecipes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImageRecipes) 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_deserializeOpErrorListImageRecipes(response, &metadata)
}
output := &ListImageRecipesOutput{}
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_deserializeOpDocumentListImageRecipesOutput(&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_deserializeOpErrorListImageRecipes(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecipesOutput, 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 *ListImageRecipesOutput
if *v == nil {
sv = &ListImageRecipesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageRecipeSummaryList":
if err := awsRestjson1_deserializeDocumentImageRecipeSummaryList(&sv.ImageRecipeSummaryList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImages struct {
}
func (*awsRestjson1_deserializeOpListImages) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImages) 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_deserializeOpErrorListImages(response, &metadata)
}
output := &ListImagesOutput{}
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_deserializeOpDocumentListImagesOutput(&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_deserializeOpErrorListImages(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, 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 *ListImagesOutput
if *v == nil {
sv = &ListImagesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageVersionList":
if err := awsRestjson1_deserializeDocumentImageVersionList(&sv.ImageVersionList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImageScanFindingAggregations struct {
}
func (*awsRestjson1_deserializeOpListImageScanFindingAggregations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImageScanFindingAggregations) 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_deserializeOpErrorListImageScanFindingAggregations(response, &metadata)
}
output := &ListImageScanFindingAggregationsOutput{}
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_deserializeOpDocumentListImageScanFindingAggregationsOutput(&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_deserializeOpErrorListImageScanFindingAggregations(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImageScanFindingAggregationsOutput(v **ListImageScanFindingAggregationsOutput, 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 *ListImageScanFindingAggregationsOutput
if *v == nil {
sv = &ListImageScanFindingAggregationsOutput{}
} 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 NonEmptyString to be of type string, got %T instead", value)
}
sv.AggregationType = ptr.String(jtv)
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
case "responses":
if err := awsRestjson1_deserializeDocumentImageScanFindingAggregationsList(&sv.Responses, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImageScanFindings struct {
}
func (*awsRestjson1_deserializeOpListImageScanFindings) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImageScanFindings) 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_deserializeOpErrorListImageScanFindings(response, &metadata)
}
output := &ListImageScanFindingsOutput{}
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_deserializeOpDocumentListImageScanFindingsOutput(&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_deserializeOpErrorListImageScanFindings(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImageScanFindingsOutput(v **ListImageScanFindingsOutput, 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 *ListImageScanFindingsOutput
if *v == nil {
sv = &ListImageScanFindingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "findings":
if err := awsRestjson1_deserializeDocumentImageScanFindingsList(&sv.Findings, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListInfrastructureConfigurations struct {
}
func (*awsRestjson1_deserializeOpListInfrastructureConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) 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_deserializeOpErrorListInfrastructureConfigurations(response, &metadata)
}
output := &ListInfrastructureConfigurationsOutput{}
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_deserializeOpDocumentListInfrastructureConfigurationsOutput(&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_deserializeOpErrorListInfrastructureConfigurations(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v **ListInfrastructureConfigurationsOutput, 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 *ListInfrastructureConfigurationsOutput
if *v == nil {
sv = &ListInfrastructureConfigurationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "infrastructureConfigurationSummaryList":
if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(&sv.InfrastructureConfigurationSummaryList, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTagsForResource struct {
}
func (*awsRestjson1_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidParameterException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListWorkflowExecutions struct {
}
func (*awsRestjson1_deserializeOpListWorkflowExecutions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListWorkflowExecutions) 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_deserializeOpErrorListWorkflowExecutions(response, &metadata)
}
output := &ListWorkflowExecutionsOutput{}
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_deserializeOpDocumentListWorkflowExecutionsOutput(&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_deserializeOpErrorListWorkflowExecutions(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListWorkflowExecutionsOutput(v **ListWorkflowExecutionsOutput, 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 *ListWorkflowExecutionsOutput
if *v == nil {
sv = &ListWorkflowExecutionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
case "workflowExecutions":
if err := awsRestjson1_deserializeDocumentWorkflowExecutionsList(&sv.WorkflowExecutions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListWorkflowStepExecutions struct {
}
func (*awsRestjson1_deserializeOpListWorkflowStepExecutions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListWorkflowStepExecutions) 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_deserializeOpErrorListWorkflowStepExecutions(response, &metadata)
}
output := &ListWorkflowStepExecutionsOutput{}
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_deserializeOpDocumentListWorkflowStepExecutionsOutput(&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_deserializeOpErrorListWorkflowStepExecutions(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListWorkflowStepExecutionsOutput(v **ListWorkflowStepExecutionsOutput, 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 *ListWorkflowStepExecutionsOutput
if *v == nil {
sv = &ListWorkflowStepExecutionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
case "steps":
if err := awsRestjson1_deserializeDocumentWorkflowStepExecutionsList(&sv.Steps, value); err != nil {
return err
}
case "workflowBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value)
}
sv.WorkflowBuildVersionArn = ptr.String(jtv)
}
case "workflowExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value)
}
sv.WorkflowExecutionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutComponentPolicy struct {
}
func (*awsRestjson1_deserializeOpPutComponentPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutComponentPolicy) 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_deserializeOpErrorPutComponentPolicy(response, &metadata)
}
output := &PutComponentPolicyOutput{}
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_deserializeOpDocumentPutComponentPolicyOutput(&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_deserializeOpErrorPutComponentPolicy(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponentPolicyOutput, 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 *PutComponentPolicyOutput
if *v == nil {
sv = &PutComponentPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "componentArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value)
}
sv.ComponentArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutContainerRecipePolicy struct {
}
func (*awsRestjson1_deserializeOpPutContainerRecipePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutContainerRecipePolicy) 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_deserializeOpErrorPutContainerRecipePolicy(response, &metadata)
}
output := &PutContainerRecipePolicyOutput{}
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_deserializeOpDocumentPutContainerRecipePolicyOutput(&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_deserializeOpErrorPutContainerRecipePolicy(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(v **PutContainerRecipePolicyOutput, 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 *PutContainerRecipePolicyOutput
if *v == nil {
sv = &PutContainerRecipePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "containerRecipeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value)
}
sv.ContainerRecipeArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutImagePolicy struct {
}
func (*awsRestjson1_deserializeOpPutImagePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutImagePolicy) 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_deserializeOpErrorPutImagePolicy(response, &metadata)
}
output := &PutImagePolicyOutput{}
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_deserializeOpDocumentPutImagePolicyOutput(&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_deserializeOpErrorPutImagePolicy(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOutput, 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 *PutImagePolicyOutput
if *v == nil {
sv = &PutImagePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutImageRecipePolicy struct {
}
func (*awsRestjson1_deserializeOpPutImageRecipePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) 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_deserializeOpErrorPutImageRecipePolicy(response, &metadata)
}
output := &PutImageRecipePolicyOutput{}
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_deserializeOpDocumentPutImageRecipePolicyOutput(&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_deserializeOpErrorPutImageRecipePolicy(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRecipePolicyOutput, 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 *PutImageRecipePolicyOutput
if *v == nil {
sv = &PutImageRecipePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageRecipeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value)
}
sv.ImageRecipeArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpStartImagePipelineExecution struct {
}
func (*awsRestjson1_deserializeOpStartImagePipelineExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) 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_deserializeOpErrorStartImagePipelineExecution(response, &metadata)
}
output := &StartImagePipelineExecutionOutput{}
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_deserializeOpDocumentStartImagePipelineExecutionOutput(&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_deserializeOpErrorStartImagePipelineExecution(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **StartImagePipelineExecutionOutput, 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 *StartImagePipelineExecutionOutput
if *v == nil {
sv = &StartImagePipelineExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpTagResource struct {
}
func (*awsRestjson1_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidParameterException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUntagResource struct {
}
func (*awsRestjson1_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidParameterException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateDistributionConfiguration struct {
}
func (*awsRestjson1_deserializeOpUpdateDistributionConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) 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_deserializeOpErrorUpdateDistributionConfiguration(response, &metadata)
}
output := &UpdateDistributionConfigurationOutput{}
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_deserializeOpDocumentUpdateDistributionConfigurationOutput(&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_deserializeOpErrorUpdateDistributionConfiguration(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidParameterCombinationException", errorCode):
return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v **UpdateDistributionConfigurationOutput, 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 *UpdateDistributionConfigurationOutput
if *v == nil {
sv = &UpdateDistributionConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "distributionConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value)
}
sv.DistributionConfigurationArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateImagePipeline struct {
}
func (*awsRestjson1_deserializeOpUpdateImagePipeline) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateImagePipeline) 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_deserializeOpErrorUpdateImagePipeline(response, &metadata)
}
output := &UpdateImagePipelineOutput{}
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_deserializeOpDocumentUpdateImagePipelineOutput(&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_deserializeOpErrorUpdateImagePipeline(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImagePipelineOutput, 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 *UpdateImagePipelineOutput
if *v == nil {
sv = &UpdateImagePipelineOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "imagePipelineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value)
}
sv.ImagePipelineArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateInfrastructureConfiguration struct {
}
func (*awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) 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_deserializeOpErrorUpdateInfrastructureConfiguration(response, &metadata)
}
output := &UpdateInfrastructureConfigurationOutput{}
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_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(&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_deserializeOpErrorUpdateInfrastructureConfiguration(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("CallRateLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody)
case strings.EqualFold("ClientException", errorCode):
return awsRestjson1_deserializeErrorClientException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ServiceException", errorCode):
return awsRestjson1_deserializeErrorServiceException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v **UpdateInfrastructureConfigurationOutput, 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 *UpdateInfrastructureConfigurationOutput
if *v == nil {
sv = &UpdateInfrastructureConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "infrastructureConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value)
}
sv.InfrastructureConfigurationArn = ptr.String(jtv)
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeErrorCallRateLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.CallRateLimitExceededException{}
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_deserializeDocumentCallRateLimitExceededException(&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_deserializeErrorClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ClientException{}
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_deserializeDocumentClientException(&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_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ForbiddenException{}
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_deserializeDocumentForbiddenException(&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_deserializeErrorIdempotentParameterMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.IdempotentParameterMismatchException{}
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_deserializeDocumentIdempotentParameterMismatchException(&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_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidPaginationTokenException{}
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_deserializeDocumentInvalidPaginationTokenException(&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_deserializeErrorInvalidParameterCombinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidParameterCombinationException{}
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_deserializeDocumentInvalidParameterCombinationException(&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_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidParameterException{}
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_deserializeDocumentInvalidParameterException(&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_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidParameterValueException{}
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_deserializeDocumentInvalidParameterValueException(&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_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidRequestException{}
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_deserializeDocumentInvalidRequestException(&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_deserializeErrorInvalidVersionNumberException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidVersionNumberException{}
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_deserializeDocumentInvalidVersionNumberException(&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_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceAlreadyExistsException{}
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_deserializeDocumentResourceAlreadyExistsException(&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_deserializeErrorResourceDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceDependencyException{}
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_deserializeDocumentResourceDependencyException(&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_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceInUseException{}
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_deserializeDocumentResourceInUseException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceNotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ServiceException{}
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_deserializeDocumentServiceException(&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_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ServiceUnavailableException{}
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_deserializeDocumentServiceUnavailableException(&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_deserializeDocumentAccountAggregation(v **types.AccountAggregation, 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.AccountAggregation
if *v == nil {
sv = &types.AccountAggregation{}
} 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 NonEmptyString 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 *[]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 AccountId to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(v **types.AdditionalInstanceConfiguration, 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.AdditionalInstanceConfiguration
if *v == nil {
sv = &types.AdditionalInstanceConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "systemsManagerAgent":
if err := awsRestjson1_deserializeDocumentSystemsManagerAgent(&sv.SystemsManagerAgent, value); err != nil {
return err
}
case "userDataOverride":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserDataOverride to be of type string, got %T instead", value)
}
sv.UserDataOverride = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAmi(v **types.Ami, 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.Ami
if *v == nil {
sv = &types.Ami{}
} 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 NonEmptyString to be of type string, got %T instead", value)
}
sv.AccountId = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "image":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Image = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "state":
if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiDistributionConfiguration, 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.AmiDistributionConfiguration
if *v == nil {
sv = &types.AmiDistributionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "amiTags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.AmiTags, value); err != nil {
return err
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "kmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.KmsKeyId = ptr.String(jtv)
}
case "launchPermission":
if err := awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(&sv.LaunchPermission, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmiNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "targetAccountIds":
if err := awsRestjson1_deserializeDocumentAccountList(&sv.TargetAccountIds, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, 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.Ami
if *v == nil {
cv = []types.Ami{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Ami
destAddr := &col
if err := awsRestjson1_deserializeDocumentAmi(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.CallRateLimitExceededException, 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.CallRateLimitExceededException
if *v == nil {
sv = &types.CallRateLimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, 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.ClientException
if *v == nil {
sv = &types.ClientException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponent(v **types.Component, 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.Component
if *v == nil {
sv = &types.Component{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "changeDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ChangeDescription = ptr.String(jtv)
}
case "data":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentData to be of type string, got %T instead", value)
}
sv.Data = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "encrypted":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.Encrypted = ptr.Bool(jtv)
}
case "kmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.KmsKeyId = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "obfuscate":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.Obfuscate = jtv
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(jtv)
}
case "parameters":
if err := awsRestjson1_deserializeDocumentComponentParameterDetailList(&sv.Parameters, 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 = types.Platform(jtv)
}
case "publisher":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Publisher = ptr.String(jtv)
}
case "state":
if err := awsRestjson1_deserializeDocumentComponentState(&sv.State, value); err != nil {
return err
}
case "supportedOsVersions":
if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value)
}
sv.Type = types.ComponentType(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentConfiguration, 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.ComponentConfiguration
if *v == nil {
sv = &types.ComponentConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "componentArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentVersionArnOrBuildVersionArn to be of type string, got %T instead", value)
}
sv.ComponentArn = ptr.String(jtv)
}
case "parameters":
if err := awsRestjson1_deserializeDocumentComponentParameterList(&sv.Parameters, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.ComponentConfiguration, 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.ComponentConfiguration
if *v == nil {
cv = []types.ComponentConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ComponentConfiguration
destAddr := &col
if err := awsRestjson1_deserializeDocumentComponentConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentComponentParameter(v **types.ComponentParameter, 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.ComponentParameter
if *v == nil {
sv = &types.ComponentParameter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentParameterName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "value":
if err := awsRestjson1_deserializeDocumentComponentParameterValueList(&sv.Value, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponentParameterDetail(v **types.ComponentParameterDetail, 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.ComponentParameterDetail
if *v == nil {
sv = &types.ComponentParameterDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "defaultValue":
if err := awsRestjson1_deserializeDocumentComponentParameterValueList(&sv.DefaultValue, value); err != nil {
return err
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentParameterDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentParameterName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentParameterType to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponentParameterDetailList(v *[]types.ComponentParameterDetail, 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.ComponentParameterDetail
if *v == nil {
cv = []types.ComponentParameterDetail{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ComponentParameterDetail
destAddr := &col
if err := awsRestjson1_deserializeDocumentComponentParameterDetail(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentComponentParameterList(v *[]types.ComponentParameter, 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.ComponentParameter
if *v == nil {
cv = []types.ComponentParameter{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ComponentParameter
destAddr := &col
if err := awsRestjson1_deserializeDocumentComponentParameter(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentComponentParameterValueList(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 ComponentParameterValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentComponentState(v **types.ComponentState, 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.ComponentState
if *v == nil {
sv = &types.ComponentState{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentStatus to be of type string, got %T instead", value)
}
sv.Status = types.ComponentStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary, 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.ComponentSummary
if *v == nil {
sv = &types.ComponentSummary{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "changeDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ChangeDescription = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "obfuscate":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.Obfuscate = jtv
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "publisher":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Publisher = ptr.String(jtv)
}
case "state":
if err := awsRestjson1_deserializeDocumentComponentState(&sv.State, value); err != nil {
return err
}
case "supportedOsVersions":
if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value)
}
sv.Type = types.ComponentType(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponentSummaryList(v *[]types.ComponentSummary, 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.ComponentSummary
if *v == nil {
cv = []types.ComponentSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ComponentSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentComponentSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion, 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.ComponentVersion
if *v == nil {
sv = &types.ComponentVersion{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "supportedOsVersions":
if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value)
}
sv.Type = types.ComponentType(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponentVersionList(v *[]types.ComponentVersion, 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.ComponentVersion
if *v == nil {
cv = []types.ComponentVersion{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ComponentVersion
destAddr := &col
if err := awsRestjson1_deserializeDocumentComponentVersion(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentContainer(v **types.Container, 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.Container
if *v == nil {
sv = &types.Container{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageUris":
if err := awsRestjson1_deserializeDocumentStringList(&sv.ImageUris, value); err != nil {
return err
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContainerDistributionConfiguration(v **types.ContainerDistributionConfiguration, 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.ContainerDistributionConfiguration
if *v == nil {
sv = &types.ContainerDistributionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "containerTags":
if err := awsRestjson1_deserializeDocumentStringList(&sv.ContainerTags, value); err != nil {
return err
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "targetRepository":
if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContainerList(v *[]types.Container, 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.Container
if *v == nil {
cv = []types.Container{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Container
destAddr := &col
if err := awsRestjson1_deserializeDocumentContainer(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, 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.ContainerRecipe
if *v == nil {
sv = &types.ContainerRecipe{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "components":
if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil {
return err
}
case "containerType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value)
}
sv.ContainerType = types.ContainerType(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "dockerfileTemplateData":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DockerFileTemplate to be of type string, got %T instead", value)
}
sv.DockerfileTemplateData = ptr.String(jtv)
}
case "encrypted":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.Encrypted = ptr.Bool(jtv)
}
case "instanceConfiguration":
if err := awsRestjson1_deserializeDocumentInstanceConfiguration(&sv.InstanceConfiguration, value); err != nil {
return err
}
case "kmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.KmsKeyId = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(jtv)
}
case "parentImage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ParentImage = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "targetRepository":
if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil {
return err
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
case "workingDirectory":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.WorkingDirectory = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContainerRecipeSummary(v **types.ContainerRecipeSummary, 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.ContainerRecipeSummary
if *v == nil {
sv = &types.ContainerRecipeSummary{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "containerType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value)
}
sv.ContainerType = types.ContainerType(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(jtv)
}
case "parentImage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ParentImage = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContainerRecipeSummaryList(v *[]types.ContainerRecipeSummary, 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.ContainerRecipeSummary
if *v == nil {
cv = []types.ContainerRecipeSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ContainerRecipeSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentContainerRecipeSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentCvssScore(v **types.CvssScore, 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.CvssScore
if *v == nil {
sv = &types.CvssScore{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "baseScore":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.BaseScore = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.BaseScore = ptr.Float64(f64)
default:
return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value)
}
}
case "scoringVector":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ScoringVector = ptr.String(jtv)
}
case "source":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Source = ptr.String(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCvssScoreAdjustment(v **types.CvssScoreAdjustment, 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.CvssScoreAdjustment
if *v == nil {
sv = &types.CvssScoreAdjustment{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "metric":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Metric = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCvssScoreAdjustmentList(v *[]types.CvssScoreAdjustment, 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.CvssScoreAdjustment
if *v == nil {
cv = []types.CvssScoreAdjustment{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CvssScoreAdjustment
destAddr := &col
if err := awsRestjson1_deserializeDocumentCvssScoreAdjustment(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentCvssScoreDetails(v **types.CvssScoreDetails, 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.CvssScoreDetails
if *v == nil {
sv = &types.CvssScoreDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "adjustments":
if err := awsRestjson1_deserializeDocumentCvssScoreAdjustmentList(&sv.Adjustments, value); err != nil {
return err
}
case "cvssSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.CvssSource = ptr.String(jtv)
}
case "score":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Score = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Score = ptr.Float64(f64)
default:
return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value)
}
}
case "scoreSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ScoreSource = ptr.String(jtv)
}
case "scoringVector":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ScoringVector = ptr.String(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCvssScoreList(v *[]types.CvssScore, 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.CvssScore
if *v == nil {
cv = []types.CvssScore{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CvssScore
destAddr := &col
if err := awsRestjson1_deserializeDocumentCvssScore(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDistribution(v **types.Distribution, 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.Distribution
if *v == nil {
sv = &types.Distribution{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "amiDistributionConfiguration":
if err := awsRestjson1_deserializeDocumentAmiDistributionConfiguration(&sv.AmiDistributionConfiguration, value); err != nil {
return err
}
case "containerDistributionConfiguration":
if err := awsRestjson1_deserializeDocumentContainerDistributionConfiguration(&sv.ContainerDistributionConfiguration, value); err != nil {
return err
}
case "fastLaunchConfigurations":
if err := awsRestjson1_deserializeDocumentFastLaunchConfigurationList(&sv.FastLaunchConfigurations, value); err != nil {
return err
}
case "launchTemplateConfigurations":
if err := awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(&sv.LaunchTemplateConfigurations, value); err != nil {
return err
}
case "licenseConfigurationArns":
if err := awsRestjson1_deserializeDocumentLicenseConfigurationArnList(&sv.LicenseConfigurationArns, value); err != nil {
return err
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "s3ExportConfiguration":
if err := awsRestjson1_deserializeDocumentS3ExportConfiguration(&sv.S3ExportConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDistributionConfiguration(v **types.DistributionConfiguration, 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.DistributionConfiguration
if *v == nil {
sv = &types.DistributionConfiguration{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "dateUpdated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateUpdated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "distributions":
if err := awsRestjson1_deserializeDocumentDistributionList(&sv.Distributions, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "timeoutMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected DistributionTimeoutMinutes to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutMinutes = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDistributionConfigurationSummary(v **types.DistributionConfigurationSummary, 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.DistributionConfigurationSummary
if *v == nil {
sv = &types.DistributionConfigurationSummary{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "dateUpdated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateUpdated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "regions":
if err := awsRestjson1_deserializeDocumentRegionList(&sv.Regions, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(v *[]types.DistributionConfigurationSummary, 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.DistributionConfigurationSummary
if *v == nil {
cv = []types.DistributionConfigurationSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DistributionConfigurationSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDistributionList(v *[]types.Distribution, 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.Distribution
if *v == nil {
cv = []types.Distribution{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Distribution
destAddr := &col
if err := awsRestjson1_deserializeDocumentDistribution(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(v **types.EbsInstanceBlockDeviceSpecification, 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.EbsInstanceBlockDeviceSpecification
if *v == nil {
sv = &types.EbsInstanceBlockDeviceSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "deleteOnTermination":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.DeleteOnTermination = ptr.Bool(jtv)
}
case "encrypted":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.Encrypted = ptr.Bool(jtv)
}
case "iops":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected EbsIopsInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Iops = ptr.Int32(int32(i64))
}
case "kmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.KmsKeyId = ptr.String(jtv)
}
case "snapshotId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.SnapshotId = ptr.String(jtv)
}
case "throughput":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected EbsVolumeThroughput to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Throughput = ptr.Int32(int32(i64))
}
case "volumeSize":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected EbsVolumeSizeInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.VolumeSize = ptr.Int32(int32(i64))
}
case "volumeType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EbsVolumeType to be of type string, got %T instead", value)
}
sv.VolumeType = types.EbsVolumeType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEcrConfiguration(v **types.EcrConfiguration, 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.EcrConfiguration
if *v == nil {
sv = &types.EcrConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "containerTags":
if err := awsRestjson1_deserializeDocumentStringList(&sv.ContainerTags, value); err != nil {
return err
}
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
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentFastLaunchConfiguration(v **types.FastLaunchConfiguration, 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.FastLaunchConfiguration
if *v == nil {
sv = &types.FastLaunchConfiguration{}
} 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 "enabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.Enabled = jtv
}
case "launchTemplate":
if err := awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(&sv.LaunchTemplate, value); err != nil {
return err
}
case "maxParallelLaunches":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxParallelLaunches to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxParallelLaunches = ptr.Int32(int32(i64))
}
case "snapshotConfiguration":
if err := awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(&sv.SnapshotConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentFastLaunchConfigurationList(v *[]types.FastLaunchConfiguration, 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.FastLaunchConfiguration
if *v == nil {
cv = []types.FastLaunchConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.FastLaunchConfiguration
destAddr := &col
if err := awsRestjson1_deserializeDocumentFastLaunchConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(v **types.FastLaunchLaunchTemplateSpecification, 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.FastLaunchLaunchTemplateSpecification
if *v == nil {
sv = &types.FastLaunchLaunchTemplateSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "launchTemplateId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LaunchTemplateId to be of type string, got %T instead", value)
}
sv.LaunchTemplateId = ptr.String(jtv)
}
case "launchTemplateName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.LaunchTemplateName = ptr.String(jtv)
}
case "launchTemplateVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.LaunchTemplateVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(v **types.FastLaunchSnapshotConfiguration, 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.FastLaunchSnapshotConfiguration
if *v == nil {
sv = &types.FastLaunchSnapshotConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "targetResourceCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TargetResourceCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TargetResourceCount = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, 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.ForbiddenException
if *v == nil {
sv = &types.ForbiddenException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, 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.IdempotentParameterMismatchException
if *v == nil {
sv = &types.IdempotentParameterMismatchException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImage(v **types.Image, 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.Image
if *v == nil {
sv = &types.Image{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "buildType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuildType to be of type string, got %T instead", value)
}
sv.BuildType = types.BuildType(jtv)
}
case "containerRecipe":
if err := awsRestjson1_deserializeDocumentContainerRecipe(&sv.ContainerRecipe, value); err != nil {
return err
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "distributionConfiguration":
if err := awsRestjson1_deserializeDocumentDistributionConfiguration(&sv.DistributionConfiguration, value); err != nil {
return err
}
case "enhancedImageMetadataEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.EnhancedImageMetadataEnabled = ptr.Bool(jtv)
}
case "imageRecipe":
if err := awsRestjson1_deserializeDocumentImageRecipe(&sv.ImageRecipe, value); err != nil {
return err
}
case "imageScanningConfiguration":
if err := awsRestjson1_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil {
return err
}
case "imageSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value)
}
sv.ImageSource = types.ImageSource(jtv)
}
case "imageTestsConfiguration":
if err := awsRestjson1_deserializeDocumentImageTestsConfiguration(&sv.ImageTestsConfiguration, value); err != nil {
return err
}
case "infrastructureConfiguration":
if err := awsRestjson1_deserializeDocumentInfrastructureConfiguration(&sv.InfrastructureConfiguration, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "osVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value)
}
sv.OsVersion = ptr.String(jtv)
}
case "outputResources":
if err := awsRestjson1_deserializeDocumentOutputResources(&sv.OutputResources, 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 = types.Platform(jtv)
}
case "scanState":
if err := awsRestjson1_deserializeDocumentImageScanState(&sv.ScanState, value); err != nil {
return err
}
case "sourcePipelineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.SourcePipelineArn = ptr.String(jtv)
}
case "sourcePipelineName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.SourcePipelineName = ptr.String(jtv)
}
case "state":
if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageType to be of type string, got %T instead", value)
}
sv.Type = types.ImageType(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageAggregation(v **types.ImageAggregation, 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.ImageAggregation
if *v == nil {
sv = &types.ImageAggregation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = 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_deserializeDocumentImagePackage(v **types.ImagePackage, 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.ImagePackage
if *v == nil {
sv = &types.ImagePackage{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "packageName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.PackageName = ptr.String(jtv)
}
case "packageVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.PackageVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImagePackageList(v *[]types.ImagePackage, 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.ImagePackage
if *v == nil {
cv = []types.ImagePackage{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImagePackage
destAddr := &col
if err := awsRestjson1_deserializeDocumentImagePackage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, 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.ImagePipeline
if *v == nil {
sv = &types.ImagePipeline{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "containerRecipeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ContainerRecipeArn = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "dateLastRun":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateLastRun = ptr.String(jtv)
}
case "dateNextRun":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateNextRun = ptr.String(jtv)
}
case "dateUpdated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateUpdated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "distributionConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.DistributionConfigurationArn = ptr.String(jtv)
}
case "enhancedImageMetadataEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.EnhancedImageMetadataEnabled = ptr.Bool(jtv)
}
case "imageRecipeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ImageRecipeArn = ptr.String(jtv)
}
case "imageScanningConfiguration":
if err := awsRestjson1_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil {
return err
}
case "imageTestsConfiguration":
if err := awsRestjson1_deserializeDocumentImageTestsConfiguration(&sv.ImageTestsConfiguration, value); err != nil {
return err
}
case "infrastructureConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.InfrastructureConfigurationArn = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "schedule":
if err := awsRestjson1_deserializeDocumentSchedule(&sv.Schedule, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PipelineStatus to be of type string, got %T instead", value)
}
sv.Status = types.PipelineStatus(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImagePipelineAggregation(v **types.ImagePipelineAggregation, 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.ImagePipelineAggregation
if *v == nil {
sv = &types.ImagePipelineAggregation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imagePipelineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value)
}
sv.ImagePipelineArn = 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_deserializeDocumentImagePipelineList(v *[]types.ImagePipeline, 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.ImagePipeline
if *v == nil {
cv = []types.ImagePipeline{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImagePipeline
destAddr := &col
if err := awsRestjson1_deserializeDocumentImagePipeline(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, 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.ImageRecipe
if *v == nil {
sv = &types.ImageRecipe{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "additionalInstanceConfiguration":
if err := awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(&sv.AdditionalInstanceConfiguration, value); err != nil {
return err
}
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "blockDeviceMappings":
if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(&sv.BlockDeviceMappings, value); err != nil {
return err
}
case "components":
if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil {
return err
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(jtv)
}
case "parentImage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ParentImage = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageType to be of type string, got %T instead", value)
}
sv.Type = types.ImageType(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
case "workingDirectory":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.WorkingDirectory = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageRecipeSummary(v **types.ImageRecipeSummary, 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.ImageRecipeSummary
if *v == nil {
sv = &types.ImageRecipeSummary{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(jtv)
}
case "parentImage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ParentImage = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageRecipeSummaryList(v *[]types.ImageRecipeSummary, 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.ImageRecipeSummary
if *v == nil {
cv = []types.ImageRecipeSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImageRecipeSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentImageRecipeSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentImageScanFinding(v **types.ImageScanFinding, 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.ImageScanFinding
if *v == nil {
sv = &types.ImageScanFinding{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "awsAccountId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.AwsAccountId = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "firstObservedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.FirstObservedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value)
}
}
case "fixAvailable":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.FixAvailable = ptr.String(jtv)
}
case "imageBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value)
}
sv.ImageBuildVersionArn = ptr.String(jtv)
}
case "imagePipelineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value)
}
sv.ImagePipelineArn = ptr.String(jtv)
}
case "inspectorScore":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.InspectorScore = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.InspectorScore = ptr.Float64(f64)
default:
return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value)
}
}
case "inspectorScoreDetails":
if err := awsRestjson1_deserializeDocumentInspectorScoreDetails(&sv.InspectorScoreDetails, value); err != nil {
return err
}
case "packageVulnerabilityDetails":
if err := awsRestjson1_deserializeDocumentPackageVulnerabilityDetails(&sv.PackageVulnerabilityDetails, value); err != nil {
return err
}
case "remediation":
if err := awsRestjson1_deserializeDocumentRemediation(&sv.Remediation, value); err != nil {
return err
}
case "severity":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Severity = ptr.String(jtv)
}
case "title":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Title = 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 "updatedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageScanFindingAggregation(v **types.ImageScanFindingAggregation, 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.ImageScanFindingAggregation
if *v == nil {
sv = &types.ImageScanFindingAggregation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "accountAggregation":
if err := awsRestjson1_deserializeDocumentAccountAggregation(&sv.AccountAggregation, value); err != nil {
return err
}
case "imageAggregation":
if err := awsRestjson1_deserializeDocumentImageAggregation(&sv.ImageAggregation, value); err != nil {
return err
}
case "imagePipelineAggregation":
if err := awsRestjson1_deserializeDocumentImagePipelineAggregation(&sv.ImagePipelineAggregation, value); err != nil {
return err
}
case "vulnerabilityIdAggregation":
if err := awsRestjson1_deserializeDocumentVulnerabilityIdAggregation(&sv.VulnerabilityIdAggregation, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageScanFindingAggregationsList(v *[]types.ImageScanFindingAggregation, 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.ImageScanFindingAggregation
if *v == nil {
cv = []types.ImageScanFindingAggregation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImageScanFindingAggregation
destAddr := &col
if err := awsRestjson1_deserializeDocumentImageScanFindingAggregation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentImageScanFindingsList(v *[]types.ImageScanFinding, 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.ImageScanFinding
if *v == nil {
cv = []types.ImageScanFinding{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImageScanFinding
destAddr := &col
if err := awsRestjson1_deserializeDocumentImageScanFinding(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentImageScanningConfiguration(v **types.ImageScanningConfiguration, 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.ImageScanningConfiguration
if *v == nil {
sv = &types.ImageScanningConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ecrConfiguration":
if err := awsRestjson1_deserializeDocumentEcrConfiguration(&sv.EcrConfiguration, value); err != nil {
return err
}
case "imageScanningEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.ImageScanningEnabled = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageScanState(v **types.ImageScanState, 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.ImageScanState
if *v == nil {
sv = &types.ImageScanState{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageScanStatus to be of type string, got %T instead", value)
}
sv.Status = types.ImageScanStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageState(v **types.ImageState, 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.ImageState
if *v == nil {
sv = &types.ImageState{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageStatus to be of type string, got %T instead", value)
}
sv.Status = types.ImageStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageSummary(v **types.ImageSummary, 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.ImageSummary
if *v == nil {
sv = &types.ImageSummary{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "buildType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuildType to be of type string, got %T instead", value)
}
sv.BuildType = types.BuildType(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "imageSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value)
}
sv.ImageSource = types.ImageSource(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "osVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value)
}
sv.OsVersion = ptr.String(jtv)
}
case "outputResources":
if err := awsRestjson1_deserializeDocumentOutputResources(&sv.OutputResources, value); err != nil {
return err
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "state":
if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageType to be of type string, got %T instead", value)
}
sv.Type = types.ImageType(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageSummaryList(v *[]types.ImageSummary, 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.ImageSummary
if *v == nil {
cv = []types.ImageSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImageSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentImageSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentImageTestsConfiguration(v **types.ImageTestsConfiguration, 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.ImageTestsConfiguration
if *v == nil {
sv = &types.ImageTestsConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "imageTestsEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.ImageTestsEnabled = ptr.Bool(jtv)
}
case "timeoutMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ImageTestsTimeoutMinutes to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutMinutes = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageVersion(v **types.ImageVersion, 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.ImageVersion
if *v == nil {
sv = &types.ImageVersion{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "buildType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuildType to be of type string, got %T instead", value)
}
sv.BuildType = types.BuildType(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "imageSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value)
}
sv.ImageSource = types.ImageSource(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "osVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value)
}
sv.OsVersion = ptr.String(jtv)
}
case "owner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Owner = ptr.String(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)
}
sv.Platform = types.Platform(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageType to be of type string, got %T instead", value)
}
sv.Type = types.ImageType(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageVersionList(v *[]types.ImageVersion, 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.ImageVersion
if *v == nil {
cv = []types.ImageVersion{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImageVersion
destAddr := &col
if err := awsRestjson1_deserializeDocumentImageVersion(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInfrastructureConfiguration(v **types.InfrastructureConfiguration, 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.InfrastructureConfiguration
if *v == nil {
sv = &types.InfrastructureConfiguration{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "dateUpdated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateUpdated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "instanceMetadataOptions":
if err := awsRestjson1_deserializeDocumentInstanceMetadataOptions(&sv.InstanceMetadataOptions, value); err != nil {
return err
}
case "instanceProfileName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceProfileNameType to be of type string, got %T instead", value)
}
sv.InstanceProfileName = ptr.String(jtv)
}
case "instanceTypes":
if err := awsRestjson1_deserializeDocumentInstanceTypeList(&sv.InstanceTypes, value); err != nil {
return err
}
case "keyPair":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.KeyPair = ptr.String(jtv)
}
case "logging":
if err := awsRestjson1_deserializeDocumentLogging(&sv.Logging, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "resourceTags":
if err := awsRestjson1_deserializeDocumentResourceTagMap(&sv.ResourceTags, value); err != nil {
return err
}
case "securityGroupIds":
if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil {
return err
}
case "snsTopicArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.SnsTopicArn = 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 "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "terminateInstanceOnFailure":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.TerminateInstanceOnFailure = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(v **types.InfrastructureConfigurationSummary, 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.InfrastructureConfigurationSummary
if *v == nil {
sv = &types.InfrastructureConfigurationSummary{}
} 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 ImageBuilderArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "dateCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateCreated = ptr.String(jtv)
}
case "dateUpdated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.DateUpdated = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "instanceProfileName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceProfileNameType to be of type string, got %T instead", value)
}
sv.InstanceProfileName = ptr.String(jtv)
}
case "instanceTypes":
if err := awsRestjson1_deserializeDocumentInstanceTypeList(&sv.InstanceTypes, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "resourceTags":
if err := awsRestjson1_deserializeDocumentResourceTagMap(&sv.ResourceTags, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(v *[]types.InfrastructureConfigurationSummary, 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.InfrastructureConfigurationSummary
if *v == nil {
cv = []types.InfrastructureConfigurationSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.InfrastructureConfigurationSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInspectorScoreDetails(v **types.InspectorScoreDetails, 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.InspectorScoreDetails
if *v == nil {
sv = &types.InspectorScoreDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "adjustedCvss":
if err := awsRestjson1_deserializeDocumentCvssScoreDetails(&sv.AdjustedCvss, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(v **types.InstanceBlockDeviceMapping, 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.InstanceBlockDeviceMapping
if *v == nil {
sv = &types.InstanceBlockDeviceMapping{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "deviceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.DeviceName = ptr.String(jtv)
}
case "ebs":
if err := awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(&sv.Ebs, value); err != nil {
return err
}
case "noDevice":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmptyString to be of type string, got %T instead", value)
}
sv.NoDevice = ptr.String(jtv)
}
case "virtualName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.VirtualName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(v *[]types.InstanceBlockDeviceMapping, 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.InstanceBlockDeviceMapping
if *v == nil {
cv = []types.InstanceBlockDeviceMapping{}
} else {
cv = *v
}
for _, value := range shape {
var col types.InstanceBlockDeviceMapping
destAddr := &col
if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInstanceConfiguration(v **types.InstanceConfiguration, 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.InstanceConfiguration
if *v == nil {
sv = &types.InstanceConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "blockDeviceMappings":
if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(&sv.BlockDeviceMappings, value); err != nil {
return err
}
case "image":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Image = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInstanceMetadataOptions(v **types.InstanceMetadataOptions, 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.InstanceMetadataOptions
if *v == nil {
sv = &types.InstanceMetadataOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "httpPutResponseHopLimit":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected HttpPutResponseHopLimit to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.HttpPutResponseHopLimit = ptr.Int32(int32(i64))
}
case "httpTokens":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HttpTokens to be of type string, got %T instead", value)
}
sv.HttpTokens = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInstanceTypeList(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 InstanceType to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInvalidPaginationTokenException(v **types.InvalidPaginationTokenException, 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.InvalidPaginationTokenException
if *v == nil {
sv = &types.InvalidPaginationTokenException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInvalidParameterCombinationException(v **types.InvalidParameterCombinationException, 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.InvalidParameterCombinationException
if *v == nil {
sv = &types.InvalidParameterCombinationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, 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.InvalidParameterException
if *v == nil {
sv = &types.InvalidParameterException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.InvalidParameterValueException, 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.InvalidParameterValueException
if *v == nil {
sv = &types.InvalidParameterValueException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, 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.InvalidRequestException
if *v == nil {
sv = &types.InvalidRequestException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInvalidVersionNumberException(v **types.InvalidVersionNumberException, 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.InvalidVersionNumberException
if *v == nil {
sv = &types.InvalidVersionNumberException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(v **types.LaunchPermissionConfiguration, 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.LaunchPermissionConfiguration
if *v == nil {
sv = &types.LaunchPermissionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "organizationalUnitArns":
if err := awsRestjson1_deserializeDocumentOrganizationalUnitArnList(&sv.OrganizationalUnitArns, value); err != nil {
return err
}
case "organizationArns":
if err := awsRestjson1_deserializeDocumentOrganizationArnList(&sv.OrganizationArns, value); err != nil {
return err
}
case "userGroups":
if err := awsRestjson1_deserializeDocumentStringList(&sv.UserGroups, value); err != nil {
return err
}
case "userIds":
if err := awsRestjson1_deserializeDocumentAccountList(&sv.UserIds, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(v **types.LaunchTemplateConfiguration, 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.LaunchTemplateConfiguration
if *v == nil {
sv = &types.LaunchTemplateConfiguration{}
} 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 "launchTemplateId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LaunchTemplateId to be of type string, got %T instead", value)
}
sv.LaunchTemplateId = ptr.String(jtv)
}
case "setDefaultVersion":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.SetDefaultVersion = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(v *[]types.LaunchTemplateConfiguration, 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.LaunchTemplateConfiguration
if *v == nil {
cv = []types.LaunchTemplateConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LaunchTemplateConfiguration
destAddr := &col
if err := awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLicenseConfigurationArnList(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 LicenseConfigurationArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLogging(v **types.Logging, 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.Logging
if *v == nil {
sv = &types.Logging{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "s3Logs":
if err := awsRestjson1_deserializeDocumentS3Logs(&sv.S3Logs, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentNonEmptyStringList(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 NonEmptyString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentOrganizationalUnitArnList(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 OrganizationalUnitArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentOrganizationArnList(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 OrganizationArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentOsVersionList(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 OsVersion to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentOutputResources(v **types.OutputResources, 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.OutputResources
if *v == nil {
sv = &types.OutputResources{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "amis":
if err := awsRestjson1_deserializeDocumentAmiList(&sv.Amis, value); err != nil {
return err
}
case "containers":
if err := awsRestjson1_deserializeDocumentContainerList(&sv.Containers, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPackageVulnerabilityDetails(v **types.PackageVulnerabilityDetails, 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.PackageVulnerabilityDetails
if *v == nil {
sv = &types.PackageVulnerabilityDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cvss":
if err := awsRestjson1_deserializeDocumentCvssScoreList(&sv.Cvss, value); err != nil {
return err
}
case "referenceUrls":
if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ReferenceUrls, value); err != nil {
return err
}
case "relatedVulnerabilities":
if err := awsRestjson1_deserializeDocumentVulnerabilityIdList(&sv.RelatedVulnerabilities, value); err != nil {
return err
}
case "source":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Source = ptr.String(jtv)
}
case "sourceUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.SourceUrl = ptr.String(jtv)
}
case "vendorCreatedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.VendorCreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value)
}
}
case "vendorSeverity":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.VendorSeverity = ptr.String(jtv)
}
case "vendorUpdatedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.VendorUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value)
}
}
case "vulnerabilityId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VulnerabilityId to be of type string, got %T instead", value)
}
sv.VulnerabilityId = ptr.String(jtv)
}
case "vulnerablePackages":
if err := awsRestjson1_deserializeDocumentVulnerablePackageList(&sv.VulnerablePackages, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRegionList(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 NonEmptyString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentRemediation(v **types.Remediation, 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.Remediation
if *v == nil {
sv = &types.Remediation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "recommendation":
if err := awsRestjson1_deserializeDocumentRemediationRecommendation(&sv.Recommendation, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRemediationRecommendation(v **types.RemediationRecommendation, 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.RemediationRecommendation
if *v == nil {
sv = &types.RemediationRecommendation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "text":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Text = ptr.String(jtv)
}
case "url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Url = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, 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.ResourceAlreadyExistsException
if *v == nil {
sv = &types.ResourceAlreadyExistsException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceDependencyException(v **types.ResourceDependencyException, 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.ResourceDependencyException
if *v == nil {
sv = &types.ResourceDependencyException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, 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.ResourceInUseException
if *v == nil {
sv = &types.ResourceInUseException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceTagMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentS3ExportConfiguration(v **types.S3ExportConfiguration, 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.S3ExportConfiguration
if *v == nil {
sv = &types.S3ExportConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "diskImageFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DiskImageFormat to be of type string, got %T instead", value)
}
sv.DiskImageFormat = types.DiskImageFormat(jtv)
}
case "roleName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.RoleName = ptr.String(jtv)
}
case "s3Bucket":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.S3Bucket = ptr.String(jtv)
}
case "s3Prefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.S3Prefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentS3Logs(v **types.S3Logs, 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.S3Logs
if *v == nil {
sv = &types.S3Logs{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "s3BucketName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.S3BucketName = ptr.String(jtv)
}
case "s3KeyPrefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.S3KeyPrefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
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 sv *types.Schedule
if *v == nil {
sv = &types.Schedule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "pipelineExecutionStartCondition":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PipelineExecutionStartCondition to be of type string, got %T instead", value)
}
sv.PipelineExecutionStartCondition = types.PipelineExecutionStartCondition(jtv)
}
case "scheduleExpression":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ScheduleExpression = 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_deserializeDocumentSecurityGroupIds(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 NonEmptyString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentServiceException(v **types.ServiceException, 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.ServiceException
if *v == nil {
sv = &types.ServiceException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ServiceQuotaExceededException
if *v == nil {
sv = &types.ServiceQuotaExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, 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.ServiceUnavailableException
if *v == nil {
sv = &types.ServiceUnavailableException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSeverityCounts(v **types.SeverityCounts, 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.SeverityCounts
if *v == nil {
sv = &types.SeverityCounts{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "all":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.All = ptr.Int64(i64)
}
case "critical":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Critical = ptr.Int64(i64)
}
case "high":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.High = ptr.Int64(i64)
}
case "medium":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Medium = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentStringList(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 NonEmptyString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSystemsManagerAgent(v **types.SystemsManagerAgent, 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.SystemsManagerAgent
if *v == nil {
sv = &types.SystemsManagerAgent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "uninstallAfterBuild":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value)
}
sv.UninstallAfterBuild = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentTargetContainerRepository(v **types.TargetContainerRepository, 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.TargetContainerRepository
if *v == nil {
sv = &types.TargetContainerRepository{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
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)
}
case "service":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerRepositoryService to be of type string, got %T instead", value)
}
sv.Service = types.ContainerRepositoryService(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVulnerabilityIdAggregation(v **types.VulnerabilityIdAggregation, 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.VulnerabilityIdAggregation
if *v == nil {
sv = &types.VulnerabilityIdAggregation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "severityCounts":
if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil {
return err
}
case "vulnerabilityId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.VulnerabilityId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVulnerabilityIdList(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 VulnerabilityId to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentVulnerablePackage(v **types.VulnerablePackage, 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.VulnerablePackage
if *v == nil {
sv = &types.VulnerablePackage{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arch":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PackageArchitecture to be of type string, got %T instead", value)
}
sv.Arch = ptr.String(jtv)
}
case "epoch":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PackageEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Epoch = ptr.Int32(int32(i64))
}
case "filePath":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.FilePath = ptr.String(jtv)
}
case "fixedInVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.FixedInVersion = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "packageManager":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.PackageManager = ptr.String(jtv)
}
case "release":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Release = ptr.String(jtv)
}
case "remediation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Remediation = ptr.String(jtv)
}
case "sourceLayerHash":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SourceLayerHash to be of type string, got %T instead", value)
}
sv.SourceLayerHash = ptr.String(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVulnerablePackageList(v *[]types.VulnerablePackage, 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.VulnerablePackage
if *v == nil {
cv = []types.VulnerablePackage{}
} else {
cv = *v
}
for _, value := range shape {
var col types.VulnerablePackage
destAddr := &col
if err := awsRestjson1_deserializeDocumentVulnerablePackage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentWorkflowExecutionMetadata(v **types.WorkflowExecutionMetadata, 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.WorkflowExecutionMetadata
if *v == nil {
sv = &types.WorkflowExecutionMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "endTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.EndTime = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowExecutionMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "startTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.StartTime = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.WorkflowExecutionStatus(jtv)
}
case "totalStepCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TotalStepCount = int32(i64)
}
case "totalStepsFailed":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TotalStepsFailed = int32(i64)
}
case "totalStepsSkipped":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TotalStepsSkipped = int32(i64)
}
case "totalStepsSucceeded":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TotalStepsSucceeded = int32(i64)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowType to be of type string, got %T instead", value)
}
sv.Type = types.WorkflowType(jtv)
}
case "workflowBuildVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value)
}
sv.WorkflowBuildVersionArn = ptr.String(jtv)
}
case "workflowExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value)
}
sv.WorkflowExecutionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentWorkflowExecutionsList(v *[]types.WorkflowExecutionMetadata, 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.WorkflowExecutionMetadata
if *v == nil {
cv = []types.WorkflowExecutionMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.WorkflowExecutionMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentWorkflowExecutionMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentWorkflowStepExecutionsList(v *[]types.WorkflowStepMetadata, 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.WorkflowStepMetadata
if *v == nil {
cv = []types.WorkflowStepMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.WorkflowStepMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentWorkflowStepMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentWorkflowStepMetadata(v **types.WorkflowStepMetadata, 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.WorkflowStepMetadata
if *v == nil {
sv = &types.WorkflowStepMetadata{}
} 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 WorkflowStepAction to be of type string, got %T instead", value)
}
sv.Action = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "endTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.EndTime = ptr.String(jtv)
}
case "inputs":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepInputs to be of type string, got %T instead", value)
}
sv.Inputs = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "outputs":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepOutputs to be of type string, got %T instead", value)
}
sv.Outputs = ptr.String(jtv)
}
case "rollbackStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepExecutionRollbackStatus to be of type string, got %T instead", value)
}
sv.RollbackStatus = types.WorkflowStepExecutionRollbackStatus(jtv)
}
case "startTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DateTime to be of type string, got %T instead", value)
}
sv.StartTime = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.WorkflowStepExecutionStatus(jtv)
}
case "stepExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WorkflowStepExecutionId to be of type string, got %T instead", value)
}
sv.StepExecutionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 18,154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package imagebuilder provides the API client, operations, and parameter types
// for EC2 Image Builder.
//
// EC2 Image Builder is a fully managed Amazon Web Services service that makes it
// easier to automate the creation, management, and deployment of customized,
// secure, and up-to-date "golden" server images that are pre-installed and
// pre-configured with software and settings to meet specific IT standards.
package imagebuilder
| 11 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/imagebuilder/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "imagebuilder"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package imagebuilder
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.23.6"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/imagebuilder/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpCancelImageCreation struct {
}
func (*awsRestjson1_serializeOpCancelImageCreation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCancelImageCreation) 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.(*CancelImageCreationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/CancelImageCreation")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCancelImageCreationInput(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_serializeOpHttpBindingsCancelImageCreationInput(v *CancelImageCreationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCancelImageCreationInput(v *CancelImageCreationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ImageBuildVersionArn != nil {
ok := object.Key("imageBuildVersionArn")
ok.String(*v.ImageBuildVersionArn)
}
return nil
}
type awsRestjson1_serializeOpCreateComponent struct {
}
func (*awsRestjson1_serializeOpCreateComponent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateComponent) 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.(*CreateComponentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/CreateComponent")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateComponentInput(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_serializeOpHttpBindingsCreateComponentInput(v *CreateComponentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateComponentInput(v *CreateComponentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeDescription != nil {
ok := object.Key("changeDescription")
ok.String(*v.ChangeDescription)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Data != nil {
ok := object.Key("data")
ok.String(*v.Data)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.KmsKeyId != nil {
ok := object.Key("kmsKeyId")
ok.String(*v.KmsKeyId)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if len(v.Platform) > 0 {
ok := object.Key("platform")
ok.String(string(v.Platform))
}
if v.SemanticVersion != nil {
ok := object.Key("semanticVersion")
ok.String(*v.SemanticVersion)
}
if v.SupportedOsVersions != nil {
ok := object.Key("supportedOsVersions")
if err := awsRestjson1_serializeDocumentOsVersionList(v.SupportedOsVersions, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.Uri != nil {
ok := object.Key("uri")
ok.String(*v.Uri)
}
return nil
}
type awsRestjson1_serializeOpCreateContainerRecipe struct {
}
func (*awsRestjson1_serializeOpCreateContainerRecipe) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateContainerRecipe) 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.(*CreateContainerRecipeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/CreateContainerRecipe")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateContainerRecipeInput(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_serializeOpHttpBindingsCreateContainerRecipeInput(v *CreateContainerRecipeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateContainerRecipeInput(v *CreateContainerRecipeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Components != nil {
ok := object.Key("components")
if err := awsRestjson1_serializeDocumentComponentConfigurationList(v.Components, ok); err != nil {
return err
}
}
if len(v.ContainerType) > 0 {
ok := object.Key("containerType")
ok.String(string(v.ContainerType))
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.DockerfileTemplateData != nil {
ok := object.Key("dockerfileTemplateData")
ok.String(*v.DockerfileTemplateData)
}
if v.DockerfileTemplateUri != nil {
ok := object.Key("dockerfileTemplateUri")
ok.String(*v.DockerfileTemplateUri)
}
if v.ImageOsVersionOverride != nil {
ok := object.Key("imageOsVersionOverride")
ok.String(*v.ImageOsVersionOverride)
}
if v.InstanceConfiguration != nil {
ok := object.Key("instanceConfiguration")
if err := awsRestjson1_serializeDocumentInstanceConfiguration(v.InstanceConfiguration, ok); err != nil {
return err
}
}
if v.KmsKeyId != nil {
ok := object.Key("kmsKeyId")
ok.String(*v.KmsKeyId)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.ParentImage != nil {
ok := object.Key("parentImage")
ok.String(*v.ParentImage)
}
if len(v.PlatformOverride) > 0 {
ok := object.Key("platformOverride")
ok.String(string(v.PlatformOverride))
}
if v.SemanticVersion != nil {
ok := object.Key("semanticVersion")
ok.String(*v.SemanticVersion)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.TargetRepository != nil {
ok := object.Key("targetRepository")
if err := awsRestjson1_serializeDocumentTargetContainerRepository(v.TargetRepository, ok); err != nil {
return err
}
}
if v.WorkingDirectory != nil {
ok := object.Key("workingDirectory")
ok.String(*v.WorkingDirectory)
}
return nil
}
type awsRestjson1_serializeOpCreateDistributionConfiguration struct {
}
func (*awsRestjson1_serializeOpCreateDistributionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDistributionConfiguration) 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.(*CreateDistributionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/CreateDistributionConfiguration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateDistributionConfigurationInput(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_serializeOpHttpBindingsCreateDistributionConfigurationInput(v *CreateDistributionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDistributionConfigurationInput(v *CreateDistributionConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Distributions != nil {
ok := object.Key("distributions")
if err := awsRestjson1_serializeDocumentDistributionList(v.Distributions, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateImage struct {
}
func (*awsRestjson1_serializeOpCreateImage) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateImage) 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.(*CreateImageInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/CreateImage")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateImageInput(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_serializeOpHttpBindingsCreateImageInput(v *CreateImageInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateImageInput(v *CreateImageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ContainerRecipeArn != nil {
ok := object.Key("containerRecipeArn")
ok.String(*v.ContainerRecipeArn)
}
if v.DistributionConfigurationArn != nil {
ok := object.Key("distributionConfigurationArn")
ok.String(*v.DistributionConfigurationArn)
}
if v.EnhancedImageMetadataEnabled != nil {
ok := object.Key("enhancedImageMetadataEnabled")
ok.Boolean(*v.EnhancedImageMetadataEnabled)
}
if v.ImageRecipeArn != nil {
ok := object.Key("imageRecipeArn")
ok.String(*v.ImageRecipeArn)
}
if v.ImageScanningConfiguration != nil {
ok := object.Key("imageScanningConfiguration")
if err := awsRestjson1_serializeDocumentImageScanningConfiguration(v.ImageScanningConfiguration, ok); err != nil {
return err
}
}
if v.ImageTestsConfiguration != nil {
ok := object.Key("imageTestsConfiguration")
if err := awsRestjson1_serializeDocumentImageTestsConfiguration(v.ImageTestsConfiguration, ok); err != nil {
return err
}
}
if v.InfrastructureConfigurationArn != nil {
ok := object.Key("infrastructureConfigurationArn")
ok.String(*v.InfrastructureConfigurationArn)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateImagePipeline struct {
}
func (*awsRestjson1_serializeOpCreateImagePipeline) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateImagePipeline) 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.(*CreateImagePipelineInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/CreateImagePipeline")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateImagePipelineInput(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_serializeOpHttpBindingsCreateImagePipelineInput(v *CreateImagePipelineInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateImagePipelineInput(v *CreateImagePipelineInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ContainerRecipeArn != nil {
ok := object.Key("containerRecipeArn")
ok.String(*v.ContainerRecipeArn)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.DistributionConfigurationArn != nil {
ok := object.Key("distributionConfigurationArn")
ok.String(*v.DistributionConfigurationArn)
}
if v.EnhancedImageMetadataEnabled != nil {
ok := object.Key("enhancedImageMetadataEnabled")
ok.Boolean(*v.EnhancedImageMetadataEnabled)
}
if v.ImageRecipeArn != nil {
ok := object.Key("imageRecipeArn")
ok.String(*v.ImageRecipeArn)
}
if v.ImageScanningConfiguration != nil {
ok := object.Key("imageScanningConfiguration")
if err := awsRestjson1_serializeDocumentImageScanningConfiguration(v.ImageScanningConfiguration, ok); err != nil {
return err
}
}
if v.ImageTestsConfiguration != nil {
ok := object.Key("imageTestsConfiguration")
if err := awsRestjson1_serializeDocumentImageTestsConfiguration(v.ImageTestsConfiguration, ok); err != nil {
return err
}
}
if v.InfrastructureConfigurationArn != nil {
ok := object.Key("infrastructureConfigurationArn")
ok.String(*v.InfrastructureConfigurationArn)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Schedule != nil {
ok := object.Key("schedule")
if err := awsRestjson1_serializeDocumentSchedule(v.Schedule, ok); err != nil {
return err
}
}
if len(v.Status) > 0 {
ok := object.Key("status")
ok.String(string(v.Status))
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateImageRecipe struct {
}
func (*awsRestjson1_serializeOpCreateImageRecipe) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateImageRecipe) 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.(*CreateImageRecipeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/CreateImageRecipe")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateImageRecipeInput(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_serializeOpHttpBindingsCreateImageRecipeInput(v *CreateImageRecipeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateImageRecipeInput(v *CreateImageRecipeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalInstanceConfiguration != nil {
ok := object.Key("additionalInstanceConfiguration")
if err := awsRestjson1_serializeDocumentAdditionalInstanceConfiguration(v.AdditionalInstanceConfiguration, ok); err != nil {
return err
}
}
if v.BlockDeviceMappings != nil {
ok := object.Key("blockDeviceMappings")
if err := awsRestjson1_serializeDocumentInstanceBlockDeviceMappings(v.BlockDeviceMappings, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Components != nil {
ok := object.Key("components")
if err := awsRestjson1_serializeDocumentComponentConfigurationList(v.Components, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.ParentImage != nil {
ok := object.Key("parentImage")
ok.String(*v.ParentImage)
}
if v.SemanticVersion != nil {
ok := object.Key("semanticVersion")
ok.String(*v.SemanticVersion)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.WorkingDirectory != nil {
ok := object.Key("workingDirectory")
ok.String(*v.WorkingDirectory)
}
return nil
}
type awsRestjson1_serializeOpCreateInfrastructureConfiguration struct {
}
func (*awsRestjson1_serializeOpCreateInfrastructureConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateInfrastructureConfiguration) 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.(*CreateInfrastructureConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/CreateInfrastructureConfiguration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateInfrastructureConfigurationInput(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_serializeOpHttpBindingsCreateInfrastructureConfigurationInput(v *CreateInfrastructureConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateInfrastructureConfigurationInput(v *CreateInfrastructureConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.InstanceMetadataOptions != nil {
ok := object.Key("instanceMetadataOptions")
if err := awsRestjson1_serializeDocumentInstanceMetadataOptions(v.InstanceMetadataOptions, ok); err != nil {
return err
}
}
if v.InstanceProfileName != nil {
ok := object.Key("instanceProfileName")
ok.String(*v.InstanceProfileName)
}
if v.InstanceTypes != nil {
ok := object.Key("instanceTypes")
if err := awsRestjson1_serializeDocumentInstanceTypeList(v.InstanceTypes, ok); err != nil {
return err
}
}
if v.KeyPair != nil {
ok := object.Key("keyPair")
ok.String(*v.KeyPair)
}
if v.Logging != nil {
ok := object.Key("logging")
if err := awsRestjson1_serializeDocumentLogging(v.Logging, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.ResourceTags != nil {
ok := object.Key("resourceTags")
if err := awsRestjson1_serializeDocumentResourceTagMap(v.ResourceTags, ok); err != nil {
return err
}
}
if v.SecurityGroupIds != nil {
ok := object.Key("securityGroupIds")
if err := awsRestjson1_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil {
return err
}
}
if v.SnsTopicArn != nil {
ok := object.Key("snsTopicArn")
ok.String(*v.SnsTopicArn)
}
if v.SubnetId != nil {
ok := object.Key("subnetId")
ok.String(*v.SubnetId)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.TerminateInstanceOnFailure != nil {
ok := object.Key("terminateInstanceOnFailure")
ok.Boolean(*v.TerminateInstanceOnFailure)
}
return nil
}
type awsRestjson1_serializeOpDeleteComponent struct {
}
func (*awsRestjson1_serializeOpDeleteComponent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteComponent) 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.(*DeleteComponentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DeleteComponent")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteComponentInput(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_serializeOpHttpBindingsDeleteComponentInput(v *DeleteComponentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ComponentBuildVersionArn != nil {
encoder.SetQuery("componentBuildVersionArn").String(*v.ComponentBuildVersionArn)
}
return nil
}
type awsRestjson1_serializeOpDeleteContainerRecipe struct {
}
func (*awsRestjson1_serializeOpDeleteContainerRecipe) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteContainerRecipe) 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.(*DeleteContainerRecipeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DeleteContainerRecipe")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteContainerRecipeInput(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_serializeOpHttpBindingsDeleteContainerRecipeInput(v *DeleteContainerRecipeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContainerRecipeArn != nil {
encoder.SetQuery("containerRecipeArn").String(*v.ContainerRecipeArn)
}
return nil
}
type awsRestjson1_serializeOpDeleteDistributionConfiguration struct {
}
func (*awsRestjson1_serializeOpDeleteDistributionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDistributionConfiguration) 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.(*DeleteDistributionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DeleteDistributionConfiguration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteDistributionConfigurationInput(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_serializeOpHttpBindingsDeleteDistributionConfigurationInput(v *DeleteDistributionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DistributionConfigurationArn != nil {
encoder.SetQuery("distributionConfigurationArn").String(*v.DistributionConfigurationArn)
}
return nil
}
type awsRestjson1_serializeOpDeleteImage struct {
}
func (*awsRestjson1_serializeOpDeleteImage) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteImage) 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.(*DeleteImageInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DeleteImage")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteImageInput(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_serializeOpHttpBindingsDeleteImageInput(v *DeleteImageInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImageBuildVersionArn != nil {
encoder.SetQuery("imageBuildVersionArn").String(*v.ImageBuildVersionArn)
}
return nil
}
type awsRestjson1_serializeOpDeleteImagePipeline struct {
}
func (*awsRestjson1_serializeOpDeleteImagePipeline) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteImagePipeline) 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.(*DeleteImagePipelineInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DeleteImagePipeline")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteImagePipelineInput(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_serializeOpHttpBindingsDeleteImagePipelineInput(v *DeleteImagePipelineInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImagePipelineArn != nil {
encoder.SetQuery("imagePipelineArn").String(*v.ImagePipelineArn)
}
return nil
}
type awsRestjson1_serializeOpDeleteImageRecipe struct {
}
func (*awsRestjson1_serializeOpDeleteImageRecipe) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteImageRecipe) 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.(*DeleteImageRecipeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DeleteImageRecipe")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteImageRecipeInput(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_serializeOpHttpBindingsDeleteImageRecipeInput(v *DeleteImageRecipeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImageRecipeArn != nil {
encoder.SetQuery("imageRecipeArn").String(*v.ImageRecipeArn)
}
return nil
}
type awsRestjson1_serializeOpDeleteInfrastructureConfiguration struct {
}
func (*awsRestjson1_serializeOpDeleteInfrastructureConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteInfrastructureConfiguration) 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.(*DeleteInfrastructureConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DeleteInfrastructureConfiguration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteInfrastructureConfigurationInput(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_serializeOpHttpBindingsDeleteInfrastructureConfigurationInput(v *DeleteInfrastructureConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.InfrastructureConfigurationArn != nil {
encoder.SetQuery("infrastructureConfigurationArn").String(*v.InfrastructureConfigurationArn)
}
return nil
}
type awsRestjson1_serializeOpGetComponent struct {
}
func (*awsRestjson1_serializeOpGetComponent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetComponent) 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.(*GetComponentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetComponent")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetComponentInput(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_serializeOpHttpBindingsGetComponentInput(v *GetComponentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ComponentBuildVersionArn != nil {
encoder.SetQuery("componentBuildVersionArn").String(*v.ComponentBuildVersionArn)
}
return nil
}
type awsRestjson1_serializeOpGetComponentPolicy struct {
}
func (*awsRestjson1_serializeOpGetComponentPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetComponentPolicy) 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.(*GetComponentPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetComponentPolicy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetComponentPolicyInput(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_serializeOpHttpBindingsGetComponentPolicyInput(v *GetComponentPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ComponentArn != nil {
encoder.SetQuery("componentArn").String(*v.ComponentArn)
}
return nil
}
type awsRestjson1_serializeOpGetContainerRecipe struct {
}
func (*awsRestjson1_serializeOpGetContainerRecipe) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetContainerRecipe) 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.(*GetContainerRecipeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetContainerRecipe")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetContainerRecipeInput(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_serializeOpHttpBindingsGetContainerRecipeInput(v *GetContainerRecipeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContainerRecipeArn != nil {
encoder.SetQuery("containerRecipeArn").String(*v.ContainerRecipeArn)
}
return nil
}
type awsRestjson1_serializeOpGetContainerRecipePolicy struct {
}
func (*awsRestjson1_serializeOpGetContainerRecipePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetContainerRecipePolicy) 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.(*GetContainerRecipePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetContainerRecipePolicy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetContainerRecipePolicyInput(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_serializeOpHttpBindingsGetContainerRecipePolicyInput(v *GetContainerRecipePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContainerRecipeArn != nil {
encoder.SetQuery("containerRecipeArn").String(*v.ContainerRecipeArn)
}
return nil
}
type awsRestjson1_serializeOpGetDistributionConfiguration struct {
}
func (*awsRestjson1_serializeOpGetDistributionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDistributionConfiguration) 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.(*GetDistributionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetDistributionConfiguration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetDistributionConfigurationInput(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_serializeOpHttpBindingsGetDistributionConfigurationInput(v *GetDistributionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DistributionConfigurationArn != nil {
encoder.SetQuery("distributionConfigurationArn").String(*v.DistributionConfigurationArn)
}
return nil
}
type awsRestjson1_serializeOpGetImage struct {
}
func (*awsRestjson1_serializeOpGetImage) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetImage) 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.(*GetImageInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetImage")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetImageInput(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_serializeOpHttpBindingsGetImageInput(v *GetImageInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImageBuildVersionArn != nil {
encoder.SetQuery("imageBuildVersionArn").String(*v.ImageBuildVersionArn)
}
return nil
}
type awsRestjson1_serializeOpGetImagePipeline struct {
}
func (*awsRestjson1_serializeOpGetImagePipeline) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetImagePipeline) 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.(*GetImagePipelineInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetImagePipeline")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetImagePipelineInput(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_serializeOpHttpBindingsGetImagePipelineInput(v *GetImagePipelineInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImagePipelineArn != nil {
encoder.SetQuery("imagePipelineArn").String(*v.ImagePipelineArn)
}
return nil
}
type awsRestjson1_serializeOpGetImagePolicy struct {
}
func (*awsRestjson1_serializeOpGetImagePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetImagePolicy) 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.(*GetImagePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetImagePolicy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetImagePolicyInput(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_serializeOpHttpBindingsGetImagePolicyInput(v *GetImagePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImageArn != nil {
encoder.SetQuery("imageArn").String(*v.ImageArn)
}
return nil
}
type awsRestjson1_serializeOpGetImageRecipe struct {
}
func (*awsRestjson1_serializeOpGetImageRecipe) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetImageRecipe) 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.(*GetImageRecipeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetImageRecipe")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetImageRecipeInput(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_serializeOpHttpBindingsGetImageRecipeInput(v *GetImageRecipeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImageRecipeArn != nil {
encoder.SetQuery("imageRecipeArn").String(*v.ImageRecipeArn)
}
return nil
}
type awsRestjson1_serializeOpGetImageRecipePolicy struct {
}
func (*awsRestjson1_serializeOpGetImageRecipePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetImageRecipePolicy) 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.(*GetImageRecipePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetImageRecipePolicy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetImageRecipePolicyInput(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_serializeOpHttpBindingsGetImageRecipePolicyInput(v *GetImageRecipePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImageRecipeArn != nil {
encoder.SetQuery("imageRecipeArn").String(*v.ImageRecipeArn)
}
return nil
}
type awsRestjson1_serializeOpGetInfrastructureConfiguration struct {
}
func (*awsRestjson1_serializeOpGetInfrastructureConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetInfrastructureConfiguration) 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.(*GetInfrastructureConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetInfrastructureConfiguration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetInfrastructureConfigurationInput(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_serializeOpHttpBindingsGetInfrastructureConfigurationInput(v *GetInfrastructureConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.InfrastructureConfigurationArn != nil {
encoder.SetQuery("infrastructureConfigurationArn").String(*v.InfrastructureConfigurationArn)
}
return nil
}
type awsRestjson1_serializeOpGetWorkflowExecution struct {
}
func (*awsRestjson1_serializeOpGetWorkflowExecution) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetWorkflowExecution) 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.(*GetWorkflowExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetWorkflowExecution")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetWorkflowExecutionInput(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_serializeOpHttpBindingsGetWorkflowExecutionInput(v *GetWorkflowExecutionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.WorkflowExecutionId != nil {
encoder.SetQuery("workflowExecutionId").String(*v.WorkflowExecutionId)
}
return nil
}
type awsRestjson1_serializeOpGetWorkflowStepExecution struct {
}
func (*awsRestjson1_serializeOpGetWorkflowStepExecution) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetWorkflowStepExecution) 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.(*GetWorkflowStepExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GetWorkflowStepExecution")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetWorkflowStepExecutionInput(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_serializeOpHttpBindingsGetWorkflowStepExecutionInput(v *GetWorkflowStepExecutionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.StepExecutionId != nil {
encoder.SetQuery("stepExecutionId").String(*v.StepExecutionId)
}
return nil
}
type awsRestjson1_serializeOpImportComponent struct {
}
func (*awsRestjson1_serializeOpImportComponent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpImportComponent) 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.(*ImportComponentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ImportComponent")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentImportComponentInput(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_serializeOpHttpBindingsImportComponentInput(v *ImportComponentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentImportComponentInput(v *ImportComponentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeDescription != nil {
ok := object.Key("changeDescription")
ok.String(*v.ChangeDescription)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Data != nil {
ok := object.Key("data")
ok.String(*v.Data)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if len(v.Format) > 0 {
ok := object.Key("format")
ok.String(string(v.Format))
}
if v.KmsKeyId != nil {
ok := object.Key("kmsKeyId")
ok.String(*v.KmsKeyId)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if len(v.Platform) > 0 {
ok := object.Key("platform")
ok.String(string(v.Platform))
}
if v.SemanticVersion != nil {
ok := object.Key("semanticVersion")
ok.String(*v.SemanticVersion)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
if v.Uri != nil {
ok := object.Key("uri")
ok.String(*v.Uri)
}
return nil
}
type awsRestjson1_serializeOpImportVmImage struct {
}
func (*awsRestjson1_serializeOpImportVmImage) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpImportVmImage) 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.(*ImportVmImageInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ImportVmImage")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentImportVmImageInput(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_serializeOpHttpBindingsImportVmImageInput(v *ImportVmImageInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentImportVmImageInput(v *ImportVmImageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.OsVersion != nil {
ok := object.Key("osVersion")
ok.String(*v.OsVersion)
}
if len(v.Platform) > 0 {
ok := object.Key("platform")
ok.String(string(v.Platform))
}
if v.SemanticVersion != nil {
ok := object.Key("semanticVersion")
ok.String(*v.SemanticVersion)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.VmImportTaskId != nil {
ok := object.Key("vmImportTaskId")
ok.String(*v.VmImportTaskId)
}
return nil
}
type awsRestjson1_serializeOpListComponentBuildVersions struct {
}
func (*awsRestjson1_serializeOpListComponentBuildVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListComponentBuildVersions) 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.(*ListComponentBuildVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListComponentBuildVersions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListComponentBuildVersionsInput(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_serializeOpHttpBindingsListComponentBuildVersionsInput(v *ListComponentBuildVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListComponentBuildVersionsInput(v *ListComponentBuildVersionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ComponentVersionArn != nil {
ok := object.Key("componentVersionArn")
ok.String(*v.ComponentVersionArn)
}
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_serializeOpListComponents struct {
}
func (*awsRestjson1_serializeOpListComponents) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListComponents) 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.(*ListComponentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListComponents")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListComponentsInput(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_serializeOpHttpBindingsListComponentsInput(v *ListComponentsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListComponentsInput(v *ListComponentsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ByName {
ok := object.Key("byName")
ok.Boolean(v.ByName)
}
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if len(v.Owner) > 0 {
ok := object.Key("owner")
ok.String(string(v.Owner))
}
return nil
}
type awsRestjson1_serializeOpListContainerRecipes struct {
}
func (*awsRestjson1_serializeOpListContainerRecipes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListContainerRecipes) 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.(*ListContainerRecipesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListContainerRecipes")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListContainerRecipesInput(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_serializeOpHttpBindingsListContainerRecipesInput(v *ListContainerRecipesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListContainerRecipesInput(v *ListContainerRecipesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if len(v.Owner) > 0 {
ok := object.Key("owner")
ok.String(string(v.Owner))
}
return nil
}
type awsRestjson1_serializeOpListDistributionConfigurations struct {
}
func (*awsRestjson1_serializeOpListDistributionConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDistributionConfigurations) 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.(*ListDistributionConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListDistributionConfigurations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListDistributionConfigurationsInput(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_serializeOpHttpBindingsListDistributionConfigurationsInput(v *ListDistributionConfigurationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListDistributionConfigurationsInput(v *ListDistributionConfigurationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListImageBuildVersions struct {
}
func (*awsRestjson1_serializeOpListImageBuildVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImageBuildVersions) 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.(*ListImageBuildVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListImageBuildVersions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImageBuildVersionsInput(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_serializeOpHttpBindingsListImageBuildVersionsInput(v *ListImageBuildVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImageBuildVersionsInput(v *ListImageBuildVersionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.ImageVersionArn != nil {
ok := object.Key("imageVersionArn")
ok.String(*v.ImageVersionArn)
}
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_serializeOpListImagePackages struct {
}
func (*awsRestjson1_serializeOpListImagePackages) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImagePackages) 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.(*ListImagePackagesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListImagePackages")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImagePackagesInput(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_serializeOpHttpBindingsListImagePackagesInput(v *ListImagePackagesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImagePackagesInput(v *ListImagePackagesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImageBuildVersionArn != nil {
ok := object.Key("imageBuildVersionArn")
ok.String(*v.ImageBuildVersionArn)
}
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_serializeOpListImagePipelineImages struct {
}
func (*awsRestjson1_serializeOpListImagePipelineImages) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImagePipelineImages) 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.(*ListImagePipelineImagesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListImagePipelineImages")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImagePipelineImagesInput(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_serializeOpHttpBindingsListImagePipelineImagesInput(v *ListImagePipelineImagesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImagePipelineImagesInput(v *ListImagePipelineImagesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.ImagePipelineArn != nil {
ok := object.Key("imagePipelineArn")
ok.String(*v.ImagePipelineArn)
}
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_serializeOpListImagePipelines struct {
}
func (*awsRestjson1_serializeOpListImagePipelines) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImagePipelines) 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.(*ListImagePipelinesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListImagePipelines")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImagePipelinesInput(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_serializeOpHttpBindingsListImagePipelinesInput(v *ListImagePipelinesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImagePipelinesInput(v *ListImagePipelinesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListImageRecipes struct {
}
func (*awsRestjson1_serializeOpListImageRecipes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImageRecipes) 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.(*ListImageRecipesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListImageRecipes")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImageRecipesInput(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_serializeOpHttpBindingsListImageRecipesInput(v *ListImageRecipesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImageRecipesInput(v *ListImageRecipesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if len(v.Owner) > 0 {
ok := object.Key("owner")
ok.String(string(v.Owner))
}
return nil
}
type awsRestjson1_serializeOpListImages struct {
}
func (*awsRestjson1_serializeOpListImages) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImages) 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.(*ListImagesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListImages")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImagesInput(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_serializeOpHttpBindingsListImagesInput(v *ListImagesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImagesInput(v *ListImagesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ByName {
ok := object.Key("byName")
ok.Boolean(v.ByName)
}
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.IncludeDeprecated != nil {
ok := object.Key("includeDeprecated")
ok.Boolean(*v.IncludeDeprecated)
}
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 len(v.Owner) > 0 {
ok := object.Key("owner")
ok.String(string(v.Owner))
}
return nil
}
type awsRestjson1_serializeOpListImageScanFindingAggregations struct {
}
func (*awsRestjson1_serializeOpListImageScanFindingAggregations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImageScanFindingAggregations) 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.(*ListImageScanFindingAggregationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListImageScanFindingAggregations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImageScanFindingAggregationsInput(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_serializeOpHttpBindingsListImageScanFindingAggregationsInput(v *ListImageScanFindingAggregationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImageScanFindingAggregationsInput(v *ListImageScanFindingAggregationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filter != nil {
ok := object.Key("filter")
if err := awsRestjson1_serializeDocumentFilter(v.Filter, ok); err != nil {
return err
}
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListImageScanFindings struct {
}
func (*awsRestjson1_serializeOpListImageScanFindings) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImageScanFindings) 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.(*ListImageScanFindingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListImageScanFindings")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImageScanFindingsInput(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_serializeOpHttpBindingsListImageScanFindingsInput(v *ListImageScanFindingsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImageScanFindingsInput(v *ListImageScanFindingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentImageScanFindingsFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListInfrastructureConfigurations struct {
}
func (*awsRestjson1_serializeOpListInfrastructureConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListInfrastructureConfigurations) 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.(*ListInfrastructureConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListInfrastructureConfigurations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListInfrastructureConfigurationsInput(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_serializeOpHttpBindingsListInfrastructureConfigurationsInput(v *ListInfrastructureConfigurationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListInfrastructureConfigurationsInput(v *ListInfrastructureConfigurationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListTagsForResource struct {
}
func (*awsRestjson1_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListWorkflowExecutions struct {
}
func (*awsRestjson1_serializeOpListWorkflowExecutions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListWorkflowExecutions) 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.(*ListWorkflowExecutionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListWorkflowExecutions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListWorkflowExecutionsInput(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_serializeOpHttpBindingsListWorkflowExecutionsInput(v *ListWorkflowExecutionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListWorkflowExecutionsInput(v *ListWorkflowExecutionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImageBuildVersionArn != nil {
ok := object.Key("imageBuildVersionArn")
ok.String(*v.ImageBuildVersionArn)
}
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_serializeOpListWorkflowStepExecutions struct {
}
func (*awsRestjson1_serializeOpListWorkflowStepExecutions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListWorkflowStepExecutions) 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.(*ListWorkflowStepExecutionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ListWorkflowStepExecutions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListWorkflowStepExecutionsInput(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_serializeOpHttpBindingsListWorkflowStepExecutionsInput(v *ListWorkflowStepExecutionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListWorkflowStepExecutionsInput(v *ListWorkflowStepExecutionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.WorkflowExecutionId != nil {
ok := object.Key("workflowExecutionId")
ok.String(*v.WorkflowExecutionId)
}
return nil
}
type awsRestjson1_serializeOpPutComponentPolicy struct {
}
func (*awsRestjson1_serializeOpPutComponentPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutComponentPolicy) 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.(*PutComponentPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/PutComponentPolicy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutComponentPolicyInput(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_serializeOpHttpBindingsPutComponentPolicyInput(v *PutComponentPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutComponentPolicyInput(v *PutComponentPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ComponentArn != nil {
ok := object.Key("componentArn")
ok.String(*v.ComponentArn)
}
if v.Policy != nil {
ok := object.Key("policy")
ok.String(*v.Policy)
}
return nil
}
type awsRestjson1_serializeOpPutContainerRecipePolicy struct {
}
func (*awsRestjson1_serializeOpPutContainerRecipePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutContainerRecipePolicy) 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.(*PutContainerRecipePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/PutContainerRecipePolicy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutContainerRecipePolicyInput(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_serializeOpHttpBindingsPutContainerRecipePolicyInput(v *PutContainerRecipePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutContainerRecipePolicyInput(v *PutContainerRecipePolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerRecipeArn != nil {
ok := object.Key("containerRecipeArn")
ok.String(*v.ContainerRecipeArn)
}
if v.Policy != nil {
ok := object.Key("policy")
ok.String(*v.Policy)
}
return nil
}
type awsRestjson1_serializeOpPutImagePolicy struct {
}
func (*awsRestjson1_serializeOpPutImagePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutImagePolicy) 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.(*PutImagePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/PutImagePolicy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutImagePolicyInput(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_serializeOpHttpBindingsPutImagePolicyInput(v *PutImagePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutImagePolicyInput(v *PutImagePolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImageArn != nil {
ok := object.Key("imageArn")
ok.String(*v.ImageArn)
}
if v.Policy != nil {
ok := object.Key("policy")
ok.String(*v.Policy)
}
return nil
}
type awsRestjson1_serializeOpPutImageRecipePolicy struct {
}
func (*awsRestjson1_serializeOpPutImageRecipePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutImageRecipePolicy) 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.(*PutImageRecipePolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/PutImageRecipePolicy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutImageRecipePolicyInput(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_serializeOpHttpBindingsPutImageRecipePolicyInput(v *PutImageRecipePolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutImageRecipePolicyInput(v *PutImageRecipePolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImageRecipeArn != nil {
ok := object.Key("imageRecipeArn")
ok.String(*v.ImageRecipeArn)
}
if v.Policy != nil {
ok := object.Key("policy")
ok.String(*v.Policy)
}
return nil
}
type awsRestjson1_serializeOpStartImagePipelineExecution struct {
}
func (*awsRestjson1_serializeOpStartImagePipelineExecution) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartImagePipelineExecution) 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.(*StartImagePipelineExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/StartImagePipelineExecution")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartImagePipelineExecutionInput(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_serializeOpHttpBindingsStartImagePipelineExecutionInput(v *StartImagePipelineExecutionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartImagePipelineExecutionInput(v *StartImagePipelineExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ImagePipelineArn != nil {
ok := object.Key("imagePipelineArn")
ok.String(*v.ImagePipelineArn)
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUntagResource struct {
}
func (*awsRestjson1_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
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_serializeOpUpdateDistributionConfiguration struct {
}
func (*awsRestjson1_serializeOpUpdateDistributionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateDistributionConfiguration) 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.(*UpdateDistributionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/UpdateDistributionConfiguration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateDistributionConfigurationInput(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_serializeOpHttpBindingsUpdateDistributionConfigurationInput(v *UpdateDistributionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateDistributionConfigurationInput(v *UpdateDistributionConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.DistributionConfigurationArn != nil {
ok := object.Key("distributionConfigurationArn")
ok.String(*v.DistributionConfigurationArn)
}
if v.Distributions != nil {
ok := object.Key("distributions")
if err := awsRestjson1_serializeDocumentDistributionList(v.Distributions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateImagePipeline struct {
}
func (*awsRestjson1_serializeOpUpdateImagePipeline) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateImagePipeline) 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.(*UpdateImagePipelineInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/UpdateImagePipeline")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateImagePipelineInput(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_serializeOpHttpBindingsUpdateImagePipelineInput(v *UpdateImagePipelineInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateImagePipelineInput(v *UpdateImagePipelineInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ContainerRecipeArn != nil {
ok := object.Key("containerRecipeArn")
ok.String(*v.ContainerRecipeArn)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.DistributionConfigurationArn != nil {
ok := object.Key("distributionConfigurationArn")
ok.String(*v.DistributionConfigurationArn)
}
if v.EnhancedImageMetadataEnabled != nil {
ok := object.Key("enhancedImageMetadataEnabled")
ok.Boolean(*v.EnhancedImageMetadataEnabled)
}
if v.ImagePipelineArn != nil {
ok := object.Key("imagePipelineArn")
ok.String(*v.ImagePipelineArn)
}
if v.ImageRecipeArn != nil {
ok := object.Key("imageRecipeArn")
ok.String(*v.ImageRecipeArn)
}
if v.ImageScanningConfiguration != nil {
ok := object.Key("imageScanningConfiguration")
if err := awsRestjson1_serializeDocumentImageScanningConfiguration(v.ImageScanningConfiguration, ok); err != nil {
return err
}
}
if v.ImageTestsConfiguration != nil {
ok := object.Key("imageTestsConfiguration")
if err := awsRestjson1_serializeDocumentImageTestsConfiguration(v.ImageTestsConfiguration, ok); err != nil {
return err
}
}
if v.InfrastructureConfigurationArn != nil {
ok := object.Key("infrastructureConfigurationArn")
ok.String(*v.InfrastructureConfigurationArn)
}
if v.Schedule != nil {
ok := object.Key("schedule")
if err := awsRestjson1_serializeDocumentSchedule(v.Schedule, ok); err != nil {
return err
}
}
if len(v.Status) > 0 {
ok := object.Key("status")
ok.String(string(v.Status))
}
return nil
}
type awsRestjson1_serializeOpUpdateInfrastructureConfiguration struct {
}
func (*awsRestjson1_serializeOpUpdateInfrastructureConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateInfrastructureConfiguration) 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.(*UpdateInfrastructureConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/UpdateInfrastructureConfiguration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateInfrastructureConfigurationInput(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_serializeOpHttpBindingsUpdateInfrastructureConfigurationInput(v *UpdateInfrastructureConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateInfrastructureConfigurationInput(v *UpdateInfrastructureConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.InfrastructureConfigurationArn != nil {
ok := object.Key("infrastructureConfigurationArn")
ok.String(*v.InfrastructureConfigurationArn)
}
if v.InstanceMetadataOptions != nil {
ok := object.Key("instanceMetadataOptions")
if err := awsRestjson1_serializeDocumentInstanceMetadataOptions(v.InstanceMetadataOptions, ok); err != nil {
return err
}
}
if v.InstanceProfileName != nil {
ok := object.Key("instanceProfileName")
ok.String(*v.InstanceProfileName)
}
if v.InstanceTypes != nil {
ok := object.Key("instanceTypes")
if err := awsRestjson1_serializeDocumentInstanceTypeList(v.InstanceTypes, ok); err != nil {
return err
}
}
if v.KeyPair != nil {
ok := object.Key("keyPair")
ok.String(*v.KeyPair)
}
if v.Logging != nil {
ok := object.Key("logging")
if err := awsRestjson1_serializeDocumentLogging(v.Logging, ok); err != nil {
return err
}
}
if v.ResourceTags != nil {
ok := object.Key("resourceTags")
if err := awsRestjson1_serializeDocumentResourceTagMap(v.ResourceTags, ok); err != nil {
return err
}
}
if v.SecurityGroupIds != nil {
ok := object.Key("securityGroupIds")
if err := awsRestjson1_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil {
return err
}
}
if v.SnsTopicArn != nil {
ok := object.Key("snsTopicArn")
ok.String(*v.SnsTopicArn)
}
if v.SubnetId != nil {
ok := object.Key("subnetId")
ok.String(*v.SubnetId)
}
if v.TerminateInstanceOnFailure != nil {
ok := object.Key("terminateInstanceOnFailure")
ok.Boolean(*v.TerminateInstanceOnFailure)
}
return nil
}
func awsRestjson1_serializeDocumentAccountList(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_serializeDocumentAdditionalInstanceConfiguration(v *types.AdditionalInstanceConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SystemsManagerAgent != nil {
ok := object.Key("systemsManagerAgent")
if err := awsRestjson1_serializeDocumentSystemsManagerAgent(v.SystemsManagerAgent, ok); err != nil {
return err
}
}
if v.UserDataOverride != nil {
ok := object.Key("userDataOverride")
ok.String(*v.UserDataOverride)
}
return nil
}
func awsRestjson1_serializeDocumentAmiDistributionConfiguration(v *types.AmiDistributionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AmiTags != nil {
ok := object.Key("amiTags")
if err := awsRestjson1_serializeDocumentTagMap(v.AmiTags, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.KmsKeyId != nil {
ok := object.Key("kmsKeyId")
ok.String(*v.KmsKeyId)
}
if v.LaunchPermission != nil {
ok := object.Key("launchPermission")
if err := awsRestjson1_serializeDocumentLaunchPermissionConfiguration(v.LaunchPermission, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.TargetAccountIds != nil {
ok := object.Key("targetAccountIds")
if err := awsRestjson1_serializeDocumentAccountList(v.TargetAccountIds, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentComponentConfiguration(v *types.ComponentConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ComponentArn != nil {
ok := object.Key("componentArn")
ok.String(*v.ComponentArn)
}
if v.Parameters != nil {
ok := object.Key("parameters")
if err := awsRestjson1_serializeDocumentComponentParameterList(v.Parameters, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentComponentConfigurationList(v []types.ComponentConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentComponentConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentComponentParameter(v *types.ComponentParameter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Value != nil {
ok := object.Key("value")
if err := awsRestjson1_serializeDocumentComponentParameterValueList(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentComponentParameterList(v []types.ComponentParameter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentComponentParameter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentComponentParameterValueList(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_serializeDocumentContainerDistributionConfiguration(v *types.ContainerDistributionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerTags != nil {
ok := object.Key("containerTags")
if err := awsRestjson1_serializeDocumentStringList(v.ContainerTags, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.TargetRepository != nil {
ok := object.Key("targetRepository")
if err := awsRestjson1_serializeDocumentTargetContainerRepository(v.TargetRepository, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDistribution(v *types.Distribution, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AmiDistributionConfiguration != nil {
ok := object.Key("amiDistributionConfiguration")
if err := awsRestjson1_serializeDocumentAmiDistributionConfiguration(v.AmiDistributionConfiguration, ok); err != nil {
return err
}
}
if v.ContainerDistributionConfiguration != nil {
ok := object.Key("containerDistributionConfiguration")
if err := awsRestjson1_serializeDocumentContainerDistributionConfiguration(v.ContainerDistributionConfiguration, ok); err != nil {
return err
}
}
if v.FastLaunchConfigurations != nil {
ok := object.Key("fastLaunchConfigurations")
if err := awsRestjson1_serializeDocumentFastLaunchConfigurationList(v.FastLaunchConfigurations, ok); err != nil {
return err
}
}
if v.LaunchTemplateConfigurations != nil {
ok := object.Key("launchTemplateConfigurations")
if err := awsRestjson1_serializeDocumentLaunchTemplateConfigurationList(v.LaunchTemplateConfigurations, ok); err != nil {
return err
}
}
if v.LicenseConfigurationArns != nil {
ok := object.Key("licenseConfigurationArns")
if err := awsRestjson1_serializeDocumentLicenseConfigurationArnList(v.LicenseConfigurationArns, ok); err != nil {
return err
}
}
if v.Region != nil {
ok := object.Key("region")
ok.String(*v.Region)
}
if v.S3ExportConfiguration != nil {
ok := object.Key("s3ExportConfiguration")
if err := awsRestjson1_serializeDocumentS3ExportConfiguration(v.S3ExportConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDistributionList(v []types.Distribution, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentDistribution(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEbsInstanceBlockDeviceSpecification(v *types.EbsInstanceBlockDeviceSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeleteOnTermination != nil {
ok := object.Key("deleteOnTermination")
ok.Boolean(*v.DeleteOnTermination)
}
if v.Encrypted != nil {
ok := object.Key("encrypted")
ok.Boolean(*v.Encrypted)
}
if v.Iops != nil {
ok := object.Key("iops")
ok.Integer(*v.Iops)
}
if v.KmsKeyId != nil {
ok := object.Key("kmsKeyId")
ok.String(*v.KmsKeyId)
}
if v.SnapshotId != nil {
ok := object.Key("snapshotId")
ok.String(*v.SnapshotId)
}
if v.Throughput != nil {
ok := object.Key("throughput")
ok.Integer(*v.Throughput)
}
if v.VolumeSize != nil {
ok := object.Key("volumeSize")
ok.Integer(*v.VolumeSize)
}
if len(v.VolumeType) > 0 {
ok := object.Key("volumeType")
ok.String(string(v.VolumeType))
}
return nil
}
func awsRestjson1_serializeDocumentEcrConfiguration(v *types.EcrConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerTags != nil {
ok := object.Key("containerTags")
if err := awsRestjson1_serializeDocumentStringList(v.ContainerTags, ok); err != nil {
return err
}
}
if v.RepositoryName != nil {
ok := object.Key("repositoryName")
ok.String(*v.RepositoryName)
}
return nil
}
func awsRestjson1_serializeDocumentFastLaunchConfiguration(v *types.FastLaunchConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccountId != nil {
ok := object.Key("accountId")
ok.String(*v.AccountId)
}
{
ok := object.Key("enabled")
ok.Boolean(v.Enabled)
}
if v.LaunchTemplate != nil {
ok := object.Key("launchTemplate")
if err := awsRestjson1_serializeDocumentFastLaunchLaunchTemplateSpecification(v.LaunchTemplate, ok); err != nil {
return err
}
}
if v.MaxParallelLaunches != nil {
ok := object.Key("maxParallelLaunches")
ok.Integer(*v.MaxParallelLaunches)
}
if v.SnapshotConfiguration != nil {
ok := object.Key("snapshotConfiguration")
if err := awsRestjson1_serializeDocumentFastLaunchSnapshotConfiguration(v.SnapshotConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFastLaunchConfigurationList(v []types.FastLaunchConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentFastLaunchConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFastLaunchLaunchTemplateSpecification(v *types.FastLaunchLaunchTemplateSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LaunchTemplateId != nil {
ok := object.Key("launchTemplateId")
ok.String(*v.LaunchTemplateId)
}
if v.LaunchTemplateName != nil {
ok := object.Key("launchTemplateName")
ok.String(*v.LaunchTemplateName)
}
if v.LaunchTemplateVersion != nil {
ok := object.Key("launchTemplateVersion")
ok.String(*v.LaunchTemplateVersion)
}
return nil
}
func awsRestjson1_serializeDocumentFastLaunchSnapshotConfiguration(v *types.FastLaunchSnapshotConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TargetResourceCount != nil {
ok := object.Key("targetResourceCount")
ok.Integer(*v.TargetResourceCount)
}
return nil
}
func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFilterList(v []types.Filter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFilterValues(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_serializeDocumentImageScanFindingsFilter(v *types.ImageScanFindingsFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentImageScanFindingsFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentImageScanFindingsFilterList(v []types.ImageScanFindingsFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentImageScanFindingsFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentImageScanFindingsFilterValues(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_serializeDocumentImageScanningConfiguration(v *types.ImageScanningConfiguration, 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 v.ImageScanningEnabled != nil {
ok := object.Key("imageScanningEnabled")
ok.Boolean(*v.ImageScanningEnabled)
}
return nil
}
func awsRestjson1_serializeDocumentImageTestsConfiguration(v *types.ImageTestsConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImageTestsEnabled != nil {
ok := object.Key("imageTestsEnabled")
ok.Boolean(*v.ImageTestsEnabled)
}
if v.TimeoutMinutes != nil {
ok := object.Key("timeoutMinutes")
ok.Integer(*v.TimeoutMinutes)
}
return nil
}
func awsRestjson1_serializeDocumentInstanceBlockDeviceMapping(v *types.InstanceBlockDeviceMapping, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeviceName != nil {
ok := object.Key("deviceName")
ok.String(*v.DeviceName)
}
if v.Ebs != nil {
ok := object.Key("ebs")
if err := awsRestjson1_serializeDocumentEbsInstanceBlockDeviceSpecification(v.Ebs, ok); err != nil {
return err
}
}
if v.NoDevice != nil {
ok := object.Key("noDevice")
ok.String(*v.NoDevice)
}
if v.VirtualName != nil {
ok := object.Key("virtualName")
ok.String(*v.VirtualName)
}
return nil
}
func awsRestjson1_serializeDocumentInstanceBlockDeviceMappings(v []types.InstanceBlockDeviceMapping, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentInstanceBlockDeviceMapping(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentInstanceConfiguration(v *types.InstanceConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BlockDeviceMappings != nil {
ok := object.Key("blockDeviceMappings")
if err := awsRestjson1_serializeDocumentInstanceBlockDeviceMappings(v.BlockDeviceMappings, ok); err != nil {
return err
}
}
if v.Image != nil {
ok := object.Key("image")
ok.String(*v.Image)
}
return nil
}
func awsRestjson1_serializeDocumentInstanceMetadataOptions(v *types.InstanceMetadataOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HttpPutResponseHopLimit != nil {
ok := object.Key("httpPutResponseHopLimit")
ok.Integer(*v.HttpPutResponseHopLimit)
}
if v.HttpTokens != nil {
ok := object.Key("httpTokens")
ok.String(*v.HttpTokens)
}
return nil
}
func awsRestjson1_serializeDocumentInstanceTypeList(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_serializeDocumentLaunchPermissionConfiguration(v *types.LaunchPermissionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OrganizationalUnitArns != nil {
ok := object.Key("organizationalUnitArns")
if err := awsRestjson1_serializeDocumentOrganizationalUnitArnList(v.OrganizationalUnitArns, ok); err != nil {
return err
}
}
if v.OrganizationArns != nil {
ok := object.Key("organizationArns")
if err := awsRestjson1_serializeDocumentOrganizationArnList(v.OrganizationArns, ok); err != nil {
return err
}
}
if v.UserGroups != nil {
ok := object.Key("userGroups")
if err := awsRestjson1_serializeDocumentStringList(v.UserGroups, ok); err != nil {
return err
}
}
if v.UserIds != nil {
ok := object.Key("userIds")
if err := awsRestjson1_serializeDocumentAccountList(v.UserIds, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentLaunchTemplateConfiguration(v *types.LaunchTemplateConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccountId != nil {
ok := object.Key("accountId")
ok.String(*v.AccountId)
}
if v.LaunchTemplateId != nil {
ok := object.Key("launchTemplateId")
ok.String(*v.LaunchTemplateId)
}
if v.SetDefaultVersion {
ok := object.Key("setDefaultVersion")
ok.Boolean(v.SetDefaultVersion)
}
return nil
}
func awsRestjson1_serializeDocumentLaunchTemplateConfigurationList(v []types.LaunchTemplateConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentLaunchTemplateConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentLicenseConfigurationArnList(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_serializeDocumentLogging(v *types.Logging, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3Logs != nil {
ok := object.Key("s3Logs")
if err := awsRestjson1_serializeDocumentS3Logs(v.S3Logs, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentOrganizationalUnitArnList(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_serializeDocumentOrganizationArnList(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_serializeDocumentOsVersionList(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_serializeDocumentResourceTagMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentS3ExportConfiguration(v *types.S3ExportConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DiskImageFormat) > 0 {
ok := object.Key("diskImageFormat")
ok.String(string(v.DiskImageFormat))
}
if v.RoleName != nil {
ok := object.Key("roleName")
ok.String(*v.RoleName)
}
if v.S3Bucket != nil {
ok := object.Key("s3Bucket")
ok.String(*v.S3Bucket)
}
if v.S3Prefix != nil {
ok := object.Key("s3Prefix")
ok.String(*v.S3Prefix)
}
return nil
}
func awsRestjson1_serializeDocumentS3Logs(v *types.S3Logs, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3BucketName != nil {
ok := object.Key("s3BucketName")
ok.String(*v.S3BucketName)
}
if v.S3KeyPrefix != nil {
ok := object.Key("s3KeyPrefix")
ok.String(*v.S3KeyPrefix)
}
return nil
}
func awsRestjson1_serializeDocumentSchedule(v *types.Schedule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.PipelineExecutionStartCondition) > 0 {
ok := object.Key("pipelineExecutionStartCondition")
ok.String(string(v.PipelineExecutionStartCondition))
}
if v.ScheduleExpression != nil {
ok := object.Key("scheduleExpression")
ok.String(*v.ScheduleExpression)
}
if v.Timezone != nil {
ok := object.Key("timezone")
ok.String(*v.Timezone)
}
return nil
}
func awsRestjson1_serializeDocumentSecurityGroupIds(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_serializeDocumentStringList(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_serializeDocumentSystemsManagerAgent(v *types.SystemsManagerAgent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.UninstallAfterBuild != nil {
ok := object.Key("uninstallAfterBuild")
ok.Boolean(*v.UninstallAfterBuild)
}
return nil
}
func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentTargetContainerRepository(v *types.TargetContainerRepository, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RepositoryName != nil {
ok := object.Key("repositoryName")
ok.String(*v.RepositoryName)
}
if len(v.Service) > 0 {
ok := object.Key("service")
ok.String(string(v.Service))
}
return nil
}
| 5,282 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package imagebuilder
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/imagebuilder/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCancelImageCreation struct {
}
func (*validateOpCancelImageCreation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCancelImageCreation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CancelImageCreationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCancelImageCreationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateComponent struct {
}
func (*validateOpCreateComponent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateComponentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateComponentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateContainerRecipe struct {
}
func (*validateOpCreateContainerRecipe) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateContainerRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateContainerRecipeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateContainerRecipeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDistributionConfiguration struct {
}
func (*validateOpCreateDistributionConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDistributionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDistributionConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDistributionConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateImage struct {
}
func (*validateOpCreateImage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateImageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateImageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateImagePipeline struct {
}
func (*validateOpCreateImagePipeline) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateImagePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateImagePipelineInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateImagePipelineInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateImageRecipe struct {
}
func (*validateOpCreateImageRecipe) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateImageRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateImageRecipeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateImageRecipeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateInfrastructureConfiguration struct {
}
func (*validateOpCreateInfrastructureConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateInfrastructureConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateInfrastructureConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateInfrastructureConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteComponent struct {
}
func (*validateOpDeleteComponent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteComponentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteComponentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteContainerRecipe struct {
}
func (*validateOpDeleteContainerRecipe) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteContainerRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteContainerRecipeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteContainerRecipeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDistributionConfiguration struct {
}
func (*validateOpDeleteDistributionConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDistributionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDistributionConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDistributionConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteImage struct {
}
func (*validateOpDeleteImage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteImageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteImageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteImagePipeline struct {
}
func (*validateOpDeleteImagePipeline) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteImagePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteImagePipelineInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteImagePipelineInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteImageRecipe struct {
}
func (*validateOpDeleteImageRecipe) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteImageRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteImageRecipeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteImageRecipeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteInfrastructureConfiguration struct {
}
func (*validateOpDeleteInfrastructureConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteInfrastructureConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteInfrastructureConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteInfrastructureConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetComponent struct {
}
func (*validateOpGetComponent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetComponentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetComponentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetComponentPolicy struct {
}
func (*validateOpGetComponentPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetComponentPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetComponentPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetComponentPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContainerRecipe struct {
}
func (*validateOpGetContainerRecipe) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContainerRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContainerRecipeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContainerRecipeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContainerRecipePolicy struct {
}
func (*validateOpGetContainerRecipePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContainerRecipePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContainerRecipePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContainerRecipePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDistributionConfiguration struct {
}
func (*validateOpGetDistributionConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDistributionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDistributionConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDistributionConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetImage struct {
}
func (*validateOpGetImage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetImageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetImageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetImagePipeline struct {
}
func (*validateOpGetImagePipeline) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetImagePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetImagePipelineInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetImagePipelineInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetImagePolicy struct {
}
func (*validateOpGetImagePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetImagePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetImagePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetImagePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetImageRecipe struct {
}
func (*validateOpGetImageRecipe) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetImageRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetImageRecipeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetImageRecipeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetImageRecipePolicy struct {
}
func (*validateOpGetImageRecipePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetImageRecipePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetImageRecipePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetImageRecipePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetInfrastructureConfiguration struct {
}
func (*validateOpGetInfrastructureConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetInfrastructureConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetInfrastructureConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetInfrastructureConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetWorkflowExecution struct {
}
func (*validateOpGetWorkflowExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetWorkflowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetWorkflowExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetWorkflowExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetWorkflowStepExecution struct {
}
func (*validateOpGetWorkflowStepExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetWorkflowStepExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetWorkflowStepExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetWorkflowStepExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpImportComponent struct {
}
func (*validateOpImportComponent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpImportComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ImportComponentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpImportComponentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpImportVmImage struct {
}
func (*validateOpImportVmImage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpImportVmImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ImportVmImageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpImportVmImageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListComponentBuildVersions struct {
}
func (*validateOpListComponentBuildVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListComponentBuildVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListComponentBuildVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListComponentBuildVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListImageBuildVersions struct {
}
func (*validateOpListImageBuildVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListImageBuildVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListImageBuildVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListImageBuildVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListImagePackages struct {
}
func (*validateOpListImagePackages) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListImagePackages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListImagePackagesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListImagePackagesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListImagePipelineImages struct {
}
func (*validateOpListImagePipelineImages) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListImagePipelineImages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListImagePipelineImagesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListImagePipelineImagesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForResource struct {
}
func (*validateOpListTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListWorkflowExecutions struct {
}
func (*validateOpListWorkflowExecutions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListWorkflowExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListWorkflowExecutionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListWorkflowExecutionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListWorkflowStepExecutions struct {
}
func (*validateOpListWorkflowStepExecutions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListWorkflowStepExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListWorkflowStepExecutionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListWorkflowStepExecutionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutComponentPolicy struct {
}
func (*validateOpPutComponentPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutComponentPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutComponentPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutComponentPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutContainerRecipePolicy struct {
}
func (*validateOpPutContainerRecipePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutContainerRecipePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutContainerRecipePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutContainerRecipePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutImagePolicy struct {
}
func (*validateOpPutImagePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutImagePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutImagePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutImagePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutImageRecipePolicy struct {
}
func (*validateOpPutImageRecipePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutImageRecipePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutImageRecipePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutImageRecipePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartImagePipelineExecution struct {
}
func (*validateOpStartImagePipelineExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartImagePipelineExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartImagePipelineExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartImagePipelineExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateDistributionConfiguration struct {
}
func (*validateOpUpdateDistributionConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDistributionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDistributionConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDistributionConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateImagePipeline struct {
}
func (*validateOpUpdateImagePipeline) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateImagePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateImagePipelineInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateImagePipelineInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateInfrastructureConfiguration struct {
}
func (*validateOpUpdateInfrastructureConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateInfrastructureConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateInfrastructureConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateInfrastructureConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCancelImageCreationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCancelImageCreation{}, middleware.After)
}
func addOpCreateComponentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateComponent{}, middleware.After)
}
func addOpCreateContainerRecipeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateContainerRecipe{}, middleware.After)
}
func addOpCreateDistributionConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDistributionConfiguration{}, middleware.After)
}
func addOpCreateImageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateImage{}, middleware.After)
}
func addOpCreateImagePipelineValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateImagePipeline{}, middleware.After)
}
func addOpCreateImageRecipeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateImageRecipe{}, middleware.After)
}
func addOpCreateInfrastructureConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateInfrastructureConfiguration{}, middleware.After)
}
func addOpDeleteComponentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteComponent{}, middleware.After)
}
func addOpDeleteContainerRecipeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteContainerRecipe{}, middleware.After)
}
func addOpDeleteDistributionConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDistributionConfiguration{}, middleware.After)
}
func addOpDeleteImageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteImage{}, middleware.After)
}
func addOpDeleteImagePipelineValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteImagePipeline{}, middleware.After)
}
func addOpDeleteImageRecipeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteImageRecipe{}, middleware.After)
}
func addOpDeleteInfrastructureConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteInfrastructureConfiguration{}, middleware.After)
}
func addOpGetComponentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetComponent{}, middleware.After)
}
func addOpGetComponentPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetComponentPolicy{}, middleware.After)
}
func addOpGetContainerRecipeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContainerRecipe{}, middleware.After)
}
func addOpGetContainerRecipePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContainerRecipePolicy{}, middleware.After)
}
func addOpGetDistributionConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDistributionConfiguration{}, middleware.After)
}
func addOpGetImageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetImage{}, middleware.After)
}
func addOpGetImagePipelineValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetImagePipeline{}, middleware.After)
}
func addOpGetImagePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetImagePolicy{}, middleware.After)
}
func addOpGetImageRecipeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetImageRecipe{}, middleware.After)
}
func addOpGetImageRecipePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetImageRecipePolicy{}, middleware.After)
}
func addOpGetInfrastructureConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetInfrastructureConfiguration{}, middleware.After)
}
func addOpGetWorkflowExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetWorkflowExecution{}, middleware.After)
}
func addOpGetWorkflowStepExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetWorkflowStepExecution{}, middleware.After)
}
func addOpImportComponentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpImportComponent{}, middleware.After)
}
func addOpImportVmImageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpImportVmImage{}, middleware.After)
}
func addOpListComponentBuildVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListComponentBuildVersions{}, middleware.After)
}
func addOpListImageBuildVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListImageBuildVersions{}, middleware.After)
}
func addOpListImagePackagesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListImagePackages{}, middleware.After)
}
func addOpListImagePipelineImagesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListImagePipelineImages{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpListWorkflowExecutionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListWorkflowExecutions{}, middleware.After)
}
func addOpListWorkflowStepExecutionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListWorkflowStepExecutions{}, middleware.After)
}
func addOpPutComponentPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutComponentPolicy{}, middleware.After)
}
func addOpPutContainerRecipePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutContainerRecipePolicy{}, middleware.After)
}
func addOpPutImagePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutImagePolicy{}, middleware.After)
}
func addOpPutImageRecipePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutImageRecipePolicy{}, middleware.After)
}
func addOpStartImagePipelineExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartImagePipelineExecution{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateDistributionConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDistributionConfiguration{}, middleware.After)
}
func addOpUpdateImagePipelineValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateImagePipeline{}, middleware.After)
}
func addOpUpdateInfrastructureConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateInfrastructureConfiguration{}, middleware.After)
}
func validateComponentConfiguration(v *types.ComponentConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ComponentConfiguration"}
if v.ComponentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ComponentArn"))
}
if v.Parameters != nil {
if err := validateComponentParameterList(v.Parameters); err != nil {
invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateComponentConfigurationList(v []types.ComponentConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ComponentConfigurationList"}
for i := range v {
if err := validateComponentConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateComponentParameter(v *types.ComponentParameter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ComponentParameter"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateComponentParameterList(v []types.ComponentParameter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ComponentParameterList"}
for i := range v {
if err := validateComponentParameter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateContainerDistributionConfiguration(v *types.ContainerDistributionConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ContainerDistributionConfiguration"}
if v.TargetRepository == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetRepository"))
} else if v.TargetRepository != nil {
if err := validateTargetContainerRepository(v.TargetRepository); err != nil {
invalidParams.AddNested("TargetRepository", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDistribution(v *types.Distribution) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Distribution"}
if v.Region == nil {
invalidParams.Add(smithy.NewErrParamRequired("Region"))
}
if v.ContainerDistributionConfiguration != nil {
if err := validateContainerDistributionConfiguration(v.ContainerDistributionConfiguration); err != nil {
invalidParams.AddNested("ContainerDistributionConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.LaunchTemplateConfigurations != nil {
if err := validateLaunchTemplateConfigurationList(v.LaunchTemplateConfigurations); err != nil {
invalidParams.AddNested("LaunchTemplateConfigurations", err.(smithy.InvalidParamsError))
}
}
if v.S3ExportConfiguration != nil {
if err := validateS3ExportConfiguration(v.S3ExportConfiguration); err != nil {
invalidParams.AddNested("S3ExportConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.FastLaunchConfigurations != nil {
if err := validateFastLaunchConfigurationList(v.FastLaunchConfigurations); err != nil {
invalidParams.AddNested("FastLaunchConfigurations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDistributionList(v []types.Distribution) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DistributionList"}
for i := range v {
if err := validateDistribution(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFastLaunchConfiguration(v *types.FastLaunchConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FastLaunchConfiguration"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFastLaunchConfigurationList(v []types.FastLaunchConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FastLaunchConfigurationList"}
for i := range v {
if err := validateFastLaunchConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLaunchTemplateConfiguration(v *types.LaunchTemplateConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LaunchTemplateConfiguration"}
if v.LaunchTemplateId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LaunchTemplateId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLaunchTemplateConfigurationList(v []types.LaunchTemplateConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LaunchTemplateConfigurationList"}
for i := range v {
if err := validateLaunchTemplateConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3ExportConfiguration(v *types.S3ExportConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3ExportConfiguration"}
if v.RoleName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleName"))
}
if len(v.DiskImageFormat) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DiskImageFormat"))
}
if v.S3Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTargetContainerRepository(v *types.TargetContainerRepository) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TargetContainerRepository"}
if len(v.Service) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Service"))
}
if v.RepositoryName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RepositoryName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCancelImageCreationInput(v *CancelImageCreationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CancelImageCreationInput"}
if v.ImageBuildVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageBuildVersionArn"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateComponentInput(v *CreateComponentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateComponentInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SemanticVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SemanticVersion"))
}
if len(v.Platform) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Platform"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateContainerRecipeInput(v *CreateContainerRecipeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateContainerRecipeInput"}
if len(v.ContainerType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ContainerType"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SemanticVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SemanticVersion"))
}
if v.Components == nil {
invalidParams.Add(smithy.NewErrParamRequired("Components"))
} else if v.Components != nil {
if err := validateComponentConfigurationList(v.Components); err != nil {
invalidParams.AddNested("Components", err.(smithy.InvalidParamsError))
}
}
if v.ParentImage == nil {
invalidParams.Add(smithy.NewErrParamRequired("ParentImage"))
}
if v.TargetRepository == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetRepository"))
} else if v.TargetRepository != nil {
if err := validateTargetContainerRepository(v.TargetRepository); err != nil {
invalidParams.AddNested("TargetRepository", err.(smithy.InvalidParamsError))
}
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDistributionConfigurationInput(v *CreateDistributionConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDistributionConfigurationInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Distributions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Distributions"))
} else if v.Distributions != nil {
if err := validateDistributionList(v.Distributions); err != nil {
invalidParams.AddNested("Distributions", err.(smithy.InvalidParamsError))
}
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateImageInput(v *CreateImageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateImageInput"}
if v.InfrastructureConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateImagePipelineInput(v *CreateImagePipelineInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateImagePipelineInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.InfrastructureConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateImageRecipeInput(v *CreateImageRecipeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateImageRecipeInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SemanticVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SemanticVersion"))
}
if v.Components == nil {
invalidParams.Add(smithy.NewErrParamRequired("Components"))
} else if v.Components != nil {
if err := validateComponentConfigurationList(v.Components); err != nil {
invalidParams.AddNested("Components", err.(smithy.InvalidParamsError))
}
}
if v.ParentImage == nil {
invalidParams.Add(smithy.NewErrParamRequired("ParentImage"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateInfrastructureConfigurationInput(v *CreateInfrastructureConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateInfrastructureConfigurationInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.InstanceProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceProfileName"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteComponentInput(v *DeleteComponentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteComponentInput"}
if v.ComponentBuildVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ComponentBuildVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteContainerRecipeInput(v *DeleteContainerRecipeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteContainerRecipeInput"}
if v.ContainerRecipeArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerRecipeArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDistributionConfigurationInput(v *DeleteDistributionConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDistributionConfigurationInput"}
if v.DistributionConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DistributionConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteImageInput(v *DeleteImageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteImageInput"}
if v.ImageBuildVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageBuildVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteImagePipelineInput(v *DeleteImagePipelineInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteImagePipelineInput"}
if v.ImagePipelineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImagePipelineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteImageRecipeInput(v *DeleteImageRecipeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteImageRecipeInput"}
if v.ImageRecipeArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageRecipeArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteInfrastructureConfigurationInput(v *DeleteInfrastructureConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteInfrastructureConfigurationInput"}
if v.InfrastructureConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetComponentInput(v *GetComponentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetComponentInput"}
if v.ComponentBuildVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ComponentBuildVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetComponentPolicyInput(v *GetComponentPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetComponentPolicyInput"}
if v.ComponentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ComponentArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContainerRecipeInput(v *GetContainerRecipeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContainerRecipeInput"}
if v.ContainerRecipeArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerRecipeArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContainerRecipePolicyInput(v *GetContainerRecipePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContainerRecipePolicyInput"}
if v.ContainerRecipeArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerRecipeArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDistributionConfigurationInput(v *GetDistributionConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDistributionConfigurationInput"}
if v.DistributionConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DistributionConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetImageInput(v *GetImageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetImageInput"}
if v.ImageBuildVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageBuildVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetImagePipelineInput(v *GetImagePipelineInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetImagePipelineInput"}
if v.ImagePipelineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImagePipelineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetImagePolicyInput(v *GetImagePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetImagePolicyInput"}
if v.ImageArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetImageRecipeInput(v *GetImageRecipeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetImageRecipeInput"}
if v.ImageRecipeArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageRecipeArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetImageRecipePolicyInput(v *GetImageRecipePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetImageRecipePolicyInput"}
if v.ImageRecipeArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageRecipeArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetInfrastructureConfigurationInput(v *GetInfrastructureConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetInfrastructureConfigurationInput"}
if v.InfrastructureConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetWorkflowExecutionInput(v *GetWorkflowExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetWorkflowExecutionInput"}
if v.WorkflowExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WorkflowExecutionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetWorkflowStepExecutionInput(v *GetWorkflowStepExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetWorkflowStepExecutionInput"}
if v.StepExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StepExecutionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpImportComponentInput(v *ImportComponentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportComponentInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SemanticVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SemanticVersion"))
}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if len(v.Format) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Format"))
}
if len(v.Platform) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Platform"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpImportVmImageInput(v *ImportVmImageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportVmImageInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SemanticVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SemanticVersion"))
}
if len(v.Platform) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Platform"))
}
if v.VmImportTaskId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VmImportTaskId"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListComponentBuildVersionsInput(v *ListComponentBuildVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListComponentBuildVersionsInput"}
if v.ComponentVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ComponentVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListImageBuildVersionsInput(v *ListImageBuildVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListImageBuildVersionsInput"}
if v.ImageVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListImagePackagesInput(v *ListImagePackagesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListImagePackagesInput"}
if v.ImageBuildVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageBuildVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListImagePipelineImagesInput(v *ListImagePipelineImagesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListImagePipelineImagesInput"}
if v.ImagePipelineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImagePipelineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListWorkflowExecutionsInput(v *ListWorkflowExecutionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListWorkflowExecutionsInput"}
if v.ImageBuildVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageBuildVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListWorkflowStepExecutionsInput(v *ListWorkflowStepExecutionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListWorkflowStepExecutionsInput"}
if v.WorkflowExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WorkflowExecutionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutComponentPolicyInput(v *PutComponentPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutComponentPolicyInput"}
if v.ComponentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ComponentArn"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutContainerRecipePolicyInput(v *PutContainerRecipePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutContainerRecipePolicyInput"}
if v.ContainerRecipeArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerRecipeArn"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutImagePolicyInput(v *PutImagePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutImagePolicyInput"}
if v.ImageArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageArn"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutImageRecipePolicyInput(v *PutImageRecipePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutImageRecipePolicyInput"}
if v.ImageRecipeArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImageRecipeArn"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartImagePipelineExecutionInput(v *StartImagePipelineExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartImagePipelineExecutionInput"}
if v.ImagePipelineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImagePipelineArn"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateDistributionConfigurationInput(v *UpdateDistributionConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDistributionConfigurationInput"}
if v.DistributionConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DistributionConfigurationArn"))
}
if v.Distributions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Distributions"))
} else if v.Distributions != nil {
if err := validateDistributionList(v.Distributions); err != nil {
invalidParams.AddNested("Distributions", err.(smithy.InvalidParamsError))
}
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateImagePipelineInput(v *UpdateImagePipelineInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateImagePipelineInput"}
if v.ImagePipelineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImagePipelineArn"))
}
if v.InfrastructureConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateInfrastructureConfigurationInput(v *UpdateInfrastructureConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateInfrastructureConfigurationInput"}
if v.InfrastructureConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn"))
}
if v.InstanceProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceProfileName"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 2,237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver imagebuilder endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "imagebuilder.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "imagebuilder-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "imagebuilder-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "imagebuilder.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "imagebuilder.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "imagebuilder-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "imagebuilder-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "imagebuilder.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "imagebuilder-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "imagebuilder.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "imagebuilder-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "imagebuilder.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "imagebuilder-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "imagebuilder.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "imagebuilder-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "imagebuilder.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "imagebuilder.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "imagebuilder-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "imagebuilder-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "imagebuilder.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 297 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type BuildType string
// Enum values for BuildType
const (
BuildTypeUserInitiated BuildType = "USER_INITIATED"
BuildTypeScheduled BuildType = "SCHEDULED"
BuildTypeImport BuildType = "IMPORT"
)
// Values returns all known values for BuildType. 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 (BuildType) Values() []BuildType {
return []BuildType{
"USER_INITIATED",
"SCHEDULED",
"IMPORT",
}
}
type ComponentFormat string
// Enum values for ComponentFormat
const (
ComponentFormatShell ComponentFormat = "SHELL"
)
// Values returns all known values for ComponentFormat. 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 (ComponentFormat) Values() []ComponentFormat {
return []ComponentFormat{
"SHELL",
}
}
type ComponentStatus string
// Enum values for ComponentStatus
const (
ComponentStatusDeprecated ComponentStatus = "DEPRECATED"
)
// Values returns all known values for ComponentStatus. 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 (ComponentStatus) Values() []ComponentStatus {
return []ComponentStatus{
"DEPRECATED",
}
}
type ComponentType string
// Enum values for ComponentType
const (
ComponentTypeBuild ComponentType = "BUILD"
ComponentTypeTest ComponentType = "TEST"
)
// Values returns all known values for ComponentType. 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 (ComponentType) Values() []ComponentType {
return []ComponentType{
"BUILD",
"TEST",
}
}
type ContainerRepositoryService string
// Enum values for ContainerRepositoryService
const (
ContainerRepositoryServiceEcr ContainerRepositoryService = "ECR"
)
// Values returns all known values for ContainerRepositoryService. 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 (ContainerRepositoryService) Values() []ContainerRepositoryService {
return []ContainerRepositoryService{
"ECR",
}
}
type ContainerType string
// Enum values for ContainerType
const (
ContainerTypeDocker ContainerType = "DOCKER"
)
// Values returns all known values for ContainerType. 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 (ContainerType) Values() []ContainerType {
return []ContainerType{
"DOCKER",
}
}
type DiskImageFormat string
// Enum values for DiskImageFormat
const (
DiskImageFormatVmdk DiskImageFormat = "VMDK"
DiskImageFormatRaw DiskImageFormat = "RAW"
DiskImageFormatVhd DiskImageFormat = "VHD"
)
// Values returns all known values for DiskImageFormat. 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 (DiskImageFormat) Values() []DiskImageFormat {
return []DiskImageFormat{
"VMDK",
"RAW",
"VHD",
}
}
type EbsVolumeType string
// Enum values for EbsVolumeType
const (
EbsVolumeTypeStandard EbsVolumeType = "standard"
EbsVolumeTypeIo1 EbsVolumeType = "io1"
EbsVolumeTypeIo2 EbsVolumeType = "io2"
EbsVolumeTypeGp2 EbsVolumeType = "gp2"
EbsVolumeTypeGp3 EbsVolumeType = "gp3"
EbsVolumeTypeSc1 EbsVolumeType = "sc1"
EbsVolumeTypeSt1 EbsVolumeType = "st1"
)
// Values returns all known values for EbsVolumeType. 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 (EbsVolumeType) Values() []EbsVolumeType {
return []EbsVolumeType{
"standard",
"io1",
"io2",
"gp2",
"gp3",
"sc1",
"st1",
}
}
type ImageScanStatus string
// Enum values for ImageScanStatus
const (
ImageScanStatusPending ImageScanStatus = "PENDING"
ImageScanStatusScanning ImageScanStatus = "SCANNING"
ImageScanStatusCollecting ImageScanStatus = "COLLECTING"
ImageScanStatusCompleted ImageScanStatus = "COMPLETED"
ImageScanStatusAbandoned ImageScanStatus = "ABANDONED"
ImageScanStatusFailed ImageScanStatus = "FAILED"
ImageScanStatusTimedOut ImageScanStatus = "TIMED_OUT"
)
// Values returns all known values for ImageScanStatus. 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 (ImageScanStatus) Values() []ImageScanStatus {
return []ImageScanStatus{
"PENDING",
"SCANNING",
"COLLECTING",
"COMPLETED",
"ABANDONED",
"FAILED",
"TIMED_OUT",
}
}
type ImageSource string
// Enum values for ImageSource
const (
ImageSourceAmazonManaged ImageSource = "AMAZON_MANAGED"
ImageSourceAwsMarketplace ImageSource = "AWS_MARKETPLACE"
ImageSourceImported ImageSource = "IMPORTED"
ImageSourceCustom ImageSource = "CUSTOM"
)
// Values returns all known values for ImageSource. 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 (ImageSource) Values() []ImageSource {
return []ImageSource{
"AMAZON_MANAGED",
"AWS_MARKETPLACE",
"IMPORTED",
"CUSTOM",
}
}
type ImageStatus string
// Enum values for ImageStatus
const (
ImageStatusPending ImageStatus = "PENDING"
ImageStatusCreating ImageStatus = "CREATING"
ImageStatusBuilding ImageStatus = "BUILDING"
ImageStatusTesting ImageStatus = "TESTING"
ImageStatusDistributing ImageStatus = "DISTRIBUTING"
ImageStatusIntegrating ImageStatus = "INTEGRATING"
ImageStatusAvailable ImageStatus = "AVAILABLE"
ImageStatusCancelled ImageStatus = "CANCELLED"
ImageStatusFailed ImageStatus = "FAILED"
ImageStatusDeprecated ImageStatus = "DEPRECATED"
ImageStatusDeleted ImageStatus = "DELETED"
)
// Values returns all known values for ImageStatus. 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 (ImageStatus) Values() []ImageStatus {
return []ImageStatus{
"PENDING",
"CREATING",
"BUILDING",
"TESTING",
"DISTRIBUTING",
"INTEGRATING",
"AVAILABLE",
"CANCELLED",
"FAILED",
"DEPRECATED",
"DELETED",
}
}
type ImageType string
// Enum values for ImageType
const (
ImageTypeAmi ImageType = "AMI"
ImageTypeDocker ImageType = "DOCKER"
)
// Values returns all known values for ImageType. 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 (ImageType) Values() []ImageType {
return []ImageType{
"AMI",
"DOCKER",
}
}
type Ownership string
// Enum values for Ownership
const (
OwnershipSelf Ownership = "Self"
OwnershipShared Ownership = "Shared"
OwnershipAmazon Ownership = "Amazon"
OwnershipThirdparty Ownership = "ThirdParty"
)
// Values returns all known values for Ownership. 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 (Ownership) Values() []Ownership {
return []Ownership{
"Self",
"Shared",
"Amazon",
"ThirdParty",
}
}
type PipelineExecutionStartCondition string
// Enum values for PipelineExecutionStartCondition
const (
PipelineExecutionStartConditionExpressionMatchOnly PipelineExecutionStartCondition = "EXPRESSION_MATCH_ONLY"
PipelineExecutionStartConditionExpressionMatchAndDependencyUpdatesAvailable PipelineExecutionStartCondition = "EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE"
)
// Values returns all known values for PipelineExecutionStartCondition. 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 (PipelineExecutionStartCondition) Values() []PipelineExecutionStartCondition {
return []PipelineExecutionStartCondition{
"EXPRESSION_MATCH_ONLY",
"EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE",
}
}
type PipelineStatus string
// Enum values for PipelineStatus
const (
PipelineStatusDisabled PipelineStatus = "DISABLED"
PipelineStatusEnabled PipelineStatus = "ENABLED"
)
// Values returns all known values for PipelineStatus. 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 (PipelineStatus) Values() []PipelineStatus {
return []PipelineStatus{
"DISABLED",
"ENABLED",
}
}
type Platform string
// Enum values for Platform
const (
PlatformWindows Platform = "Windows"
PlatformLinux Platform = "Linux"
)
// Values returns all known values for Platform. 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 (Platform) Values() []Platform {
return []Platform{
"Windows",
"Linux",
}
}
type WorkflowExecutionStatus string
// Enum values for WorkflowExecutionStatus
const (
WorkflowExecutionStatusPending WorkflowExecutionStatus = "PENDING"
WorkflowExecutionStatusSkipped WorkflowExecutionStatus = "SKIPPED"
WorkflowExecutionStatusRunning WorkflowExecutionStatus = "RUNNING"
WorkflowExecutionStatusCompleted WorkflowExecutionStatus = "COMPLETED"
WorkflowExecutionStatusFailed WorkflowExecutionStatus = "FAILED"
WorkflowExecutionStatusRollbackInProgress WorkflowExecutionStatus = "ROLLBACK_IN_PROGRESS"
WorkflowExecutionStatusRollbackCompleted WorkflowExecutionStatus = "ROLLBACK_COMPLETED"
)
// Values returns all known values for WorkflowExecutionStatus. 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 (WorkflowExecutionStatus) Values() []WorkflowExecutionStatus {
return []WorkflowExecutionStatus{
"PENDING",
"SKIPPED",
"RUNNING",
"COMPLETED",
"FAILED",
"ROLLBACK_IN_PROGRESS",
"ROLLBACK_COMPLETED",
}
}
type WorkflowStepExecutionRollbackStatus string
// Enum values for WorkflowStepExecutionRollbackStatus
const (
WorkflowStepExecutionRollbackStatusRunning WorkflowStepExecutionRollbackStatus = "RUNNING"
WorkflowStepExecutionRollbackStatusCompleted WorkflowStepExecutionRollbackStatus = "COMPLETED"
WorkflowStepExecutionRollbackStatusSkipped WorkflowStepExecutionRollbackStatus = "SKIPPED"
WorkflowStepExecutionRollbackStatusFailed WorkflowStepExecutionRollbackStatus = "FAILED"
)
// Values returns all known values for WorkflowStepExecutionRollbackStatus. 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 (WorkflowStepExecutionRollbackStatus) Values() []WorkflowStepExecutionRollbackStatus {
return []WorkflowStepExecutionRollbackStatus{
"RUNNING",
"COMPLETED",
"SKIPPED",
"FAILED",
}
}
type WorkflowStepExecutionStatus string
// Enum values for WorkflowStepExecutionStatus
const (
WorkflowStepExecutionStatusPending WorkflowStepExecutionStatus = "PENDING"
WorkflowStepExecutionStatusSkipped WorkflowStepExecutionStatus = "SKIPPED"
WorkflowStepExecutionStatusRunning WorkflowStepExecutionStatus = "RUNNING"
WorkflowStepExecutionStatusCompleted WorkflowStepExecutionStatus = "COMPLETED"
WorkflowStepExecutionStatusFailed WorkflowStepExecutionStatus = "FAILED"
)
// Values returns all known values for WorkflowStepExecutionStatus. 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 (WorkflowStepExecutionStatus) Values() []WorkflowStepExecutionStatus {
return []WorkflowStepExecutionStatus{
"PENDING",
"SKIPPED",
"RUNNING",
"COMPLETED",
"FAILED",
}
}
type WorkflowType string
// Enum values for WorkflowType
const (
WorkflowTypeBuild WorkflowType = "BUILD"
WorkflowTypeTest WorkflowType = "TEST"
WorkflowTypeDistribution WorkflowType = "DISTRIBUTION"
)
// Values returns all known values for WorkflowType. 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 (WorkflowType) Values() []WorkflowType {
return []WorkflowType{
"BUILD",
"TEST",
"DISTRIBUTION",
}
}
| 430 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// You have exceeded the permitted request rate for the specific operation.
type CallRateLimitExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *CallRateLimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *CallRateLimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *CallRateLimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "CallRateLimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *CallRateLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// These errors are usually caused by a client action, such as using an action or
// resource on behalf of a user that doesn't have permissions to use the action or
// resource, or specifying an invalid resource identifier.
type ClientException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ClientException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ClientException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ClientException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ClientException"
}
return *e.ErrorCodeOverride
}
func (e *ClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You are not authorized to perform the requested operation.
type ForbiddenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ForbiddenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ForbiddenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ForbiddenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ForbiddenException"
}
return *e.ErrorCodeOverride
}
func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You have specified a client token for an operation using parameter values that
// differ from a previous request that used the same client token.
type IdempotentParameterMismatchException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *IdempotentParameterMismatchException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *IdempotentParameterMismatchException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *IdempotentParameterMismatchException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "IdempotentParameterMismatchException"
}
return *e.ErrorCodeOverride
}
func (e *IdempotentParameterMismatchException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// You have provided an invalid pagination token in your request.
type InvalidPaginationTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidPaginationTokenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidPaginationTokenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidPaginationTokenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidPaginationTokenException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidPaginationTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You have specified two or more mutually exclusive parameters. Review the error
// message for details.
type InvalidParameterCombinationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidParameterCombinationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidParameterCombinationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidParameterCombinationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidParameterCombinationException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidParameterCombinationException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The specified parameter is invalid. Review the available parameters for the API
// request.
type InvalidParameterException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidParameterException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidParameterException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidParameterException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidParameterException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The value that you provided for the specified parameter is invalid.
type InvalidParameterValueException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidParameterValueException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidParameterValueException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidParameterValueException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidParameterValueException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidParameterValueException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You have requested an action that that the service doesn't support.
type InvalidRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidRequestException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Your version number is out of bounds or does not follow the required syntax.
type InvalidVersionNumberException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidVersionNumberException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidVersionNumberException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidVersionNumberException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidVersionNumberException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidVersionNumberException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource that you are trying to create already exists.
type ResourceAlreadyExistsException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceAlreadyExistsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceAlreadyExistsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceAlreadyExistsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceAlreadyExistsException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You have attempted to mutate or delete a resource with a dependency that
// prohibits this action. See the error message for more details.
type ResourceDependencyException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceDependencyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceDependencyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceDependencyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceDependencyException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceDependencyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource that you are trying to operate on is currently in use. Review the
// message details and retry later.
type ResourceInUseException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceInUseException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceInUseException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceInUseException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceInUseException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// At least one of the resources referenced by your request does not exist.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// This exception is thrown when the service encounters an unrecoverable exception.
type ServiceException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// You have exceeded the number of permitted resources or operations for this
// service. For service quotas, see EC2 Image Builder endpoints and quotas (https://docs.aws.amazon.com/general/latest/gr/imagebuilder.html#limits_imagebuilder)
// .
type ServiceQuotaExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceQuotaExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceQuotaExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceQuotaExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceQuotaExceededException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The service is unable to process your request at this time.
type ServiceUnavailableException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceUnavailableException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceUnavailableException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceUnavailableException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceUnavailableException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
| 464 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// Contains counts of vulnerability findings from image scans that run when you
// create new Image Builder images, or build new versions of existing images. The
// vulnerability counts are grouped by severity level. The counts are aggregated
// across resources to create the final tally for the account that owns them.
type AccountAggregation struct {
// Identifies the account that owns the aggregated resource findings.
AccountId *string
// Counts by severity level for medium severity and higher level findings, plus a
// total for all of the findings.
SeverityCounts *SeverityCounts
noSmithyDocumentSerde
}
// In addition to your infrastructure configuration, these settings provide an
// extra layer of control over your build instances. You can also specify commands
// to run on launch for all of your build instances. Image Builder does not
// automatically install the Systems Manager agent on Windows instances. If your
// base image includes the Systems Manager agent, then the AMI that you create will
// also include the agent. For Linux instances, if the base image does not already
// include the Systems Manager agent, Image Builder installs it. For Linux
// instances where Image Builder installs the Systems Manager agent, you can choose
// whether to keep it for the AMI that you create.
type AdditionalInstanceConfiguration struct {
// Contains settings for the Systems Manager agent on your build instance.
SystemsManagerAgent *SystemsManagerAgent
// Use this property to provide commands or a command script to run when you
// launch your build instance. The userDataOverride property replaces any commands
// that Image Builder might have added to ensure that Systems Manager is installed
// on your Linux build instance. If you override the user data, make sure that you
// add commands to install Systems Manager, if it is not pre-installed on your base
// image. The user data is always base 64 encoded. For example, the following
// commands are encoded as IyEvYmluL2Jhc2gKbWtkaXIgLXAgL3Zhci9iYi8KdG91Y2ggL3Zhci$
// : #!/bin/bash mkdir -p /var/bb/ touch /var
UserDataOverride *string
noSmithyDocumentSerde
}
// Details of an Amazon EC2 AMI.
type Ami struct {
// The account ID of the owner of the AMI.
AccountId *string
// The description of the Amazon EC2 AMI. Minimum and maximum length are in
// characters.
Description *string
// The AMI ID of the Amazon EC2 AMI.
Image *string
// The name of the Amazon EC2 AMI.
Name *string
// The Amazon Web Services Region of the Amazon EC2 AMI.
Region *string
// Image status and the reason for that status.
State *ImageState
noSmithyDocumentSerde
}
// Define and configure the output AMIs of the pipeline.
type AmiDistributionConfiguration struct {
// The tags to apply to AMIs distributed to this Region.
AmiTags map[string]string
// The description of the AMI distribution configuration. Minimum and maximum
// length are in characters.
Description *string
// The KMS key identifier used to encrypt the distributed image.
KmsKeyId *string
// Launch permissions can be used to configure which Amazon Web Services accounts
// can use the AMI to launch instances.
LaunchPermission *LaunchPermissionConfiguration
// The name of the output AMI.
Name *string
// The ID of an account to which you want to distribute an image.
TargetAccountIds []string
noSmithyDocumentSerde
}
// A detailed view of a component.
type Component struct {
// The Amazon Resource Name (ARN) of the component.
Arn *string
// The change description of the component.
ChangeDescription *string
// Component data contains the YAML document content for the component.
Data *string
// The date that Image Builder created the component.
DateCreated *string
// The description of the component.
Description *string
// The encryption status of the component.
Encrypted *bool
// The KMS key identifier used to encrypt the component.
KmsKeyId *string
// The name of the component.
Name *string
// Indicates whether component source is hidden from view in the console, and from
// component detail results for API, CLI, or SDK operations.
Obfuscate bool
// The owner of the component.
Owner *string
// Contains parameter details for each of the parameters that the component
// document defined for the component.
Parameters []ComponentParameterDetail
// The operating system platform of the component.
Platform Platform
// Contains the name of the publisher if this is a third-party component.
// Otherwise, this property is empty.
Publisher *string
// Describes the current status of the component. This is used for components that
// are no longer active.
State *ComponentState
// The operating system (OS) version supported by the component. If the OS
// information is available, Image Builder performs a prefix match against the base
// image OS version during image recipe creation.
SupportedOsVersions []string
// The tags that apply to the component.
Tags map[string]string
// The component type specifies whether Image Builder uses the component to build
// the image or only to test it.
Type ComponentType
// The version of the component.
Version *string
noSmithyDocumentSerde
}
// Configuration details of the component.
type ComponentConfiguration struct {
// The Amazon Resource Name (ARN) of the component.
//
// This member is required.
ComponentArn *string
// A group of parameter settings that Image Builder uses to configure the
// component for a specific recipe.
Parameters []ComponentParameter
noSmithyDocumentSerde
}
// Contains a key/value pair that sets the named component parameter.
type ComponentParameter struct {
// The name of the component parameter to set.
//
// This member is required.
Name *string
// Sets the value for the named component parameter.
//
// This member is required.
Value []string
noSmithyDocumentSerde
}
// Defines a parameter that is used to provide configuration details for the
// component.
type ComponentParameterDetail struct {
// The name of this input parameter.
//
// This member is required.
Name *string
// The type of input this parameter provides. The currently supported value is
// "string".
//
// This member is required.
Type *string
// The default value of this parameter if no input is provided.
DefaultValue []string
// Describes this parameter.
Description *string
noSmithyDocumentSerde
}
// A group of fields that describe the current status of components that are no
// longer active.
type ComponentState struct {
// Describes how or why the component changed state.
Reason *string
// The current state of the component.
Status ComponentStatus
noSmithyDocumentSerde
}
// A high-level summary of a component.
type ComponentSummary struct {
// The Amazon Resource Name (ARN) of the component.
Arn *string
// The change description for the current version of the component.
ChangeDescription *string
// The original creation date of the component.
DateCreated *string
// The description of the component.
Description *string
// The name of the component.
Name *string
// Indicates whether component source is hidden from view in the console, and from
// component detail results for API, CLI, or SDK operations.
Obfuscate bool
// The owner of the component.
Owner *string
// The operating system platform of the component.
Platform Platform
// Contains the name of the publisher if this is a third-party component.
// Otherwise, this property is empty.
Publisher *string
// Describes the current status of the component.
State *ComponentState
// The operating system (OS) version that the component supports. If the OS
// information is available, Image Builder performs a prefix match against the base
// image OS version during image recipe creation.
SupportedOsVersions []string
// The tags that apply to the component.
Tags map[string]string
// The component type specifies whether Image Builder uses the component to build
// the image or only to test it.
Type ComponentType
// The version of the component.
Version *string
noSmithyDocumentSerde
}
// The defining characteristics of a specific version of an Amazon Web Services
// TOE component.
type ComponentVersion struct {
// The Amazon Resource Name (ARN) of the component. Semantic versioning is
// included in each object's Amazon Resource Name (ARN), at the level that applies
// to that object as follows:
// - Versionless ARNs and Name ARNs do not include specific values in any of the
// nodes. The nodes are either left off entirely, or they are specified as
// wildcards, for example: x.x.x.
// - Version ARNs have only the first three nodes: ..
// - Build version ARNs have all four nodes, and point to a specific build for a
// specific version of an object.
Arn *string
// The date that the component was created.
DateCreated *string
// The description of the component.
Description *string
// The name of the component.
Name *string
// The owner of the component.
Owner *string
// The platform of the component.
Platform Platform
// he operating system (OS) version supported by the component. If the OS
// information is available, a prefix match is performed against the base image OS
// version during image recipe creation.
SupportedOsVersions []string
// The type of the component denotes whether the component is used to build the
// image or only to test it.
Type ComponentType
// The semantic version of the component. The semantic version has four nodes:
// ../. You can assign values for the first three, and can filter on all of them.
// Assignment: For the first three nodes you can assign any positive integer value,
// including zero, with an upper limit of 2^30-1, or 1073741823 for each node.
// Image Builder automatically assigns the build number to the fourth node.
// Patterns: You can use any numeric pattern that adheres to the assignment
// requirements for the nodes that you can assign. For example, you might choose a
// software version pattern, such as 1.0.0, or a date, such as 2021.01.01.
// Filtering: With semantic versioning, you have the flexibility to use wildcards
// (x) to specify the most recent versions or nodes when selecting the base image
// or components for your recipe. When you use a wildcard in any node, all nodes to
// the right of the first wildcard must also be wildcards.
Version *string
noSmithyDocumentSerde
}
// A container encapsulates the runtime environment for an application.
type Container struct {
// A list of URIs for containers created in the context Region.
ImageUris []string
// Containers and container images are Region-specific. This is the Region context
// for the container.
Region *string
noSmithyDocumentSerde
}
// Container distribution settings for encryption, licensing, and sharing in a
// specific Region.
type ContainerDistributionConfiguration struct {
// The destination repository for the container distribution configuration.
//
// This member is required.
TargetRepository *TargetContainerRepository
// Tags that are attached to the container distribution configuration.
ContainerTags []string
// The description of the container distribution configuration.
Description *string
noSmithyDocumentSerde
}
// A container recipe.
type ContainerRecipe struct {
// The Amazon Resource Name (ARN) of the container recipe. Semantic versioning is
// included in each object's Amazon Resource Name (ARN), at the level that applies
// to that object as follows:
// - Versionless ARNs and Name ARNs do not include specific values in any of the
// nodes. The nodes are either left off entirely, or they are specified as
// wildcards, for example: x.x.x.
// - Version ARNs have only the first three nodes: ..
// - Build version ARNs have all four nodes, and point to a specific build for a
// specific version of an object.
Arn *string
// Build and test components that are included in the container recipe. Recipes
// require a minimum of one build component, and can have a maximum of 20 build and
// test components in any combination.
Components []ComponentConfiguration
// Specifies the type of container, such as Docker.
ContainerType ContainerType
// The date when this container recipe was created.
DateCreated *string
// The description of the container recipe.
Description *string
// Dockerfiles are text documents that are used to build Docker containers, and
// ensure that they contain all of the elements required by the application running
// inside. The template data consists of contextual variables where Image Builder
// places build information or scripts, based on your container image recipe.
DockerfileTemplateData *string
// A flag that indicates if the target container is encrypted.
Encrypted *bool
// A group of options that can be used to configure an instance for building and
// testing container images.
InstanceConfiguration *InstanceConfiguration
// Identifies which KMS key is used to encrypt the container image for
// distribution to the target Region.
KmsKeyId *string
// The name of the container recipe.
Name *string
// The owner of the container recipe.
Owner *string
// The base image for the container recipe.
ParentImage *string
// The system platform for the container, such as Windows or Linux.
Platform Platform
// Tags that are attached to the container recipe.
Tags map[string]string
// The destination repository for the container image.
TargetRepository *TargetContainerRepository
// The semantic version of the container recipe. The semantic version has four
// nodes: ../. You can assign values for the first three, and can filter on all of
// them. Assignment: For the first three nodes you can assign any positive integer
// value, including zero, with an upper limit of 2^30-1, or 1073741823 for each
// node. Image Builder automatically assigns the build number to the fourth node.
// Patterns: You can use any numeric pattern that adheres to the assignment
// requirements for the nodes that you can assign. For example, you might choose a
// software version pattern, such as 1.0.0, or a date, such as 2021.01.01.
// Filtering: With semantic versioning, you have the flexibility to use wildcards
// (x) to specify the most recent versions or nodes when selecting the base image
// or components for your recipe. When you use a wildcard in any node, all nodes to
// the right of the first wildcard must also be wildcards.
Version *string
// The working directory for use during build and test workflows.
WorkingDirectory *string
noSmithyDocumentSerde
}
// A summary of a container recipe
type ContainerRecipeSummary struct {
// The Amazon Resource Name (ARN) of the container recipe.
Arn *string
// Specifies the type of container, such as "Docker".
ContainerType ContainerType
// The date when this container recipe was created.
DateCreated *string
// The name of the container recipe.
Name *string
// The owner of the container recipe.
Owner *string
// The base image for the container recipe.
ParentImage *string
// The system platform for the container, such as Windows or Linux.
Platform Platform
// Tags that are attached to the container recipe.
Tags map[string]string
noSmithyDocumentSerde
}
// Amazon Inspector generates a risk score for each finding. This score helps you
// to prioritize findings, to focus on the most critical findings and the most
// vulnerable resources. The score uses the Common Vulnerability Scoring System
// (CVSS) format. This format is a modification of the base CVSS score that the
// National Vulnerability Database (NVD) provides. For more information about
// severity levels, see Severity levels for Amazon Inspector findings (https://docs.aws.amazon.com/inspector/latest/user/findings-understanding-severity.html)
// in the Amazon Inspector User Guide.
type CvssScore struct {
// The CVSS base score.
BaseScore *float64
// The vector string of the CVSS score.
ScoringVector *string
// The source of the CVSS score.
Source *string
// The CVSS version that generated the score.
Version *string
noSmithyDocumentSerde
}
// Details about an adjustment that Amazon Inspector made to the CVSS score for a
// finding.
type CvssScoreAdjustment struct {
// The metric that Amazon Inspector used to adjust the CVSS score.
Metric *string
// The reason for the CVSS score adjustment.
Reason *string
noSmithyDocumentSerde
}
// Details about the source of the score, and the factors that determined the
// adjustments to create the final score.
type CvssScoreDetails struct {
// An object that contains details about an adjustment that Amazon Inspector made
// to the CVSS score for the finding.
Adjustments []CvssScoreAdjustment
// The source of the finding.
CvssSource *string
// The CVSS score.
Score *float64
// The source for the CVSS score.
ScoreSource *string
// A vector that measures the severity of the vulnerability.
ScoringVector *string
// The CVSS version that generated the score.
Version *string
noSmithyDocumentSerde
}
// Defines the settings for a specific Region.
type Distribution struct {
// The target Region.
//
// This member is required.
Region *string
// The specific AMI settings; for example, launch permissions or AMI tags.
AmiDistributionConfiguration *AmiDistributionConfiguration
// Container distribution settings for encryption, licensing, and sharing in a
// specific Region.
ContainerDistributionConfiguration *ContainerDistributionConfiguration
// The Windows faster-launching configurations to use for AMI distribution.
FastLaunchConfigurations []FastLaunchConfiguration
// A group of launchTemplateConfiguration settings that apply to image
// distribution for specified accounts.
LaunchTemplateConfigurations []LaunchTemplateConfiguration
// The License Manager Configuration to associate with the AMI in the specified
// Region.
LicenseConfigurationArns []string
// Configure export settings to deliver disk images created from your image build,
// using a file format that is compatible with your VMs in that Region.
S3ExportConfiguration *S3ExportConfiguration
noSmithyDocumentSerde
}
// A distribution configuration.
type DistributionConfiguration struct {
// The maximum duration in minutes for this distribution configuration.
//
// This member is required.
TimeoutMinutes *int32
// The Amazon Resource Name (ARN) of the distribution configuration.
Arn *string
// The date on which this distribution configuration was created.
DateCreated *string
// The date on which this distribution configuration was last updated.
DateUpdated *string
// The description of the distribution configuration.
Description *string
// The distribution objects that apply Region-specific settings for the deployment
// of the image to targeted Regions.
Distributions []Distribution
// The name of the distribution configuration.
Name *string
// The tags of the distribution configuration.
Tags map[string]string
noSmithyDocumentSerde
}
// A high-level overview of a distribution configuration.
type DistributionConfigurationSummary struct {
// The Amazon Resource Name (ARN) of the distribution configuration.
Arn *string
// The date on which the distribution configuration was created.
DateCreated *string
// The date on which the distribution configuration was updated.
DateUpdated *string
// The description of the distribution configuration.
Description *string
// The name of the distribution configuration.
Name *string
// A list of Regions where the container image is distributed to.
Regions []string
// The tags associated with the distribution configuration.
Tags map[string]string
noSmithyDocumentSerde
}
// Amazon EBS-specific block device mapping specifications.
type EbsInstanceBlockDeviceSpecification struct {
// Use to configure delete on termination of the associated device.
DeleteOnTermination *bool
// Use to configure device encryption.
Encrypted *bool
// Use to configure device IOPS.
Iops *int32
// Use to configure the KMS key to use when encrypting the device.
KmsKeyId *string
// The snapshot that defines the device contents.
SnapshotId *string
// For GP3 volumes only – The throughput in MiB/s that the volume supports.
Throughput *int32
// Use to override the device's volume size.
VolumeSize *int32
// Use to override the device's volume type.
VolumeType EbsVolumeType
noSmithyDocumentSerde
}
// Settings that Image Builder uses to configure the ECR repository and the output
// container images that Amazon Inspector scans.
type EcrConfiguration struct {
// Tags for Image Builder to apply to the output container image that &INS; scans.
// Tags can help you identify and manage your scanned images.
ContainerTags []string
// The name of the container repository that Amazon Inspector scans to identify
// findings for your container images. The name includes the path for the
// repository location. If you don’t provide this information, Image Builder
// creates a repository in your account named
// image-builder-image-scanning-repository for vulnerability scans of your output
// container images.
RepositoryName *string
noSmithyDocumentSerde
}
// Define and configure faster launching for output Windows AMIs.
type FastLaunchConfiguration struct {
// A Boolean that represents the current state of faster launching for the Windows
// AMI. Set to true to start using Windows faster launching, or false to stop
// using it.
//
// This member is required.
Enabled bool
// The owner account ID for the fast-launch enabled Windows AMI.
AccountId *string
// The launch template that the fast-launch enabled Windows AMI uses when it
// launches Windows instances to create pre-provisioned snapshots.
LaunchTemplate *FastLaunchLaunchTemplateSpecification
// The maximum number of parallel instances that are launched for creating
// resources.
MaxParallelLaunches *int32
// Configuration settings for managing the number of snapshots that are created
// from pre-provisioned instances for the Windows AMI when faster launching is
// enabled.
SnapshotConfiguration *FastLaunchSnapshotConfiguration
noSmithyDocumentSerde
}
// Identifies the launch template that the associated Windows AMI uses for
// launching an instance when faster launching is enabled. You can specify either
// the launchTemplateName or the launchTemplateId , but not both.
type FastLaunchLaunchTemplateSpecification struct {
// The ID of the launch template to use for faster launching for a Windows AMI.
LaunchTemplateId *string
// The name of the launch template to use for faster launching for a Windows AMI.
LaunchTemplateName *string
// The version of the launch template to use for faster launching for a Windows
// AMI.
LaunchTemplateVersion *string
noSmithyDocumentSerde
}
// Configuration settings for creating and managing pre-provisioned snapshots for
// a fast-launch enabled Windows AMI.
type FastLaunchSnapshotConfiguration struct {
// The number of pre-provisioned snapshots to keep on hand for a fast-launch
// enabled Windows AMI.
TargetResourceCount *int32
noSmithyDocumentSerde
}
// A filter name and value pair that is used to return a more specific list of
// results from a list operation. Filters can be used to match a set of resources
// by specific criteria, such as tags, attributes, or IDs.
type Filter struct {
// The name of the filter. Filter names are case-sensitive.
Name *string
// The filter values. Filter values are case-sensitive.
Values []string
noSmithyDocumentSerde
}
// An Image Builder image. You must specify exactly one recipe for the image –
// either a container recipe ( containerRecipe ), which creates a container image,
// or an image recipe ( imageRecipe ), which creates an AMI.
type Image struct {
// The Amazon Resource Name (ARN) of the image. Semantic versioning is included in
// each object's Amazon Resource Name (ARN), at the level that applies to that
// object as follows:
// - Versionless ARNs and Name ARNs do not include specific values in any of the
// nodes. The nodes are either left off entirely, or they are specified as
// wildcards, for example: x.x.x.
// - Version ARNs have only the first three nodes: ..
// - Build version ARNs have all four nodes, and point to a specific build for a
// specific version of an object.
Arn *string
// Indicates the type of build that created this image. The build can be initiated
// in the following ways:
// - USER_INITIATED – A manual pipeline build request.
// - SCHEDULED – A pipeline build initiated by a cron expression in the Image
// Builder pipeline, or from EventBridge.
// - IMPORT – A VM import created the image to use as the base image for the
// recipe.
BuildType BuildType
// For container images, this is the container recipe that Image Builder used to
// create the image. For images that distribute an AMI, this is empty.
ContainerRecipe *ContainerRecipe
// The date on which Image Builder created this image.
DateCreated *string
// The distribution configuration that Image Builder used to create this image.
DistributionConfiguration *DistributionConfiguration
// Indicates whether Image Builder collects additional information about the
// image, such as the operating system (OS) version and package list.
EnhancedImageMetadataEnabled *bool
// For images that distribute an AMI, this is the image recipe that Image Builder
// used to create the image. For container images, this is empty.
ImageRecipe *ImageRecipe
// Contains settings for vulnerability scans.
ImageScanningConfiguration *ImageScanningConfiguration
// The origin of the base image that Image Builder used to build this image.
ImageSource ImageSource
// The image tests that ran when that Image Builder created this image.
ImageTestsConfiguration *ImageTestsConfiguration
// The infrastructure that Image Builder used to create this image.
InfrastructureConfiguration *InfrastructureConfiguration
// The name of the image.
Name *string
// The operating system version for instances that launch from this image. For
// example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server 2019.
OsVersion *string
// The output resources that Image Builder produces for this image.
OutputResources *OutputResources
// The image operating system platform, such as Linux or Windows.
Platform Platform
// Contains information about the current state of scans for this image.
ScanState *ImageScanState
// The Amazon Resource Name (ARN) of the image pipeline that created this image.
SourcePipelineArn *string
// The name of the image pipeline that created this image.
SourcePipelineName *string
// The state of the image.
State *ImageState
// The tags that apply to this image.
Tags map[string]string
// Specifies whether this image produces an AMI or a container image.
Type ImageType
// The semantic version of the image. The semantic version has four nodes: ../.
// You can assign values for the first three, and can filter on all of them.
// Assignment: For the first three nodes you can assign any positive integer value,
// including zero, with an upper limit of 2^30-1, or 1073741823 for each node.
// Image Builder automatically assigns the build number to the fourth node.
// Patterns: You can use any numeric pattern that adheres to the assignment
// requirements for the nodes that you can assign. For example, you might choose a
// software version pattern, such as 1.0.0, or a date, such as 2021.01.01.
// Filtering: With semantic versioning, you have the flexibility to use wildcards
// (x) to specify the most recent versions or nodes when selecting the base image
// or components for your recipe. When you use a wildcard in any node, all nodes to
// the right of the first wildcard must also be wildcards.
Version *string
noSmithyDocumentSerde
}
// Contains vulnerability counts for a specific image.
type ImageAggregation struct {
// The Amazon Resource Name (ARN) that identifies the image for this aggregation.
ImageBuildVersionArn *string
// Counts by severity level for medium severity and higher level findings, plus a
// total for all of the findings for the specified image.
SeverityCounts *SeverityCounts
noSmithyDocumentSerde
}
// Represents a package installed on an Image Builder image.
type ImagePackage struct {
// The name of the package as reported to the operating system package manager.
PackageName *string
// The version of the package as reported to the operating system package manager.
PackageVersion *string
noSmithyDocumentSerde
}
// Details of an image pipeline.
type ImagePipeline struct {
// The Amazon Resource Name (ARN) of the image pipeline.
Arn *string
// The Amazon Resource Name (ARN) of the container recipe that is used for this
// pipeline.
ContainerRecipeArn *string
// The date on which this image pipeline was created.
DateCreated *string
// This is no longer supported, and does not return a value.
DateLastRun *string
// The next date when the pipeline is scheduled to run.
DateNextRun *string
// The date on which this image pipeline was last updated.
DateUpdated *string
// The description of the image pipeline.
Description *string
// The Amazon Resource Name (ARN) of the distribution configuration associated
// with this image pipeline.
DistributionConfigurationArn *string
// Collects additional information about the image being created, including the
// operating system (OS) version and package list. This information is used to
// enhance the overall experience of using EC2 Image Builder. Enabled by default.
EnhancedImageMetadataEnabled *bool
// The Amazon Resource Name (ARN) of the image recipe associated with this image
// pipeline.
ImageRecipeArn *string
// Contains settings for vulnerability scans.
ImageScanningConfiguration *ImageScanningConfiguration
// The image tests configuration of the image pipeline.
ImageTestsConfiguration *ImageTestsConfiguration
// The Amazon Resource Name (ARN) of the infrastructure configuration associated
// with this image pipeline.
InfrastructureConfigurationArn *string
// The name of the image pipeline.
Name *string
// The platform of the image pipeline.
Platform Platform
// The schedule of the image pipeline.
Schedule *Schedule
// The status of the image pipeline.
Status PipelineStatus
// The tags of this image pipeline.
Tags map[string]string
noSmithyDocumentSerde
}
// Contains vulnerability counts for a specific image pipeline.
type ImagePipelineAggregation struct {
// The Amazon Resource Name (ARN) that identifies the image pipeline for this
// aggregation.
ImagePipelineArn *string
// Counts by severity level for medium severity and higher level findings, plus a
// total for all of the findings for the specified image pipeline.
SeverityCounts *SeverityCounts
noSmithyDocumentSerde
}
// An image recipe.
type ImageRecipe struct {
// Before you create a new AMI, Image Builder launches temporary Amazon EC2
// instances to build and test your image configuration. Instance configuration
// adds a layer of control over those instances. You can define settings and add
// scripts to run when an instance is launched from your AMI.
AdditionalInstanceConfiguration *AdditionalInstanceConfiguration
// The Amazon Resource Name (ARN) of the image recipe.
Arn *string
// The block device mappings to apply when creating images from this recipe.
BlockDeviceMappings []InstanceBlockDeviceMapping
// The components that are included in the image recipe. Recipes require a minimum
// of one build component, and can have a maximum of 20 build and test components
// in any combination.
Components []ComponentConfiguration
// The date on which this image recipe was created.
DateCreated *string
// The description of the image recipe.
Description *string
// The name of the image recipe.
Name *string
// The owner of the image recipe.
Owner *string
// The base image of the image recipe.
ParentImage *string
// The platform of the image recipe.
Platform Platform
// The tags of the image recipe.
Tags map[string]string
// Specifies which type of image is created by the recipe - an AMI or a container
// image.
Type ImageType
// The version of the image recipe.
Version *string
// The working directory to be used during build and test workflows.
WorkingDirectory *string
noSmithyDocumentSerde
}
// A summary of an image recipe.
type ImageRecipeSummary struct {
// The Amazon Resource Name (ARN) of the image recipe.
Arn *string
// The date on which this image recipe was created.
DateCreated *string
// The name of the image recipe.
Name *string
// The owner of the image recipe.
Owner *string
// The base image of the image recipe.
ParentImage *string
// The platform of the image recipe.
Platform Platform
// The tags of the image recipe.
Tags map[string]string
noSmithyDocumentSerde
}
// Contains details about a vulnerability scan finding.
type ImageScanFinding struct {
// The Amazon Web Services account ID that's associated with the finding.
AwsAccountId *string
// The description of the finding.
Description *string
// The date and time when the finding was first observed.
FirstObservedAt *time.Time
// Details about whether a fix is available for any of the packages that are
// identified in the finding through a version update.
FixAvailable *string
// The Amazon Resource Name (ARN) of the image build version that's associated
// with the finding.
ImageBuildVersionArn *string
// The Amazon Resource Name (ARN) of the image pipeline that's associated with the
// finding.
ImagePipelineArn *string
// The score that Amazon Inspector assigned for the finding.
InspectorScore *float64
// An object that contains details of the Amazon Inspector score.
InspectorScoreDetails *InspectorScoreDetails
// An object that contains the details of a package vulnerability finding.
PackageVulnerabilityDetails *PackageVulnerabilityDetails
// An object that contains the details about how to remediate the finding.
Remediation *Remediation
// The severity of the finding.
Severity *string
// The title of the finding.
Title *string
// The type of the finding. Image Builder looks for findings of the type
// PACKAGE_VULNERABILITY that apply to output images, and excludes other types.
Type *string
// The timestamp when the finding was last updated.
UpdatedAt *time.Time
noSmithyDocumentSerde
}
// This returns exactly one type of aggregation, based on the filter that Image
// Builder applies in its API action.
type ImageScanFindingAggregation struct {
// Returns an object that contains severity counts based on an account ID.
AccountAggregation *AccountAggregation
// Returns an object that contains severity counts based on the Amazon Resource
// Name (ARN) for a specific image.
ImageAggregation *ImageAggregation
// Returns an object that contains severity counts based on an image pipeline ARN.
ImagePipelineAggregation *ImagePipelineAggregation
// Returns an object that contains severity counts based on vulnerability ID.
VulnerabilityIdAggregation *VulnerabilityIdAggregation
noSmithyDocumentSerde
}
// A name value pair that Image Builder applies to streamline results from the
// vulnerability scan findings list action.
type ImageScanFindingsFilter struct {
// The name of the image scan finding filter. Filter names are case-sensitive.
Name *string
// The filter values. Filter values are case-sensitive.
Values []string
noSmithyDocumentSerde
}
// Contains settings for Image Builder image resource and container image scans.
type ImageScanningConfiguration struct {
// Contains Amazon ECR settings for vulnerability scans.
EcrConfiguration *EcrConfiguration
// A setting that indicates whether Image Builder keeps a snapshot of the
// vulnerability scans that Amazon Inspector runs against the build instance when
// you create a new image.
ImageScanningEnabled *bool
noSmithyDocumentSerde
}
// Shows the vulnerability scan status for a specific image, and the reason for
// that status.
type ImageScanState struct {
// The reason for the scan status for the image.
Reason *string
// The current state of vulnerability scans for the image.
Status ImageScanStatus
noSmithyDocumentSerde
}
// Image status and the reason for that status.
type ImageState struct {
// The reason for the status of the image.
Reason *string
// The status of the image.
Status ImageStatus
noSmithyDocumentSerde
}
// An image summary.
type ImageSummary struct {
// The Amazon Resource Name (ARN) of the image.
Arn *string
// Indicates the type of build that created this image. The build can be initiated
// in the following ways:
// - USER_INITIATED – A manual pipeline build request.
// - SCHEDULED – A pipeline build initiated by a cron expression in the Image
// Builder pipeline, or from EventBridge.
// - IMPORT – A VM import created the image to use as the base image for the
// recipe.
BuildType BuildType
// The date on which Image Builder created this image.
DateCreated *string
// The origin of the base image that Image Builder used to build this image.
ImageSource ImageSource
// The name of the image.
Name *string
// The operating system version of the instances that launch from this image. For
// example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server 2019.
OsVersion *string
// The output resources that Image Builder produced when it created this image.
OutputResources *OutputResources
// The owner of the image.
Owner *string
// The image operating system platform, such as Linux or Windows.
Platform Platform
// The state of the image.
State *ImageState
// The tags that apply to this image.
Tags map[string]string
// Specifies whether this image produces an AMI or a container image.
Type ImageType
// The version of the image.
Version *string
noSmithyDocumentSerde
}
// Configure image tests for your pipeline build. Tests run after building the
// image, to verify that the AMI or container image is valid before distributing
// it.
type ImageTestsConfiguration struct {
// Determines if tests should run after building the image. Image Builder defaults
// to enable tests to run following the image build, before image distribution.
ImageTestsEnabled *bool
// The maximum time in minutes that tests are permitted to run. The timeoutMinutes
// attribute is not currently active. This value is ignored.
TimeoutMinutes *int32
noSmithyDocumentSerde
}
// The defining characteristics of a specific version of an Image Builder image.
type ImageVersion struct {
// The Amazon Resource Name (ARN) of a specific version of an Image Builder image.
// Semantic versioning is included in each object's Amazon Resource Name (ARN), at
// the level that applies to that object as follows:
// - Versionless ARNs and Name ARNs do not include specific values in any of the
// nodes. The nodes are either left off entirely, or they are specified as
// wildcards, for example: x.x.x.
// - Version ARNs have only the first three nodes: ..
// - Build version ARNs have all four nodes, and point to a specific build for a
// specific version of an object.
Arn *string
// Indicates the type of build that created this image. The build can be initiated
// in the following ways:
// - USER_INITIATED – A manual pipeline build request.
// - SCHEDULED – A pipeline build initiated by a cron expression in the Image
// Builder pipeline, or from EventBridge.
// - IMPORT – A VM import created the image to use as the base image for the
// recipe.
BuildType BuildType
// The date on which this specific version of the Image Builder image was created.
DateCreated *string
// The origin of the base image that Image Builder used to build this image.
ImageSource ImageSource
// The name of this specific version of an Image Builder image.
Name *string
// The operating system version of the Amazon EC2 build instance. For example,
// Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server 2019.
OsVersion *string
// The owner of the image version.
Owner *string
// The operating system platform of the image version, for example "Windows" or
// "Linux".
Platform Platform
// Specifies whether this image produces an AMI or a container image.
Type ImageType
// Details for a specific version of an Image Builder image. This version follows
// the semantic version syntax. The semantic version has four nodes: ../. You can
// assign values for the first three, and can filter on all of them. Assignment:
// For the first three nodes you can assign any positive integer value, including
// zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder
// automatically assigns the build number to the fourth node. Patterns: You can use
// any numeric pattern that adheres to the assignment requirements for the nodes
// that you can assign. For example, you might choose a software version pattern,
// such as 1.0.0, or a date, such as 2021.01.01. Filtering: With semantic
// versioning, you have the flexibility to use wildcards (x) to specify the most
// recent versions or nodes when selecting the base image or components for your
// recipe. When you use a wildcard in any node, all nodes to the right of the first
// wildcard must also be wildcards.
Version *string
noSmithyDocumentSerde
}
// Details of the infrastructure configuration.
type InfrastructureConfiguration struct {
// The Amazon Resource Name (ARN) of the infrastructure configuration.
Arn *string
// The date on which the infrastructure configuration was created.
DateCreated *string
// The date on which the infrastructure configuration was last updated.
DateUpdated *string
// The description of the infrastructure configuration.
Description *string
// The instance metadata option settings for the infrastructure configuration.
InstanceMetadataOptions *InstanceMetadataOptions
// The instance profile of the infrastructure configuration.
InstanceProfileName *string
// The instance types of the infrastructure configuration.
InstanceTypes []string
// The Amazon EC2 key pair of the infrastructure configuration.
KeyPair *string
// The logging configuration of the infrastructure configuration.
Logging *Logging
// The name of the infrastructure configuration.
Name *string
// The tags attached to the resource created by Image Builder.
ResourceTags map[string]string
// The security group IDs of the infrastructure configuration.
SecurityGroupIds []string
// The Amazon Resource Name (ARN) for the SNS topic to which we send image build
// event notifications. EC2 Image Builder is unable to send notifications to SNS
// topics that are encrypted using keys from other accounts. The key that is used
// to encrypt the SNS topic must reside in the account that the Image Builder
// service runs under.
SnsTopicArn *string
// The subnet ID of the infrastructure configuration.
SubnetId *string
// The tags of the infrastructure configuration.
Tags map[string]string
// The terminate instance on failure configuration of the infrastructure
// configuration.
TerminateInstanceOnFailure *bool
noSmithyDocumentSerde
}
// The infrastructure used when building Amazon EC2 AMIs.
type InfrastructureConfigurationSummary struct {
// The Amazon Resource Name (ARN) of the infrastructure configuration.
Arn *string
// The date on which the infrastructure configuration was created.
DateCreated *string
// The date on which the infrastructure configuration was last updated.
DateUpdated *string
// The description of the infrastructure configuration.
Description *string
// The instance profile of the infrastructure configuration.
InstanceProfileName *string
// The instance types of the infrastructure configuration.
InstanceTypes []string
// The name of the infrastructure configuration.
Name *string
// The tags attached to the image created by Image Builder.
ResourceTags map[string]string
// The tags of the infrastructure configuration.
Tags map[string]string
noSmithyDocumentSerde
}
// Information about the factors that influenced the score that Amazon Inspector
// assigned for a finding.
type InspectorScoreDetails struct {
// An object that contains details about an adjustment that Amazon Inspector made
// to the CVSS score for the finding.
AdjustedCvss *CvssScoreDetails
noSmithyDocumentSerde
}
// Defines block device mappings for the instance used to configure your image.
type InstanceBlockDeviceMapping struct {
// The device to which these mappings apply.
DeviceName *string
// Use to manage Amazon EBS-specific configuration for this mapping.
Ebs *EbsInstanceBlockDeviceSpecification
// Use to remove a mapping from the base image.
NoDevice *string
// Use to manage instance ephemeral devices.
VirtualName *string
noSmithyDocumentSerde
}
// Defines a custom base AMI and block device mapping configurations of an
// instance used for building and testing container images.
type InstanceConfiguration struct {
// Defines the block devices to attach for building an instance from this Image
// Builder AMI.
BlockDeviceMappings []InstanceBlockDeviceMapping
// The AMI ID to use as the base image for a container build and test instance. If
// not specified, Image Builder will use the appropriate ECS-optimized AMI as a
// base image.
Image *string
noSmithyDocumentSerde
}
// The instance metadata options that apply to the HTTP requests that pipeline
// builds use to launch EC2 build and test instances. For more information about
// instance metadata options, see Configure the instance metadata options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html)
// in the Amazon EC2 User Guide for Linux instances, or Configure the instance
// metadata options (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html)
// in the Amazon EC2 Windows Guide for Windows instances.
type InstanceMetadataOptions struct {
// Limit the number of hops that an instance metadata request can traverse to
// reach its destination. The default is one hop. However, if HTTP tokens are
// required, container image builds need a minimum of two hops.
HttpPutResponseHopLimit *int32
// Indicates whether a signed token header is required for instance metadata
// retrieval requests. The values affect the response as follows:
// - required – When you retrieve the IAM role credentials, version 2.0
// credentials are returned in all cases.
// - optional – You can include a signed token header in your request to
// retrieve instance metadata, or you can leave it out. If you include it, version
// 2.0 credentials are returned for the IAM role. Otherwise, version 1.0
// credentials are returned.
// The default setting is optional.
HttpTokens *string
noSmithyDocumentSerde
}
// Describes the configuration for a launch permission. The launch permission
// modification request is sent to the Amazon EC2 ModifyImageAttribute (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyImageAttribute.html)
// API on behalf of the user for each Region they have selected to distribute the
// AMI. To make an AMI public, set the launch permission authorized accounts to all
// . See the examples for making an AMI public at Amazon EC2 ModifyImageAttribute (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyImageAttribute.html)
// .
type LaunchPermissionConfiguration struct {
// The ARN for an Amazon Web Services Organization that you want to share your AMI
// with. For more information, see What is Organizations? (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html)
// .
OrganizationArns []string
// The ARN for an Organizations organizational unit (OU) that you want to share
// your AMI with. For more information about key concepts for Organizations, see
// Organizations terminology and concepts (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html)
// .
OrganizationalUnitArns []string
// The name of the group.
UserGroups []string
// The Amazon Web Services account ID.
UserIds []string
noSmithyDocumentSerde
}
// Identifies an Amazon EC2 launch template to use for a specific account.
type LaunchTemplateConfiguration struct {
// Identifies the Amazon EC2 launch template to use.
//
// This member is required.
LaunchTemplateId *string
// The account ID that this configuration applies to.
AccountId *string
// Set the specified Amazon EC2 launch template as the default launch template for
// the specified account.
SetDefaultVersion bool
noSmithyDocumentSerde
}
// Logging configuration defines where Image Builder uploads your logs.
type Logging struct {
// The Amazon S3 logging configuration.
S3Logs *S3Logs
noSmithyDocumentSerde
}
// The resources produced by this image.
type OutputResources struct {
// The Amazon EC2 AMIs created by this image.
Amis []Ami
// Container images that the pipeline has generated and stored in the output
// repository.
Containers []Container
noSmithyDocumentSerde
}
// Information about package vulnerability findings.
type PackageVulnerabilityDetails struct {
// A unique identifier for this vulnerability.
//
// This member is required.
VulnerabilityId *string
// CVSS scores for one or more vulnerabilities that Amazon Inspector identified
// for a package.
Cvss []CvssScore
// Links to web pages that contain details about the vulnerabilities that Amazon
// Inspector identified for the package.
ReferenceUrls []string
// Vulnerabilities that are often related to the findings for the package.
RelatedVulnerabilities []string
// The source of the vulnerability information.
Source *string
// A link to the source of the vulnerability information.
SourceUrl *string
// The date and time when this vulnerability was first added to the vendor's
// database.
VendorCreatedAt *time.Time
// The severity that the vendor assigned to this vulnerability type.
VendorSeverity *string
// The date and time when the vendor last updated this vulnerability in their
// database.
VendorUpdatedAt *time.Time
// The packages that this vulnerability impacts.
VulnerablePackages []VulnerablePackage
noSmithyDocumentSerde
}
// Information about how to remediate a finding.
type Remediation struct {
// An object that contains information about the recommended course of action to
// remediate the finding.
Recommendation *RemediationRecommendation
noSmithyDocumentSerde
}
// Details about the recommended course of action to remediate the finding.
type RemediationRecommendation struct {
// The recommended course of action to remediate the finding.
Text *string
// A link to more information about the recommended remediation for this
// vulnerability.
Url *string
noSmithyDocumentSerde
}
// Properties that configure export from your build instance to a compatible file
// format for your VM.
type S3ExportConfiguration struct {
// Export the updated image to one of the following supported disk image formats:
// - Virtual Hard Disk (VHD) – Compatible with Citrix Xen and Microsoft Hyper-V
// virtualization products.
// - Stream-optimized ESX Virtual Machine Disk (VMDK) – Compatible with VMware
// ESX and VMware vSphere versions 4, 5, and 6.
// - Raw – Raw format.
//
// This member is required.
DiskImageFormat DiskImageFormat
// The name of the role that grants VM Import/Export permission to export images
// to your S3 bucket.
//
// This member is required.
RoleName *string
// The S3 bucket in which to store the output disk images for your VM.
//
// This member is required.
S3Bucket *string
// The Amazon S3 path for the bucket where the output disk images for your VM are
// stored.
S3Prefix *string
noSmithyDocumentSerde
}
// Amazon S3 logging configuration.
type S3Logs struct {
// The S3 bucket in which to store the logs.
S3BucketName *string
// The Amazon S3 path to the bucket where the logs are stored.
S3KeyPrefix *string
noSmithyDocumentSerde
}
// A schedule configures how often and when a pipeline will automatically create a
// new image.
type Schedule struct {
// The condition configures when the pipeline should trigger a new image build.
// When the pipelineExecutionStartCondition is set to
// EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE , and you use semantic version
// filters on the base image or components in your image recipe, EC2 Image Builder
// will build a new image only when there are new versions of the image or
// components in your recipe that match the semantic version filter. When it is set
// to EXPRESSION_MATCH_ONLY , it will build a new image every time the CRON
// expression matches the current time. For semantic version syntax, see
// CreateComponent (https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_CreateComponent.html)
// in the EC2 Image Builder API Reference.
PipelineExecutionStartCondition PipelineExecutionStartCondition
// The cron expression determines how often EC2 Image Builder evaluates your
// pipelineExecutionStartCondition . For information on how to format a cron
// expression in Image Builder, see Use cron expressions in EC2 Image Builder (https://docs.aws.amazon.com/imagebuilder/latest/userguide/image-builder-cron.html)
// .
ScheduleExpression *string
// The timezone that applies to the scheduling expression. For example, "Etc/UTC",
// "America/Los_Angeles" in the IANA timezone format (https://www.joda.org/joda-time/timezones.html)
// . If not specified this defaults to UTC.
Timezone *string
noSmithyDocumentSerde
}
// Includes counts by severity level for medium severity and higher level
// findings, plus a total for all of the findings for the specified filter.
type SeverityCounts struct {
// The total number of findings across all severity levels for the specified
// filter.
All *int64
// The number of critical severity findings for the specified filter.
Critical *int64
// The number of high severity findings for the specified filter.
High *int64
// The number of medium severity findings for the specified filter.
Medium *int64
noSmithyDocumentSerde
}
// Contains settings for the Systems Manager agent on your build instance.
type SystemsManagerAgent struct {
// Controls whether the Systems Manager agent is removed from your final build
// image, prior to creating the new AMI. If this is set to true, then the agent is
// removed from the final image. If it's set to false, then the agent is left in,
// so that it is included in the new AMI. The default value is false.
UninstallAfterBuild *bool
noSmithyDocumentSerde
}
// The container repository where the output container image is stored.
type TargetContainerRepository struct {
// The name of the container repository where the output container image is
// stored. This name is prefixed by the repository location.
//
// This member is required.
RepositoryName *string
// Specifies the service in which this image was registered.
//
// This member is required.
Service ContainerRepositoryService
noSmithyDocumentSerde
}
// Includes counts of image and pipeline resource findings by vulnerability.
type VulnerabilityIdAggregation struct {
// Counts by severity level for medium severity and higher level findings, plus a
// total for all of the findings for the specified vulnerability.
SeverityCounts *SeverityCounts
// The vulnerability Id for this set of counts.
VulnerabilityId *string
noSmithyDocumentSerde
}
// Information about a vulnerable package that Amazon Inspector identifies in a
// finding.
type VulnerablePackage struct {
// The architecture of the vulnerable package.
Arch *string
// The epoch of the vulnerable package.
Epoch *int32
// The file path of the vulnerable package.
FilePath *string
// The version of the package that contains the vulnerability fix.
FixedInVersion *string
// The name of the vulnerable package.
Name *string
// The package manager of the vulnerable package.
PackageManager *string
// The release of the vulnerable package.
Release *string
// The code to run in your environment to update packages with a fix available.
Remediation *string
// The source layer hash of the vulnerable package.
SourceLayerHash *string
// The version of the vulnerable package.
Version *string
noSmithyDocumentSerde
}
// Metadata that includes details and status from this runtime instance of the
// workflow.
type WorkflowExecutionMetadata struct {
// The timestamp when this runtime instance of the workflow finished.
EndTime *string
// The runtime output message from the workflow, if applicable.
Message *string
// The timestamp when the runtime instance of this workflow started.
StartTime *string
// The current runtime status for this workflow.
Status WorkflowExecutionStatus
// The total number of steps in the workflow. This should equal the sum of the
// step counts for steps that succeeded, were skipped, and failed.
TotalStepCount int32
// A runtime count for the number of steps in the workflow that failed.
TotalStepsFailed int32
// A runtime count for the number of steps in the workflow that were skipped.
TotalStepsSkipped int32
// A runtime count for the number of steps in the workflow that ran successfully.
TotalStepsSucceeded int32
// Indicates what type of workflow that Image Builder ran for this runtime
// instance of the workflow.
Type WorkflowType
// The Amazon Resource Name (ARN) of the workflow resource build version that ran.
WorkflowBuildVersionArn *string
// Unique identifier that Image Builder assigns to keep track of runtime resources
// each time it runs a workflow.
WorkflowExecutionId *string
noSmithyDocumentSerde
}
// Runtime details and status for the workflow step.
type WorkflowStepMetadata struct {
// The step action name.
Action *string
// Description of the workflow step.
Description *string
// The timestamp when the workflow step finished.
EndTime *string
// Input parameters that Image Builder provides for the workflow step.
Inputs *string
// Detailed output message that the workflow step provides at runtime.
Message *string
// The name of the workflow step.
Name *string
// The file names that the workflow step created as output for this runtime
// instance of the workflow.
Outputs *string
// Reports on the rollback status of the step, if applicable.
RollbackStatus WorkflowStepExecutionRollbackStatus
// The timestamp when the workflow step started.
StartTime *string
// Runtime status for the workflow step.
Status WorkflowStepExecutionStatus
// A unique identifier for the workflow step, assigned at runtime.
StepExecutionId *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 1,868 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Inspector"
const ServiceAPIVersion = "2016-02-16"
// Client provides the API client to make operations call for Amazon Inspector.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "inspector", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Assigns attributes (key and value pairs) to the findings that are specified by
// the ARNs of the findings.
func (c *Client) AddAttributesToFindings(ctx context.Context, params *AddAttributesToFindingsInput, optFns ...func(*Options)) (*AddAttributesToFindingsOutput, error) {
if params == nil {
params = &AddAttributesToFindingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddAttributesToFindings", params, optFns, c.addOperationAddAttributesToFindingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddAttributesToFindingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddAttributesToFindingsInput struct {
// The array of attributes that you want to assign to specified findings.
//
// This member is required.
Attributes []types.Attribute
// The ARNs that specify the findings that you want to assign attributes to.
//
// This member is required.
FindingArns []string
noSmithyDocumentSerde
}
type AddAttributesToFindingsOutput struct {
// Attribute details that cannot be described. An error code is provided for each
// failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddAttributesToFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddAttributesToFindings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddAttributesToFindings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddAttributesToFindingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddAttributesToFindings(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
}
return nil
}
func newServiceMetadataMiddleware_opAddAttributesToFindings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "AddAttributesToFindings",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new assessment target using the ARN of the resource group that is
// generated by CreateResourceGroup . If resourceGroupArn is not specified, all EC2
// instances in the current AWS account and region are included in the assessment
// target. If the service-linked role (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_slr.html)
// isn’t already registered, this action also creates and registers a
// service-linked role to grant Amazon Inspector access to AWS Services needed to
// perform security assessments. You can create up to 50 assessment targets per AWS
// account. You can run up to 500 concurrent agents per AWS account. For more
// information, see Amazon Inspector Assessment Targets (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html)
// .
func (c *Client) CreateAssessmentTarget(ctx context.Context, params *CreateAssessmentTargetInput, optFns ...func(*Options)) (*CreateAssessmentTargetOutput, error) {
if params == nil {
params = &CreateAssessmentTargetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAssessmentTarget", params, optFns, c.addOperationCreateAssessmentTargetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAssessmentTargetOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAssessmentTargetInput struct {
// The user-defined name that identifies the assessment target that you want to
// create. The name must be unique within the AWS account.
//
// This member is required.
AssessmentTargetName *string
// The ARN that specifies the resource group that is used to create the assessment
// target. If resourceGroupArn is not specified, all EC2 instances in the current
// AWS account and region are included in the assessment target.
ResourceGroupArn *string
noSmithyDocumentSerde
}
type CreateAssessmentTargetOutput struct {
// The ARN that specifies the assessment target that is created.
//
// This member is required.
AssessmentTargetArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAssessmentTargetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAssessmentTarget{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAssessmentTarget{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateAssessmentTargetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssessmentTarget(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
}
return nil
}
func newServiceMetadataMiddleware_opCreateAssessmentTarget(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "CreateAssessmentTarget",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an assessment template for the assessment target that is specified by
// the ARN of the assessment target. If the service-linked role (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_slr.html)
// isn’t already registered, this action also creates and registers a
// service-linked role to grant Amazon Inspector access to AWS Services needed to
// perform security assessments.
func (c *Client) CreateAssessmentTemplate(ctx context.Context, params *CreateAssessmentTemplateInput, optFns ...func(*Options)) (*CreateAssessmentTemplateOutput, error) {
if params == nil {
params = &CreateAssessmentTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAssessmentTemplate", params, optFns, c.addOperationCreateAssessmentTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAssessmentTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAssessmentTemplateInput struct {
// The ARN that specifies the assessment target for which you want to create the
// assessment template.
//
// This member is required.
AssessmentTargetArn *string
// The user-defined name that identifies the assessment template that you want to
// create. You can create several assessment templates for an assessment target.
// The names of the assessment templates that correspond to a particular assessment
// target must be unique.
//
// This member is required.
AssessmentTemplateName *string
// The duration of the assessment run in seconds.
//
// This member is required.
DurationInSeconds int32
// The ARNs that specify the rules packages that you want to attach to the
// assessment template.
//
// This member is required.
RulesPackageArns []string
// The user-defined attributes that are assigned to every finding that is
// generated by the assessment run that uses this assessment template. An attribute
// is a key and value pair (an Attribute object). Within an assessment template,
// each key must be unique.
UserAttributesForFindings []types.Attribute
noSmithyDocumentSerde
}
type CreateAssessmentTemplateOutput struct {
// The ARN that specifies the assessment template that is created.
//
// This member is required.
AssessmentTemplateArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAssessmentTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAssessmentTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAssessmentTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateAssessmentTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssessmentTemplate(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
}
return nil
}
func newServiceMetadataMiddleware_opCreateAssessmentTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "CreateAssessmentTemplate",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts the generation of an exclusions preview for the specified assessment
// template. The exclusions preview lists the potential exclusions
// (ExclusionPreview) that Inspector can detect before it runs the assessment.
func (c *Client) CreateExclusionsPreview(ctx context.Context, params *CreateExclusionsPreviewInput, optFns ...func(*Options)) (*CreateExclusionsPreviewOutput, error) {
if params == nil {
params = &CreateExclusionsPreviewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateExclusionsPreview", params, optFns, c.addOperationCreateExclusionsPreviewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateExclusionsPreviewOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateExclusionsPreviewInput struct {
// The ARN that specifies the assessment template for which you want to create an
// exclusions preview.
//
// This member is required.
AssessmentTemplateArn *string
noSmithyDocumentSerde
}
type CreateExclusionsPreviewOutput struct {
// Specifies the unique identifier of the requested exclusions preview. You can
// use the unique identifier to retrieve the exclusions preview when running the
// GetExclusionsPreview API.
//
// This member is required.
PreviewToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateExclusionsPreviewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateExclusionsPreview{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateExclusionsPreview{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateExclusionsPreviewValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateExclusionsPreview(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
}
return nil
}
func newServiceMetadataMiddleware_opCreateExclusionsPreview(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "CreateExclusionsPreview",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a resource group using the specified set of tags (key and value pairs)
// that are used to select the EC2 instances to be included in an Amazon Inspector
// assessment target. The created resource group is then used to create an Amazon
// Inspector assessment target. For more information, see CreateAssessmentTarget .
func (c *Client) CreateResourceGroup(ctx context.Context, params *CreateResourceGroupInput, optFns ...func(*Options)) (*CreateResourceGroupOutput, error) {
if params == nil {
params = &CreateResourceGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateResourceGroup", params, optFns, c.addOperationCreateResourceGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateResourceGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateResourceGroupInput struct {
// A collection of keys and an array of possible values,
// '[{"key":"key1","values":["Value1","Value2"]},{"key":"Key2","values":["Value3"]}]'.
// For example,'[{"key":"Name","values":["TestEC2Instance"]}]'.
//
// This member is required.
ResourceGroupTags []types.ResourceGroupTag
noSmithyDocumentSerde
}
type CreateResourceGroupOutput struct {
// The ARN that specifies the resource group that is created.
//
// This member is required.
ResourceGroupArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateResourceGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateResourceGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateResourceGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateResourceGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResourceGroup(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
}
return nil
}
func newServiceMetadataMiddleware_opCreateResourceGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "CreateResourceGroup",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the assessment run that is specified by the ARN of the assessment run.
func (c *Client) DeleteAssessmentRun(ctx context.Context, params *DeleteAssessmentRunInput, optFns ...func(*Options)) (*DeleteAssessmentRunOutput, error) {
if params == nil {
params = &DeleteAssessmentRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAssessmentRun", params, optFns, c.addOperationDeleteAssessmentRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAssessmentRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAssessmentRunInput struct {
// The ARN that specifies the assessment run that you want to delete.
//
// This member is required.
AssessmentRunArn *string
noSmithyDocumentSerde
}
type DeleteAssessmentRunOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAssessmentRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAssessmentRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAssessmentRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteAssessmentRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAssessmentRun(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
}
return nil
}
func newServiceMetadataMiddleware_opDeleteAssessmentRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DeleteAssessmentRun",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the assessment target that is specified by the ARN of the assessment
// target.
func (c *Client) DeleteAssessmentTarget(ctx context.Context, params *DeleteAssessmentTargetInput, optFns ...func(*Options)) (*DeleteAssessmentTargetOutput, error) {
if params == nil {
params = &DeleteAssessmentTargetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAssessmentTarget", params, optFns, c.addOperationDeleteAssessmentTargetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAssessmentTargetOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAssessmentTargetInput struct {
// The ARN that specifies the assessment target that you want to delete.
//
// This member is required.
AssessmentTargetArn *string
noSmithyDocumentSerde
}
type DeleteAssessmentTargetOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAssessmentTargetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAssessmentTarget{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAssessmentTarget{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteAssessmentTargetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAssessmentTarget(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
}
return nil
}
func newServiceMetadataMiddleware_opDeleteAssessmentTarget(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DeleteAssessmentTarget",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the assessment template that is specified by the ARN of the assessment
// template.
func (c *Client) DeleteAssessmentTemplate(ctx context.Context, params *DeleteAssessmentTemplateInput, optFns ...func(*Options)) (*DeleteAssessmentTemplateOutput, error) {
if params == nil {
params = &DeleteAssessmentTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAssessmentTemplate", params, optFns, c.addOperationDeleteAssessmentTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAssessmentTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAssessmentTemplateInput struct {
// The ARN that specifies the assessment template that you want to delete.
//
// This member is required.
AssessmentTemplateArn *string
noSmithyDocumentSerde
}
type DeleteAssessmentTemplateOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAssessmentTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAssessmentTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAssessmentTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteAssessmentTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAssessmentTemplate(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
}
return nil
}
func newServiceMetadataMiddleware_opDeleteAssessmentTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DeleteAssessmentTemplate",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the assessment runs that are specified by the ARNs of the assessment
// runs.
func (c *Client) DescribeAssessmentRuns(ctx context.Context, params *DescribeAssessmentRunsInput, optFns ...func(*Options)) (*DescribeAssessmentRunsOutput, error) {
if params == nil {
params = &DescribeAssessmentRunsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAssessmentRuns", params, optFns, c.addOperationDescribeAssessmentRunsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAssessmentRunsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAssessmentRunsInput struct {
// The ARN that specifies the assessment run that you want to describe.
//
// This member is required.
AssessmentRunArns []string
noSmithyDocumentSerde
}
type DescribeAssessmentRunsOutput struct {
// Information about the assessment run.
//
// This member is required.
AssessmentRuns []types.AssessmentRun
// Assessment run details that cannot be described. An error code is provided for
// each failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAssessmentRunsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssessmentRuns{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssessmentRuns{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAssessmentRunsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssessmentRuns(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeAssessmentRuns(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DescribeAssessmentRuns",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the assessment targets that are specified by the ARNs of the
// assessment targets.
func (c *Client) DescribeAssessmentTargets(ctx context.Context, params *DescribeAssessmentTargetsInput, optFns ...func(*Options)) (*DescribeAssessmentTargetsOutput, error) {
if params == nil {
params = &DescribeAssessmentTargetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAssessmentTargets", params, optFns, c.addOperationDescribeAssessmentTargetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAssessmentTargetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAssessmentTargetsInput struct {
// The ARNs that specifies the assessment targets that you want to describe.
//
// This member is required.
AssessmentTargetArns []string
noSmithyDocumentSerde
}
type DescribeAssessmentTargetsOutput struct {
// Information about the assessment targets.
//
// This member is required.
AssessmentTargets []types.AssessmentTarget
// Assessment target details that cannot be described. An error code is provided
// for each failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAssessmentTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssessmentTargets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssessmentTargets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAssessmentTargetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssessmentTargets(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeAssessmentTargets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DescribeAssessmentTargets",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the assessment templates that are specified by the ARNs of the
// assessment templates.
func (c *Client) DescribeAssessmentTemplates(ctx context.Context, params *DescribeAssessmentTemplatesInput, optFns ...func(*Options)) (*DescribeAssessmentTemplatesOutput, error) {
if params == nil {
params = &DescribeAssessmentTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAssessmentTemplates", params, optFns, c.addOperationDescribeAssessmentTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAssessmentTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAssessmentTemplatesInput struct {
// This member is required.
AssessmentTemplateArns []string
noSmithyDocumentSerde
}
type DescribeAssessmentTemplatesOutput struct {
// Information about the assessment templates.
//
// This member is required.
AssessmentTemplates []types.AssessmentTemplate
// Assessment template details that cannot be described. An error code is provided
// for each failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAssessmentTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssessmentTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssessmentTemplates{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAssessmentTemplatesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssessmentTemplates(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeAssessmentTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DescribeAssessmentTemplates",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Describes the IAM role that enables Amazon Inspector to access your AWS account.
func (c *Client) DescribeCrossAccountAccessRole(ctx context.Context, params *DescribeCrossAccountAccessRoleInput, optFns ...func(*Options)) (*DescribeCrossAccountAccessRoleOutput, error) {
if params == nil {
params = &DescribeCrossAccountAccessRoleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeCrossAccountAccessRole", params, optFns, c.addOperationDescribeCrossAccountAccessRoleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeCrossAccountAccessRoleOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeCrossAccountAccessRoleInput struct {
noSmithyDocumentSerde
}
type DescribeCrossAccountAccessRoleOutput struct {
// The date when the cross-account access role was registered.
//
// This member is required.
RegisteredAt *time.Time
// The ARN that specifies the IAM role that Amazon Inspector uses to access your
// AWS account.
//
// This member is required.
RoleArn *string
// A Boolean value that specifies whether the IAM role has the necessary policies
// attached to enable Amazon Inspector to access your AWS account.
//
// This member is required.
Valid *bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeCrossAccountAccessRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCrossAccountAccessRole{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCrossAccountAccessRole{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCrossAccountAccessRole(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeCrossAccountAccessRole(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DescribeCrossAccountAccessRole",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the exclusions that are specified by the exclusions' ARNs.
func (c *Client) DescribeExclusions(ctx context.Context, params *DescribeExclusionsInput, optFns ...func(*Options)) (*DescribeExclusionsOutput, error) {
if params == nil {
params = &DescribeExclusionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeExclusions", params, optFns, c.addOperationDescribeExclusionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeExclusionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeExclusionsInput struct {
// The list of ARNs that specify the exclusions that you want to describe.
//
// This member is required.
ExclusionArns []string
// The locale into which you want to translate the exclusion's title, description,
// and recommendation.
Locale types.Locale
noSmithyDocumentSerde
}
type DescribeExclusionsOutput struct {
// Information about the exclusions.
//
// This member is required.
Exclusions map[string]types.Exclusion
// Exclusion details that cannot be described. An error code is provided for each
// failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeExclusionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeExclusions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeExclusions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeExclusionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExclusions(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeExclusions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DescribeExclusions",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the findings that are specified by the ARNs of the findings.
func (c *Client) DescribeFindings(ctx context.Context, params *DescribeFindingsInput, optFns ...func(*Options)) (*DescribeFindingsOutput, error) {
if params == nil {
params = &DescribeFindingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeFindings", params, optFns, c.addOperationDescribeFindingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeFindingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeFindingsInput struct {
// The ARN that specifies the finding that you want to describe.
//
// This member is required.
FindingArns []string
// The locale into which you want to translate a finding description,
// recommendation, and the short description that identifies the finding.
Locale types.Locale
noSmithyDocumentSerde
}
type DescribeFindingsOutput struct {
// Finding details that cannot be described. An error code is provided for each
// failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Information about the finding.
//
// This member is required.
Findings []types.Finding
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeFindings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeFindings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeFindingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFindings(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeFindings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DescribeFindings",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the resource groups that are specified by the ARNs of the resource
// groups.
func (c *Client) DescribeResourceGroups(ctx context.Context, params *DescribeResourceGroupsInput, optFns ...func(*Options)) (*DescribeResourceGroupsOutput, error) {
if params == nil {
params = &DescribeResourceGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeResourceGroups", params, optFns, c.addOperationDescribeResourceGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeResourceGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeResourceGroupsInput struct {
// The ARN that specifies the resource group that you want to describe.
//
// This member is required.
ResourceGroupArns []string
noSmithyDocumentSerde
}
type DescribeResourceGroupsOutput struct {
// Resource group details that cannot be described. An error code is provided for
// each failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Information about a resource group.
//
// This member is required.
ResourceGroups []types.ResourceGroup
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeResourceGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeResourceGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeResourceGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeResourceGroupsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeResourceGroups(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeResourceGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DescribeResourceGroups",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the rules packages that are specified by the ARNs of the rules
// packages.
func (c *Client) DescribeRulesPackages(ctx context.Context, params *DescribeRulesPackagesInput, optFns ...func(*Options)) (*DescribeRulesPackagesOutput, error) {
if params == nil {
params = &DescribeRulesPackagesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeRulesPackages", params, optFns, c.addOperationDescribeRulesPackagesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeRulesPackagesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeRulesPackagesInput struct {
// The ARN that specifies the rules package that you want to describe.
//
// This member is required.
RulesPackageArns []string
// The locale that you want to translate a rules package description into.
Locale types.Locale
noSmithyDocumentSerde
}
type DescribeRulesPackagesOutput struct {
// Rules package details that cannot be described. An error code is provided for
// each failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Information about the rules package.
//
// This member is required.
RulesPackages []types.RulesPackage
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeRulesPackagesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRulesPackages{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeRulesPackages{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeRulesPackagesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRulesPackages(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeRulesPackages(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "DescribeRulesPackages",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Produces an assessment report that includes detailed and comprehensive results
// of a specified assessment run.
func (c *Client) GetAssessmentReport(ctx context.Context, params *GetAssessmentReportInput, optFns ...func(*Options)) (*GetAssessmentReportOutput, error) {
if params == nil {
params = &GetAssessmentReportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAssessmentReport", params, optFns, c.addOperationGetAssessmentReportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetAssessmentReportOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetAssessmentReportInput struct {
// The ARN that specifies the assessment run for which you want to generate a
// report.
//
// This member is required.
AssessmentRunArn *string
// Specifies the file format (html or pdf) of the assessment report that you want
// to generate.
//
// This member is required.
ReportFileFormat types.ReportFileFormat
// Specifies the type of the assessment report that you want to generate. There
// are two types of assessment reports: a finding report and a full report. For
// more information, see Assessment Reports (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_reports.html)
// .
//
// This member is required.
ReportType types.ReportType
noSmithyDocumentSerde
}
type GetAssessmentReportOutput struct {
// Specifies the status of the request to generate an assessment report.
//
// This member is required.
Status types.ReportStatus
// Specifies the URL where you can find the generated assessment report. This
// parameter is only returned if the report is successfully generated.
Url *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetAssessmentReportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAssessmentReport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAssessmentReport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetAssessmentReportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssessmentReport(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
}
return nil
}
func newServiceMetadataMiddleware_opGetAssessmentReport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "GetAssessmentReport",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the exclusions preview (a list of ExclusionPreview objects) specified
// by the preview token. You can obtain the preview token by running the
// CreateExclusionsPreview API.
func (c *Client) GetExclusionsPreview(ctx context.Context, params *GetExclusionsPreviewInput, optFns ...func(*Options)) (*GetExclusionsPreviewOutput, error) {
if params == nil {
params = &GetExclusionsPreviewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetExclusionsPreview", params, optFns, c.addOperationGetExclusionsPreviewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetExclusionsPreviewOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetExclusionsPreviewInput struct {
// The ARN that specifies the assessment template for which the exclusions preview
// was requested.
//
// This member is required.
AssessmentTemplateArn *string
// The unique identifier associated of the exclusions preview.
//
// This member is required.
PreviewToken *string
// The locale into which you want to translate the exclusion's title, description,
// and recommendation.
Locale types.Locale
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 100. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the GetExclusionsPreviewRequest action.
// Subsequent calls to the action fill nextToken in the request with the value of
// nextToken from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type GetExclusionsPreviewOutput struct {
// Specifies the status of the request to generate an exclusions preview.
//
// This member is required.
PreviewStatus types.PreviewStatus
// Information about the exclusions included in the preview.
ExclusionPreviews []types.ExclusionPreview
// When a response is generated, if there is more data to be listed, this
// parameters is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetExclusionsPreviewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetExclusionsPreview{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetExclusionsPreview{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetExclusionsPreviewValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExclusionsPreview(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
}
return nil
}
// GetExclusionsPreviewAPIClient is a client that implements the
// GetExclusionsPreview operation.
type GetExclusionsPreviewAPIClient interface {
GetExclusionsPreview(context.Context, *GetExclusionsPreviewInput, ...func(*Options)) (*GetExclusionsPreviewOutput, error)
}
var _ GetExclusionsPreviewAPIClient = (*Client)(nil)
// GetExclusionsPreviewPaginatorOptions is the paginator options for
// GetExclusionsPreview
type GetExclusionsPreviewPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 100. The maximum value is 500.
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
}
// GetExclusionsPreviewPaginator is a paginator for GetExclusionsPreview
type GetExclusionsPreviewPaginator struct {
options GetExclusionsPreviewPaginatorOptions
client GetExclusionsPreviewAPIClient
params *GetExclusionsPreviewInput
nextToken *string
firstPage bool
}
// NewGetExclusionsPreviewPaginator returns a new GetExclusionsPreviewPaginator
func NewGetExclusionsPreviewPaginator(client GetExclusionsPreviewAPIClient, params *GetExclusionsPreviewInput, optFns ...func(*GetExclusionsPreviewPaginatorOptions)) *GetExclusionsPreviewPaginator {
if params == nil {
params = &GetExclusionsPreviewInput{}
}
options := GetExclusionsPreviewPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetExclusionsPreviewPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetExclusionsPreviewPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetExclusionsPreview page.
func (p *GetExclusionsPreviewPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetExclusionsPreviewOutput, 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.GetExclusionsPreview(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_opGetExclusionsPreview(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "GetExclusionsPreview",
}
}
| 251 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Information about the data that is collected for the specified assessment run.
func (c *Client) GetTelemetryMetadata(ctx context.Context, params *GetTelemetryMetadataInput, optFns ...func(*Options)) (*GetTelemetryMetadataOutput, error) {
if params == nil {
params = &GetTelemetryMetadataInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetTelemetryMetadata", params, optFns, c.addOperationGetTelemetryMetadataMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetTelemetryMetadataOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetTelemetryMetadataInput struct {
// The ARN that specifies the assessment run that has the telemetry data that you
// want to obtain.
//
// This member is required.
AssessmentRunArn *string
noSmithyDocumentSerde
}
type GetTelemetryMetadataOutput struct {
// Telemetry details.
//
// This member is required.
TelemetryMetadata []types.TelemetryMetadata
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetTelemetryMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTelemetryMetadata{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTelemetryMetadata{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetTelemetryMetadataValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTelemetryMetadata(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
}
return nil
}
func newServiceMetadataMiddleware_opGetTelemetryMetadata(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "GetTelemetryMetadata",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the agents of the assessment runs that are specified by the ARNs of the
// assessment runs.
func (c *Client) ListAssessmentRunAgents(ctx context.Context, params *ListAssessmentRunAgentsInput, optFns ...func(*Options)) (*ListAssessmentRunAgentsOutput, error) {
if params == nil {
params = &ListAssessmentRunAgentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssessmentRunAgents", params, optFns, c.addOperationListAssessmentRunAgentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssessmentRunAgentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssessmentRunAgentsInput struct {
// The ARN that specifies the assessment run whose agents you want to list.
//
// This member is required.
AssessmentRunArn *string
// You can use this parameter to specify a subset of data to be included in the
// action's response. For a record to match a filter, all specified filter
// attributes must match. When multiple values are specified for a filter
// attribute, any of the values can match.
Filter *types.AgentFilter
// You can use this parameter to indicate the maximum number of items that you
// want in the response. The default value is 10. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the ListAssessmentRunAgents action.
// Subsequent calls to the action fill nextToken in the request with the value of
// NextToken from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type ListAssessmentRunAgentsOutput struct {
// A list of ARNs that specifies the agents returned by the action.
//
// This member is required.
AssessmentRunAgents []types.AssessmentRunAgent
// When a response is generated, if there is more data to be listed, this
// parameter is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssessmentRunAgentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssessmentRunAgents{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAssessmentRunAgents{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAssessmentRunAgentsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssessmentRunAgents(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
}
return nil
}
// ListAssessmentRunAgentsAPIClient is a client that implements the
// ListAssessmentRunAgents operation.
type ListAssessmentRunAgentsAPIClient interface {
ListAssessmentRunAgents(context.Context, *ListAssessmentRunAgentsInput, ...func(*Options)) (*ListAssessmentRunAgentsOutput, error)
}
var _ ListAssessmentRunAgentsAPIClient = (*Client)(nil)
// ListAssessmentRunAgentsPaginatorOptions is the paginator options for
// ListAssessmentRunAgents
type ListAssessmentRunAgentsPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items that you
// want in the response. The default value is 10. The maximum value is 500.
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
}
// ListAssessmentRunAgentsPaginator is a paginator for ListAssessmentRunAgents
type ListAssessmentRunAgentsPaginator struct {
options ListAssessmentRunAgentsPaginatorOptions
client ListAssessmentRunAgentsAPIClient
params *ListAssessmentRunAgentsInput
nextToken *string
firstPage bool
}
// NewListAssessmentRunAgentsPaginator returns a new
// ListAssessmentRunAgentsPaginator
func NewListAssessmentRunAgentsPaginator(client ListAssessmentRunAgentsAPIClient, params *ListAssessmentRunAgentsInput, optFns ...func(*ListAssessmentRunAgentsPaginatorOptions)) *ListAssessmentRunAgentsPaginator {
if params == nil {
params = &ListAssessmentRunAgentsInput{}
}
options := ListAssessmentRunAgentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssessmentRunAgentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssessmentRunAgentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssessmentRunAgents page.
func (p *ListAssessmentRunAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentRunAgentsOutput, 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.ListAssessmentRunAgents(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_opListAssessmentRunAgents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListAssessmentRunAgents",
}
}
| 244 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the assessment runs that correspond to the assessment templates that are
// specified by the ARNs of the assessment templates.
func (c *Client) ListAssessmentRuns(ctx context.Context, params *ListAssessmentRunsInput, optFns ...func(*Options)) (*ListAssessmentRunsOutput, error) {
if params == nil {
params = &ListAssessmentRunsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssessmentRuns", params, optFns, c.addOperationListAssessmentRunsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssessmentRunsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssessmentRunsInput struct {
// The ARNs that specify the assessment templates whose assessment runs you want
// to list.
AssessmentTemplateArns []string
// You can use this parameter to specify a subset of data to be included in the
// action's response. For a record to match a filter, all specified filter
// attributes must match. When multiple values are specified for a filter
// attribute, any of the values can match.
Filter *types.AssessmentRunFilter
// You can use this parameter to indicate the maximum number of items that you
// want in the response. The default value is 10. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the ListAssessmentRuns action.
// Subsequent calls to the action fill nextToken in the request with the value of
// NextToken from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type ListAssessmentRunsOutput struct {
// A list of ARNs that specifies the assessment runs that are returned by the
// action.
//
// This member is required.
AssessmentRunArns []string
// When a response is generated, if there is more data to be listed, this
// parameter is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssessmentRunsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssessmentRuns{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAssessmentRuns{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssessmentRuns(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
}
return nil
}
// ListAssessmentRunsAPIClient is a client that implements the ListAssessmentRuns
// operation.
type ListAssessmentRunsAPIClient interface {
ListAssessmentRuns(context.Context, *ListAssessmentRunsInput, ...func(*Options)) (*ListAssessmentRunsOutput, error)
}
var _ ListAssessmentRunsAPIClient = (*Client)(nil)
// ListAssessmentRunsPaginatorOptions is the paginator options for
// ListAssessmentRuns
type ListAssessmentRunsPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items that you
// want in the response. The default value is 10. The maximum value is 500.
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
}
// ListAssessmentRunsPaginator is a paginator for ListAssessmentRuns
type ListAssessmentRunsPaginator struct {
options ListAssessmentRunsPaginatorOptions
client ListAssessmentRunsAPIClient
params *ListAssessmentRunsInput
nextToken *string
firstPage bool
}
// NewListAssessmentRunsPaginator returns a new ListAssessmentRunsPaginator
func NewListAssessmentRunsPaginator(client ListAssessmentRunsAPIClient, params *ListAssessmentRunsInput, optFns ...func(*ListAssessmentRunsPaginatorOptions)) *ListAssessmentRunsPaginator {
if params == nil {
params = &ListAssessmentRunsInput{}
}
options := ListAssessmentRunsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssessmentRunsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssessmentRunsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssessmentRuns page.
func (p *ListAssessmentRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentRunsOutput, 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.ListAssessmentRuns(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_opListAssessmentRuns(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListAssessmentRuns",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the ARNs of the assessment targets within this AWS account. For more
// information about assessment targets, see Amazon Inspector Assessment Targets (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html)
// .
func (c *Client) ListAssessmentTargets(ctx context.Context, params *ListAssessmentTargetsInput, optFns ...func(*Options)) (*ListAssessmentTargetsOutput, error) {
if params == nil {
params = &ListAssessmentTargetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssessmentTargets", params, optFns, c.addOperationListAssessmentTargetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssessmentTargetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssessmentTargetsInput struct {
// You can use this parameter to specify a subset of data to be included in the
// action's response. For a record to match a filter, all specified filter
// attributes must match. When multiple values are specified for a filter
// attribute, any of the values can match.
Filter *types.AssessmentTargetFilter
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the ListAssessmentTargets action.
// Subsequent calls to the action fill nextToken in the request with the value of
// NextToken from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type ListAssessmentTargetsOutput struct {
// A list of ARNs that specifies the assessment targets that are returned by the
// action.
//
// This member is required.
AssessmentTargetArns []string
// When a response is generated, if there is more data to be listed, this
// parameter is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssessmentTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssessmentTargets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAssessmentTargets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssessmentTargets(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
}
return nil
}
// ListAssessmentTargetsAPIClient is a client that implements the
// ListAssessmentTargets operation.
type ListAssessmentTargetsAPIClient interface {
ListAssessmentTargets(context.Context, *ListAssessmentTargetsInput, ...func(*Options)) (*ListAssessmentTargetsOutput, error)
}
var _ ListAssessmentTargetsAPIClient = (*Client)(nil)
// ListAssessmentTargetsPaginatorOptions is the paginator options for
// ListAssessmentTargets
type ListAssessmentTargetsPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
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
}
// ListAssessmentTargetsPaginator is a paginator for ListAssessmentTargets
type ListAssessmentTargetsPaginator struct {
options ListAssessmentTargetsPaginatorOptions
client ListAssessmentTargetsAPIClient
params *ListAssessmentTargetsInput
nextToken *string
firstPage bool
}
// NewListAssessmentTargetsPaginator returns a new ListAssessmentTargetsPaginator
func NewListAssessmentTargetsPaginator(client ListAssessmentTargetsAPIClient, params *ListAssessmentTargetsInput, optFns ...func(*ListAssessmentTargetsPaginatorOptions)) *ListAssessmentTargetsPaginator {
if params == nil {
params = &ListAssessmentTargetsInput{}
}
options := ListAssessmentTargetsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssessmentTargetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssessmentTargetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssessmentTargets page.
func (p *ListAssessmentTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentTargetsOutput, 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.ListAssessmentTargets(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_opListAssessmentTargets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListAssessmentTargets",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the assessment templates that correspond to the assessment targets that
// are specified by the ARNs of the assessment targets.
func (c *Client) ListAssessmentTemplates(ctx context.Context, params *ListAssessmentTemplatesInput, optFns ...func(*Options)) (*ListAssessmentTemplatesOutput, error) {
if params == nil {
params = &ListAssessmentTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssessmentTemplates", params, optFns, c.addOperationListAssessmentTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssessmentTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssessmentTemplatesInput struct {
// A list of ARNs that specifies the assessment targets whose assessment templates
// you want to list.
AssessmentTargetArns []string
// You can use this parameter to specify a subset of data to be included in the
// action's response. For a record to match a filter, all specified filter
// attributes must match. When multiple values are specified for a filter
// attribute, any of the values can match.
Filter *types.AssessmentTemplateFilter
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the ListAssessmentTemplates action.
// Subsequent calls to the action fill nextToken in the request with the value of
// NextToken from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type ListAssessmentTemplatesOutput struct {
// A list of ARNs that specifies the assessment templates returned by the action.
//
// This member is required.
AssessmentTemplateArns []string
// When a response is generated, if there is more data to be listed, this
// parameter is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssessmentTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssessmentTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAssessmentTemplates{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssessmentTemplates(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
}
return nil
}
// ListAssessmentTemplatesAPIClient is a client that implements the
// ListAssessmentTemplates operation.
type ListAssessmentTemplatesAPIClient interface {
ListAssessmentTemplates(context.Context, *ListAssessmentTemplatesInput, ...func(*Options)) (*ListAssessmentTemplatesOutput, error)
}
var _ ListAssessmentTemplatesAPIClient = (*Client)(nil)
// ListAssessmentTemplatesPaginatorOptions is the paginator options for
// ListAssessmentTemplates
type ListAssessmentTemplatesPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
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
}
// ListAssessmentTemplatesPaginator is a paginator for ListAssessmentTemplates
type ListAssessmentTemplatesPaginator struct {
options ListAssessmentTemplatesPaginatorOptions
client ListAssessmentTemplatesAPIClient
params *ListAssessmentTemplatesInput
nextToken *string
firstPage bool
}
// NewListAssessmentTemplatesPaginator returns a new
// ListAssessmentTemplatesPaginator
func NewListAssessmentTemplatesPaginator(client ListAssessmentTemplatesAPIClient, params *ListAssessmentTemplatesInput, optFns ...func(*ListAssessmentTemplatesPaginatorOptions)) *ListAssessmentTemplatesPaginator {
if params == nil {
params = &ListAssessmentTemplatesInput{}
}
options := ListAssessmentTemplatesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssessmentTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssessmentTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssessmentTemplates page.
func (p *ListAssessmentTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentTemplatesOutput, 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.ListAssessmentTemplates(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_opListAssessmentTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListAssessmentTemplates",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all the event subscriptions for the assessment template that is specified
// by the ARN of the assessment template. For more information, see
// SubscribeToEvent and UnsubscribeFromEvent .
func (c *Client) ListEventSubscriptions(ctx context.Context, params *ListEventSubscriptionsInput, optFns ...func(*Options)) (*ListEventSubscriptionsOutput, error) {
if params == nil {
params = &ListEventSubscriptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListEventSubscriptions", params, optFns, c.addOperationListEventSubscriptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListEventSubscriptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListEventSubscriptionsInput struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the ListEventSubscriptions action.
// Subsequent calls to the action fill nextToken in the request with the value of
// NextToken from the previous response to continue listing data.
NextToken *string
// The ARN of the assessment template for which you want to list the existing
// event subscriptions.
ResourceArn *string
noSmithyDocumentSerde
}
type ListEventSubscriptionsOutput struct {
// Details of the returned event subscriptions.
//
// This member is required.
Subscriptions []types.Subscription
// When a response is generated, if there is more data to be listed, this
// parameter is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListEventSubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListEventSubscriptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListEventSubscriptions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEventSubscriptions(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
}
return nil
}
// ListEventSubscriptionsAPIClient is a client that implements the
// ListEventSubscriptions operation.
type ListEventSubscriptionsAPIClient interface {
ListEventSubscriptions(context.Context, *ListEventSubscriptionsInput, ...func(*Options)) (*ListEventSubscriptionsOutput, error)
}
var _ ListEventSubscriptionsAPIClient = (*Client)(nil)
// ListEventSubscriptionsPaginatorOptions is the paginator options for
// ListEventSubscriptions
type ListEventSubscriptionsPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
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
}
// ListEventSubscriptionsPaginator is a paginator for ListEventSubscriptions
type ListEventSubscriptionsPaginator struct {
options ListEventSubscriptionsPaginatorOptions
client ListEventSubscriptionsAPIClient
params *ListEventSubscriptionsInput
nextToken *string
firstPage bool
}
// NewListEventSubscriptionsPaginator returns a new ListEventSubscriptionsPaginator
func NewListEventSubscriptionsPaginator(client ListEventSubscriptionsAPIClient, params *ListEventSubscriptionsInput, optFns ...func(*ListEventSubscriptionsPaginatorOptions)) *ListEventSubscriptionsPaginator {
if params == nil {
params = &ListEventSubscriptionsInput{}
}
options := ListEventSubscriptionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListEventSubscriptionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListEventSubscriptionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListEventSubscriptions page.
func (p *ListEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventSubscriptionsOutput, 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.ListEventSubscriptions(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_opListEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListEventSubscriptions",
}
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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"
)
// List exclusions that are generated by the assessment run.
func (c *Client) ListExclusions(ctx context.Context, params *ListExclusionsInput, optFns ...func(*Options)) (*ListExclusionsOutput, error) {
if params == nil {
params = &ListExclusionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListExclusions", params, optFns, c.addOperationListExclusionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListExclusionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListExclusionsInput struct {
// The ARN of the assessment run that generated the exclusions that you want to
// list.
//
// This member is required.
AssessmentRunArn *string
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 100. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the ListExclusionsRequest action.
// Subsequent calls to the action fill nextToken in the request with the value of
// nextToken from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type ListExclusionsOutput struct {
// A list of exclusions' ARNs returned by the action.
//
// This member is required.
ExclusionArns []string
// When a response is generated, if there is more data to be listed, this
// parameters is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListExclusionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListExclusions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListExclusions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListExclusionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListExclusions(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
}
return nil
}
// ListExclusionsAPIClient is a client that implements the ListExclusions
// operation.
type ListExclusionsAPIClient interface {
ListExclusions(context.Context, *ListExclusionsInput, ...func(*Options)) (*ListExclusionsOutput, error)
}
var _ ListExclusionsAPIClient = (*Client)(nil)
// ListExclusionsPaginatorOptions is the paginator options for ListExclusions
type ListExclusionsPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 100. The maximum value is 500.
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
}
// ListExclusionsPaginator is a paginator for ListExclusions
type ListExclusionsPaginator struct {
options ListExclusionsPaginatorOptions
client ListExclusionsAPIClient
params *ListExclusionsInput
nextToken *string
firstPage bool
}
// NewListExclusionsPaginator returns a new ListExclusionsPaginator
func NewListExclusionsPaginator(client ListExclusionsAPIClient, params *ListExclusionsInput, optFns ...func(*ListExclusionsPaginatorOptions)) *ListExclusionsPaginator {
if params == nil {
params = &ListExclusionsInput{}
}
options := ListExclusionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListExclusionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListExclusionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListExclusions page.
func (p *ListExclusionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExclusionsOutput, 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.ListExclusions(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_opListExclusions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListExclusions",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists findings that are generated by the assessment runs that are specified by
// the ARNs of the assessment runs.
func (c *Client) ListFindings(ctx context.Context, params *ListFindingsInput, optFns ...func(*Options)) (*ListFindingsOutput, error) {
if params == nil {
params = &ListFindingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFindings", params, optFns, c.addOperationListFindingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFindingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListFindingsInput struct {
// The ARNs of the assessment runs that generate the findings that you want to
// list.
AssessmentRunArns []string
// You can use this parameter to specify a subset of data to be included in the
// action's response. For a record to match a filter, all specified filter
// attributes must match. When multiple values are specified for a filter
// attribute, any of the values can match.
Filter *types.FindingFilter
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the ListFindings action. Subsequent
// calls to the action fill nextToken in the request with the value of NextToken
// from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type ListFindingsOutput struct {
// A list of ARNs that specifies the findings returned by the action.
//
// This member is required.
FindingArns []string
// When a response is generated, if there is more data to be listed, this
// parameter is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListFindings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListFindings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListFindingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFindings(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
}
return nil
}
// ListFindingsAPIClient is a client that implements the ListFindings operation.
type ListFindingsAPIClient interface {
ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error)
}
var _ ListFindingsAPIClient = (*Client)(nil)
// ListFindingsPaginatorOptions is the paginator options for ListFindings
type ListFindingsPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
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
}
// ListFindingsPaginator is a paginator for ListFindings
type ListFindingsPaginator struct {
options ListFindingsPaginatorOptions
client ListFindingsAPIClient
params *ListFindingsInput
nextToken *string
firstPage bool
}
// NewListFindingsPaginator returns a new ListFindingsPaginator
func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator {
if params == nil {
params = &ListFindingsInput{}
}
options := ListFindingsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListFindingsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListFindingsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListFindings page.
func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, 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.ListFindings(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_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListFindings",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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"
)
// Lists all available Amazon Inspector rules packages.
func (c *Client) ListRulesPackages(ctx context.Context, params *ListRulesPackagesInput, optFns ...func(*Options)) (*ListRulesPackagesOutput, error) {
if params == nil {
params = &ListRulesPackagesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListRulesPackages", params, optFns, c.addOperationListRulesPackagesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListRulesPackagesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListRulesPackagesInput struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the ListRulesPackages action. Subsequent
// calls to the action fill nextToken in the request with the value of NextToken
// from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type ListRulesPackagesOutput struct {
// The list of ARNs that specifies the rules packages returned by the action.
//
// This member is required.
RulesPackageArns []string
// When a response is generated, if there is more data to be listed, this
// parameter is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListRulesPackagesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListRulesPackages{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListRulesPackages{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRulesPackages(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
}
return nil
}
// ListRulesPackagesAPIClient is a client that implements the ListRulesPackages
// operation.
type ListRulesPackagesAPIClient interface {
ListRulesPackages(context.Context, *ListRulesPackagesInput, ...func(*Options)) (*ListRulesPackagesOutput, error)
}
var _ ListRulesPackagesAPIClient = (*Client)(nil)
// ListRulesPackagesPaginatorOptions is the paginator options for ListRulesPackages
type ListRulesPackagesPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
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
}
// ListRulesPackagesPaginator is a paginator for ListRulesPackages
type ListRulesPackagesPaginator struct {
options ListRulesPackagesPaginatorOptions
client ListRulesPackagesAPIClient
params *ListRulesPackagesInput
nextToken *string
firstPage bool
}
// NewListRulesPackagesPaginator returns a new ListRulesPackagesPaginator
func NewListRulesPackagesPaginator(client ListRulesPackagesAPIClient, params *ListRulesPackagesInput, optFns ...func(*ListRulesPackagesPaginatorOptions)) *ListRulesPackagesPaginator {
if params == nil {
params = &ListRulesPackagesInput{}
}
options := ListRulesPackagesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListRulesPackagesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListRulesPackagesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListRulesPackages page.
func (p *ListRulesPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRulesPackagesOutput, 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.ListRulesPackages(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_opListRulesPackages(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListRulesPackages",
}
}
| 226 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all tags associated with an assessment template.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The ARN that specifies the assessment template whose tags you want to list.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// A collection of key and value pairs.
//
// This member is required.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = 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
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "ListTagsForResource",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
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/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Previews the agents installed on the EC2 instances that are part of the
// specified assessment target.
func (c *Client) PreviewAgents(ctx context.Context, params *PreviewAgentsInput, optFns ...func(*Options)) (*PreviewAgentsOutput, error) {
if params == nil {
params = &PreviewAgentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PreviewAgents", params, optFns, c.addOperationPreviewAgentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PreviewAgentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type PreviewAgentsInput struct {
// The ARN of the assessment target whose agents you want to preview.
//
// This member is required.
PreviewAgentsArn *string
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
MaxResults *int32
// You can use this parameter when paginating results. Set the value of this
// parameter to null on your first call to the PreviewAgents action. Subsequent
// calls to the action fill nextToken in the request with the value of NextToken
// from the previous response to continue listing data.
NextToken *string
noSmithyDocumentSerde
}
type PreviewAgentsOutput struct {
// The resulting list of agents.
//
// This member is required.
AgentPreviews []types.AgentPreview
// When a response is generated, if there is more data to be listed, this
// parameter is present in the response and contains the value to use for the
// nextToken parameter in a subsequent pagination request. If there is no more data
// to be listed, this parameter is set to null.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPreviewAgentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPreviewAgents{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPreviewAgents{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPreviewAgentsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPreviewAgents(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
}
return nil
}
// PreviewAgentsAPIClient is a client that implements the PreviewAgents operation.
type PreviewAgentsAPIClient interface {
PreviewAgents(context.Context, *PreviewAgentsInput, ...func(*Options)) (*PreviewAgentsOutput, error)
}
var _ PreviewAgentsAPIClient = (*Client)(nil)
// PreviewAgentsPaginatorOptions is the paginator options for PreviewAgents
type PreviewAgentsPaginatorOptions struct {
// You can use this parameter to indicate the maximum number of items you want in
// the response. The default value is 10. The maximum value is 500.
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
}
// PreviewAgentsPaginator is a paginator for PreviewAgents
type PreviewAgentsPaginator struct {
options PreviewAgentsPaginatorOptions
client PreviewAgentsAPIClient
params *PreviewAgentsInput
nextToken *string
firstPage bool
}
// NewPreviewAgentsPaginator returns a new PreviewAgentsPaginator
func NewPreviewAgentsPaginator(client PreviewAgentsAPIClient, params *PreviewAgentsInput, optFns ...func(*PreviewAgentsPaginatorOptions)) *PreviewAgentsPaginator {
if params == nil {
params = &PreviewAgentsInput{}
}
options := PreviewAgentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &PreviewAgentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *PreviewAgentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next PreviewAgents page.
func (p *PreviewAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*PreviewAgentsOutput, 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.PreviewAgents(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_opPreviewAgents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "PreviewAgents",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Registers the IAM role that grants Amazon Inspector access to AWS Services
// needed to perform security assessments.
func (c *Client) RegisterCrossAccountAccessRole(ctx context.Context, params *RegisterCrossAccountAccessRoleInput, optFns ...func(*Options)) (*RegisterCrossAccountAccessRoleOutput, error) {
if params == nil {
params = &RegisterCrossAccountAccessRoleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RegisterCrossAccountAccessRole", params, optFns, c.addOperationRegisterCrossAccountAccessRoleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RegisterCrossAccountAccessRoleOutput)
out.ResultMetadata = metadata
return out, nil
}
type RegisterCrossAccountAccessRoleInput struct {
// The ARN of the IAM role that grants Amazon Inspector access to AWS Services
// needed to perform security assessments.
//
// This member is required.
RoleArn *string
noSmithyDocumentSerde
}
type RegisterCrossAccountAccessRoleOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRegisterCrossAccountAccessRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterCrossAccountAccessRole{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterCrossAccountAccessRole{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRegisterCrossAccountAccessRoleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterCrossAccountAccessRole(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
}
return nil
}
func newServiceMetadataMiddleware_opRegisterCrossAccountAccessRole(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "RegisterCrossAccountAccessRole",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes entire attributes (key and value pairs) from the findings that are
// specified by the ARNs of the findings where an attribute with the specified key
// exists.
func (c *Client) RemoveAttributesFromFindings(ctx context.Context, params *RemoveAttributesFromFindingsInput, optFns ...func(*Options)) (*RemoveAttributesFromFindingsOutput, error) {
if params == nil {
params = &RemoveAttributesFromFindingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveAttributesFromFindings", params, optFns, c.addOperationRemoveAttributesFromFindingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveAttributesFromFindingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type RemoveAttributesFromFindingsInput struct {
// The array of attribute keys that you want to remove from specified findings.
//
// This member is required.
AttributeKeys []string
// The ARNs that specify the findings that you want to remove attributes from.
//
// This member is required.
FindingArns []string
noSmithyDocumentSerde
}
type RemoveAttributesFromFindingsOutput struct {
// Attributes details that cannot be described. An error code is provided for each
// failed item.
//
// This member is required.
FailedItems map[string]types.FailedItemDetails
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveAttributesFromFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveAttributesFromFindings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveAttributesFromFindings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRemoveAttributesFromFindingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveAttributesFromFindings(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
}
return nil
}
func newServiceMetadataMiddleware_opRemoveAttributesFromFindings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "RemoveAttributesFromFindings",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets tags (key and value pairs) to the assessment template that is specified by
// the ARN of the assessment template.
func (c *Client) SetTagsForResource(ctx context.Context, params *SetTagsForResourceInput, optFns ...func(*Options)) (*SetTagsForResourceOutput, error) {
if params == nil {
params = &SetTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SetTagsForResource", params, optFns, c.addOperationSetTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SetTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type SetTagsForResourceInput struct {
// The ARN of the assessment template that you want to set tags to.
//
// This member is required.
ResourceArn *string
// A collection of key and value pairs that you want to set to the assessment
// template.
Tags []types.Tag
noSmithyDocumentSerde
}
type SetTagsForResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSetTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSetTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetTagsForResource(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
}
return nil
}
func newServiceMetadataMiddleware_opSetTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "SetTagsForResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts the assessment run specified by the ARN of the assessment template. For
// this API to function properly, you must not exceed the limit of running up to
// 500 concurrent agents per AWS account.
func (c *Client) StartAssessmentRun(ctx context.Context, params *StartAssessmentRunInput, optFns ...func(*Options)) (*StartAssessmentRunOutput, error) {
if params == nil {
params = &StartAssessmentRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartAssessmentRun", params, optFns, c.addOperationStartAssessmentRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartAssessmentRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartAssessmentRunInput struct {
// The ARN of the assessment template of the assessment run that you want to start.
//
// This member is required.
AssessmentTemplateArn *string
// You can specify the name for the assessment run. The name must be unique for
// the assessment template whose ARN is used to start the assessment run.
AssessmentRunName *string
noSmithyDocumentSerde
}
type StartAssessmentRunOutput struct {
// The ARN of the assessment run that has been started.
//
// This member is required.
AssessmentRunArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartAssessmentRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartAssessmentRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartAssessmentRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartAssessmentRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAssessmentRun(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
}
return nil
}
func newServiceMetadataMiddleware_opStartAssessmentRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "StartAssessmentRun",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Stops the assessment run that is specified by the ARN of the assessment run.
func (c *Client) StopAssessmentRun(ctx context.Context, params *StopAssessmentRunInput, optFns ...func(*Options)) (*StopAssessmentRunOutput, error) {
if params == nil {
params = &StopAssessmentRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopAssessmentRun", params, optFns, c.addOperationStopAssessmentRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopAssessmentRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopAssessmentRunInput struct {
// The ARN of the assessment run that you want to stop.
//
// This member is required.
AssessmentRunArn *string
// An input option that can be set to either START_EVALUATION or SKIP_EVALUATION.
// START_EVALUATION (the default value), stops the AWS agent from collecting data
// and begins the results evaluation and the findings generation process.
// SKIP_EVALUATION cancels the assessment run immediately, after which no findings
// are generated.
StopAction types.StopAction
noSmithyDocumentSerde
}
type StopAssessmentRunOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopAssessmentRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopAssessmentRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopAssessmentRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopAssessmentRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopAssessmentRun(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
}
return nil
}
func newServiceMetadataMiddleware_opStopAssessmentRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "StopAssessmentRun",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enables the process of sending Amazon Simple Notification Service (SNS)
// notifications about a specified event to a specified SNS topic.
func (c *Client) SubscribeToEvent(ctx context.Context, params *SubscribeToEventInput, optFns ...func(*Options)) (*SubscribeToEventOutput, error) {
if params == nil {
params = &SubscribeToEventInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SubscribeToEvent", params, optFns, c.addOperationSubscribeToEventMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SubscribeToEventOutput)
out.ResultMetadata = metadata
return out, nil
}
type SubscribeToEventInput struct {
// The event for which you want to receive SNS notifications.
//
// This member is required.
Event types.InspectorEvent
// The ARN of the assessment template that is used during the event for which you
// want to receive SNS notifications.
//
// This member is required.
ResourceArn *string
// The ARN of the SNS topic to which the SNS notifications are sent.
//
// This member is required.
TopicArn *string
noSmithyDocumentSerde
}
type SubscribeToEventOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSubscribeToEventMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSubscribeToEvent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSubscribeToEvent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSubscribeToEventValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSubscribeToEvent(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
}
return nil
}
func newServiceMetadataMiddleware_opSubscribeToEvent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "SubscribeToEvent",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disables the process of sending Amazon Simple Notification Service (SNS)
// notifications about a specified event to a specified SNS topic.
func (c *Client) UnsubscribeFromEvent(ctx context.Context, params *UnsubscribeFromEventInput, optFns ...func(*Options)) (*UnsubscribeFromEventOutput, error) {
if params == nil {
params = &UnsubscribeFromEventInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UnsubscribeFromEvent", params, optFns, c.addOperationUnsubscribeFromEventMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UnsubscribeFromEventOutput)
out.ResultMetadata = metadata
return out, nil
}
type UnsubscribeFromEventInput struct {
// The event for which you want to stop receiving SNS notifications.
//
// This member is required.
Event types.InspectorEvent
// The ARN of the assessment template that is used during the event for which you
// want to stop receiving SNS notifications.
//
// This member is required.
ResourceArn *string
// The ARN of the SNS topic to which SNS notifications are sent.
//
// This member is required.
TopicArn *string
noSmithyDocumentSerde
}
type UnsubscribeFromEventOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUnsubscribeFromEventMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUnsubscribeFromEvent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUnsubscribeFromEvent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUnsubscribeFromEventValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnsubscribeFromEvent(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
}
return nil
}
func newServiceMetadataMiddleware_opUnsubscribeFromEvent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "UnsubscribeFromEvent",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the assessment target that is specified by the ARN of the assessment
// target. If resourceGroupArn is not specified, all EC2 instances in the current
// AWS account and region are included in the assessment target.
func (c *Client) UpdateAssessmentTarget(ctx context.Context, params *UpdateAssessmentTargetInput, optFns ...func(*Options)) (*UpdateAssessmentTargetOutput, error) {
if params == nil {
params = &UpdateAssessmentTargetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAssessmentTarget", params, optFns, c.addOperationUpdateAssessmentTargetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAssessmentTargetOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAssessmentTargetInput struct {
// The ARN of the assessment target that you want to update.
//
// This member is required.
AssessmentTargetArn *string
// The name of the assessment target that you want to update.
//
// This member is required.
AssessmentTargetName *string
// The ARN of the resource group that is used to specify the new resource group to
// associate with the assessment target.
ResourceGroupArn *string
noSmithyDocumentSerde
}
type UpdateAssessmentTargetOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAssessmentTargetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAssessmentTarget{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAssessmentTarget{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateAssessmentTargetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssessmentTarget(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
}
return nil
}
func newServiceMetadataMiddleware_opUpdateAssessmentTarget(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector",
OperationName: "UpdateAssessmentTarget",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"io/ioutil"
"math"
"strings"
)
type awsAwsjson11_deserializeOpAddAttributesToFindings struct {
}
func (*awsAwsjson11_deserializeOpAddAttributesToFindings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddAttributesToFindings) 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, awsAwsjson11_deserializeOpErrorAddAttributesToFindings(response, &metadata)
}
output := &AddAttributesToFindingsOutput{}
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 = awsAwsjson11_deserializeOpDocumentAddAttributesToFindingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorAddAttributesToFindings(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateAssessmentTarget struct {
}
func (*awsAwsjson11_deserializeOpCreateAssessmentTarget) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateAssessmentTarget) 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, awsAwsjson11_deserializeOpErrorCreateAssessmentTarget(response, &metadata)
}
output := &CreateAssessmentTargetOutput{}
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 = awsAwsjson11_deserializeOpDocumentCreateAssessmentTargetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateAssessmentTarget(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidCrossAccountRoleException", errorCode):
return awsAwsjson11_deserializeErrorInvalidCrossAccountRoleException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateAssessmentTemplate struct {
}
func (*awsAwsjson11_deserializeOpCreateAssessmentTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateAssessmentTemplate) 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, awsAwsjson11_deserializeOpErrorCreateAssessmentTemplate(response, &metadata)
}
output := &CreateAssessmentTemplateOutput{}
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 = awsAwsjson11_deserializeOpDocumentCreateAssessmentTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateAssessmentTemplate(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateExclusionsPreview struct {
}
func (*awsAwsjson11_deserializeOpCreateExclusionsPreview) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateExclusionsPreview) 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, awsAwsjson11_deserializeOpErrorCreateExclusionsPreview(response, &metadata)
}
output := &CreateExclusionsPreviewOutput{}
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 = awsAwsjson11_deserializeOpDocumentCreateExclusionsPreviewOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateExclusionsPreview(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("PreviewGenerationInProgressException", errorCode):
return awsAwsjson11_deserializeErrorPreviewGenerationInProgressException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateResourceGroup struct {
}
func (*awsAwsjson11_deserializeOpCreateResourceGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateResourceGroup) 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, awsAwsjson11_deserializeOpErrorCreateResourceGroup(response, &metadata)
}
output := &CreateResourceGroupOutput{}
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 = awsAwsjson11_deserializeOpDocumentCreateResourceGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateResourceGroup(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteAssessmentRun struct {
}
func (*awsAwsjson11_deserializeOpDeleteAssessmentRun) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteAssessmentRun) 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, awsAwsjson11_deserializeOpErrorDeleteAssessmentRun(response, &metadata)
}
output := &DeleteAssessmentRunOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteAssessmentRun(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AssessmentRunInProgressException", errorCode):
return awsAwsjson11_deserializeErrorAssessmentRunInProgressException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteAssessmentTarget struct {
}
func (*awsAwsjson11_deserializeOpDeleteAssessmentTarget) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteAssessmentTarget) 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, awsAwsjson11_deserializeOpErrorDeleteAssessmentTarget(response, &metadata)
}
output := &DeleteAssessmentTargetOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteAssessmentTarget(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AssessmentRunInProgressException", errorCode):
return awsAwsjson11_deserializeErrorAssessmentRunInProgressException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteAssessmentTemplate struct {
}
func (*awsAwsjson11_deserializeOpDeleteAssessmentTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteAssessmentTemplate) 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, awsAwsjson11_deserializeOpErrorDeleteAssessmentTemplate(response, &metadata)
}
output := &DeleteAssessmentTemplateOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteAssessmentTemplate(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AssessmentRunInProgressException", errorCode):
return awsAwsjson11_deserializeErrorAssessmentRunInProgressException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeAssessmentRuns struct {
}
func (*awsAwsjson11_deserializeOpDescribeAssessmentRuns) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeAssessmentRuns) 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, awsAwsjson11_deserializeOpErrorDescribeAssessmentRuns(response, &metadata)
}
output := &DescribeAssessmentRunsOutput{}
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 = awsAwsjson11_deserializeOpDocumentDescribeAssessmentRunsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeAssessmentRuns(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("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeAssessmentTargets struct {
}
func (*awsAwsjson11_deserializeOpDescribeAssessmentTargets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeAssessmentTargets) 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, awsAwsjson11_deserializeOpErrorDescribeAssessmentTargets(response, &metadata)
}
output := &DescribeAssessmentTargetsOutput{}
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 = awsAwsjson11_deserializeOpDocumentDescribeAssessmentTargetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeAssessmentTargets(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("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeAssessmentTemplates struct {
}
func (*awsAwsjson11_deserializeOpDescribeAssessmentTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeAssessmentTemplates) 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, awsAwsjson11_deserializeOpErrorDescribeAssessmentTemplates(response, &metadata)
}
output := &DescribeAssessmentTemplatesOutput{}
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 = awsAwsjson11_deserializeOpDocumentDescribeAssessmentTemplatesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeAssessmentTemplates(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("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeCrossAccountAccessRole struct {
}
func (*awsAwsjson11_deserializeOpDescribeCrossAccountAccessRole) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeCrossAccountAccessRole) 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, awsAwsjson11_deserializeOpErrorDescribeCrossAccountAccessRole(response, &metadata)
}
output := &DescribeCrossAccountAccessRoleOutput{}
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 = awsAwsjson11_deserializeOpDocumentDescribeCrossAccountAccessRoleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeCrossAccountAccessRole(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("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeExclusions struct {
}
func (*awsAwsjson11_deserializeOpDescribeExclusions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeExclusions) 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, awsAwsjson11_deserializeOpErrorDescribeExclusions(response, &metadata)
}
output := &DescribeExclusionsOutput{}
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 = awsAwsjson11_deserializeOpDocumentDescribeExclusionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeExclusions(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("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeFindings struct {
}
func (*awsAwsjson11_deserializeOpDescribeFindings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeFindings) 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, awsAwsjson11_deserializeOpErrorDescribeFindings(response, &metadata)
}
output := &DescribeFindingsOutput{}
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 = awsAwsjson11_deserializeOpDocumentDescribeFindingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeFindings(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("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeResourceGroups struct {
}
func (*awsAwsjson11_deserializeOpDescribeResourceGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeResourceGroups) 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, awsAwsjson11_deserializeOpErrorDescribeResourceGroups(response, &metadata)
}
output := &DescribeResourceGroupsOutput{}
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 = awsAwsjson11_deserializeOpDocumentDescribeResourceGroupsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeResourceGroups(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("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeRulesPackages struct {
}
func (*awsAwsjson11_deserializeOpDescribeRulesPackages) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeRulesPackages) 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, awsAwsjson11_deserializeOpErrorDescribeRulesPackages(response, &metadata)
}
output := &DescribeRulesPackagesOutput{}
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 = awsAwsjson11_deserializeOpDocumentDescribeRulesPackagesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeRulesPackages(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("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetAssessmentReport struct {
}
func (*awsAwsjson11_deserializeOpGetAssessmentReport) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetAssessmentReport) 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, awsAwsjson11_deserializeOpErrorGetAssessmentReport(response, &metadata)
}
output := &GetAssessmentReportOutput{}
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 = awsAwsjson11_deserializeOpDocumentGetAssessmentReportOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetAssessmentReport(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AssessmentRunInProgressException", errorCode):
return awsAwsjson11_deserializeErrorAssessmentRunInProgressException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
case strings.EqualFold("UnsupportedFeatureException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedFeatureException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetExclusionsPreview struct {
}
func (*awsAwsjson11_deserializeOpGetExclusionsPreview) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetExclusionsPreview) 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, awsAwsjson11_deserializeOpErrorGetExclusionsPreview(response, &metadata)
}
output := &GetExclusionsPreviewOutput{}
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 = awsAwsjson11_deserializeOpDocumentGetExclusionsPreviewOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetExclusionsPreview(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetTelemetryMetadata struct {
}
func (*awsAwsjson11_deserializeOpGetTelemetryMetadata) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetTelemetryMetadata) 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, awsAwsjson11_deserializeOpErrorGetTelemetryMetadata(response, &metadata)
}
output := &GetTelemetryMetadataOutput{}
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 = awsAwsjson11_deserializeOpDocumentGetTelemetryMetadataOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetTelemetryMetadata(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAssessmentRunAgents struct {
}
func (*awsAwsjson11_deserializeOpListAssessmentRunAgents) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAssessmentRunAgents) 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, awsAwsjson11_deserializeOpErrorListAssessmentRunAgents(response, &metadata)
}
output := &ListAssessmentRunAgentsOutput{}
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 = awsAwsjson11_deserializeOpDocumentListAssessmentRunAgentsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListAssessmentRunAgents(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAssessmentRuns struct {
}
func (*awsAwsjson11_deserializeOpListAssessmentRuns) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAssessmentRuns) 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, awsAwsjson11_deserializeOpErrorListAssessmentRuns(response, &metadata)
}
output := &ListAssessmentRunsOutput{}
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 = awsAwsjson11_deserializeOpDocumentListAssessmentRunsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListAssessmentRuns(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAssessmentTargets struct {
}
func (*awsAwsjson11_deserializeOpListAssessmentTargets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAssessmentTargets) 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, awsAwsjson11_deserializeOpErrorListAssessmentTargets(response, &metadata)
}
output := &ListAssessmentTargetsOutput{}
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 = awsAwsjson11_deserializeOpDocumentListAssessmentTargetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListAssessmentTargets(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAssessmentTemplates struct {
}
func (*awsAwsjson11_deserializeOpListAssessmentTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAssessmentTemplates) 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, awsAwsjson11_deserializeOpErrorListAssessmentTemplates(response, &metadata)
}
output := &ListAssessmentTemplatesOutput{}
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 = awsAwsjson11_deserializeOpDocumentListAssessmentTemplatesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListAssessmentTemplates(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListEventSubscriptions struct {
}
func (*awsAwsjson11_deserializeOpListEventSubscriptions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListEventSubscriptions) 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, awsAwsjson11_deserializeOpErrorListEventSubscriptions(response, &metadata)
}
output := &ListEventSubscriptionsOutput{}
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 = awsAwsjson11_deserializeOpDocumentListEventSubscriptionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListEventSubscriptions(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListExclusions struct {
}
func (*awsAwsjson11_deserializeOpListExclusions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListExclusions) 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, awsAwsjson11_deserializeOpErrorListExclusions(response, &metadata)
}
output := &ListExclusionsOutput{}
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 = awsAwsjson11_deserializeOpDocumentListExclusionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListExclusions(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListFindings struct {
}
func (*awsAwsjson11_deserializeOpListFindings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_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)
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, awsAwsjson11_deserializeOpErrorListFindings(response, &metadata)
}
output := &ListFindingsOutput{}
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 = awsAwsjson11_deserializeOpDocumentListFindingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_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)}
}
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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListRulesPackages struct {
}
func (*awsAwsjson11_deserializeOpListRulesPackages) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListRulesPackages) 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, awsAwsjson11_deserializeOpErrorListRulesPackages(response, &metadata)
}
output := &ListRulesPackagesOutput{}
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 = awsAwsjson11_deserializeOpDocumentListRulesPackagesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListRulesPackages(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPreviewAgents struct {
}
func (*awsAwsjson11_deserializeOpPreviewAgents) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPreviewAgents) 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, awsAwsjson11_deserializeOpErrorPreviewAgents(response, &metadata)
}
output := &PreviewAgentsOutput{}
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 = awsAwsjson11_deserializeOpDocumentPreviewAgentsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorPreviewAgents(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidCrossAccountRoleException", errorCode):
return awsAwsjson11_deserializeErrorInvalidCrossAccountRoleException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpRegisterCrossAccountAccessRole struct {
}
func (*awsAwsjson11_deserializeOpRegisterCrossAccountAccessRole) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRegisterCrossAccountAccessRole) 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, awsAwsjson11_deserializeOpErrorRegisterCrossAccountAccessRole(response, &metadata)
}
output := &RegisterCrossAccountAccessRoleOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorRegisterCrossAccountAccessRole(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidCrossAccountRoleException", errorCode):
return awsAwsjson11_deserializeErrorInvalidCrossAccountRoleException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpRemoveAttributesFromFindings struct {
}
func (*awsAwsjson11_deserializeOpRemoveAttributesFromFindings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRemoveAttributesFromFindings) 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, awsAwsjson11_deserializeOpErrorRemoveAttributesFromFindings(response, &metadata)
}
output := &RemoveAttributesFromFindingsOutput{}
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 = awsAwsjson11_deserializeOpDocumentRemoveAttributesFromFindingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorRemoveAttributesFromFindings(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSetTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpSetTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSetTagsForResource) 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, awsAwsjson11_deserializeOpErrorSetTagsForResource(response, &metadata)
}
output := &SetTagsForResourceOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSetTagsForResource(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartAssessmentRun struct {
}
func (*awsAwsjson11_deserializeOpStartAssessmentRun) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartAssessmentRun) 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, awsAwsjson11_deserializeOpErrorStartAssessmentRun(response, &metadata)
}
output := &StartAssessmentRunOutput{}
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 = awsAwsjson11_deserializeOpDocumentStartAssessmentRunOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorStartAssessmentRun(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AgentsAlreadyRunningAssessmentException", errorCode):
return awsAwsjson11_deserializeErrorAgentsAlreadyRunningAssessmentException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidCrossAccountRoleException", errorCode):
return awsAwsjson11_deserializeErrorInvalidCrossAccountRoleException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStopAssessmentRun struct {
}
func (*awsAwsjson11_deserializeOpStopAssessmentRun) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStopAssessmentRun) 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, awsAwsjson11_deserializeOpErrorStopAssessmentRun(response, &metadata)
}
output := &StopAssessmentRunOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorStopAssessmentRun(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSubscribeToEvent struct {
}
func (*awsAwsjson11_deserializeOpSubscribeToEvent) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSubscribeToEvent) 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, awsAwsjson11_deserializeOpErrorSubscribeToEvent(response, &metadata)
}
output := &SubscribeToEventOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSubscribeToEvent(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUnsubscribeFromEvent struct {
}
func (*awsAwsjson11_deserializeOpUnsubscribeFromEvent) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUnsubscribeFromEvent) 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, awsAwsjson11_deserializeOpErrorUnsubscribeFromEvent(response, &metadata)
}
output := &UnsubscribeFromEventOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUnsubscribeFromEvent(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateAssessmentTarget struct {
}
func (*awsAwsjson11_deserializeOpUpdateAssessmentTarget) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateAssessmentTarget) 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, awsAwsjson11_deserializeOpErrorUpdateAssessmentTarget(response, &metadata)
}
output := &UpdateAssessmentTargetOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateAssessmentTarget(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalException", errorCode):
return awsAwsjson11_deserializeErrorInternalException(response, errorBody)
case strings.EqualFold("InvalidInputException", errorCode):
return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody)
case strings.EqualFold("NoSuchEntityException", errorCode):
return awsAwsjson11_deserializeErrorNoSuchEntityException(response, errorBody)
case strings.EqualFold("ServiceTemporarilyUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.AccessDeniedException{}
err := awsAwsjson11_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 awsAwsjson11_deserializeErrorAgentsAlreadyRunningAssessmentException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.AgentsAlreadyRunningAssessmentException{}
err := awsAwsjson11_deserializeDocumentAgentsAlreadyRunningAssessmentException(&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 awsAwsjson11_deserializeErrorAssessmentRunInProgressException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.AssessmentRunInProgressException{}
err := awsAwsjson11_deserializeDocumentAssessmentRunInProgressException(&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 awsAwsjson11_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.InternalException{}
err := awsAwsjson11_deserializeDocumentInternalException(&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 awsAwsjson11_deserializeErrorInvalidCrossAccountRoleException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.InvalidCrossAccountRoleException{}
err := awsAwsjson11_deserializeDocumentInvalidCrossAccountRoleException(&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 awsAwsjson11_deserializeErrorInvalidInputException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.InvalidInputException{}
err := awsAwsjson11_deserializeDocumentInvalidInputException(&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 awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.LimitExceededException{}
err := awsAwsjson11_deserializeDocumentLimitExceededException(&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 awsAwsjson11_deserializeErrorNoSuchEntityException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.NoSuchEntityException{}
err := awsAwsjson11_deserializeDocumentNoSuchEntityException(&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 awsAwsjson11_deserializeErrorPreviewGenerationInProgressException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.PreviewGenerationInProgressException{}
err := awsAwsjson11_deserializeDocumentPreviewGenerationInProgressException(&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 awsAwsjson11_deserializeErrorServiceTemporarilyUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.ServiceTemporarilyUnavailableException{}
err := awsAwsjson11_deserializeDocumentServiceTemporarilyUnavailableException(&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 awsAwsjson11_deserializeErrorUnsupportedFeatureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
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
}
output := &types.UnsupportedFeatureException{}
err := awsAwsjson11_deserializeDocumentUnsupportedFeatureException(&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 awsAwsjson11_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 "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccessDeniedErrorCode to be of type string, got %T instead", value)
}
sv.ErrorCode_ = types.AccessDeniedErrorCode(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAgentAlreadyRunningAssessment(v **types.AgentAlreadyRunningAssessment, 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.AgentAlreadyRunningAssessment
if *v == nil {
sv = &types.AgentAlreadyRunningAssessment{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "agentId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AgentId to be of type string, got %T instead", value)
}
sv.AgentId = ptr.String(jtv)
}
case "assessmentRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentRunArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAgentAlreadyRunningAssessmentList(v *[]types.AgentAlreadyRunningAssessment, 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.AgentAlreadyRunningAssessment
if *v == nil {
cv = []types.AgentAlreadyRunningAssessment{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AgentAlreadyRunningAssessment
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAgentAlreadyRunningAssessment(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAgentPreview(v **types.AgentPreview, 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.AgentPreview
if *v == nil {
sv = &types.AgentPreview{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "agentHealth":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AgentHealth to be of type string, got %T instead", value)
}
sv.AgentHealth = types.AgentHealth(jtv)
}
case "agentId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AgentId to be of type string, got %T instead", value)
}
sv.AgentId = ptr.String(jtv)
}
case "agentVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AgentVersion to be of type string, got %T instead", value)
}
sv.AgentVersion = ptr.String(jtv)
}
case "autoScalingGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AutoScalingGroup to be of type string, got %T instead", value)
}
sv.AutoScalingGroup = ptr.String(jtv)
}
case "hostname":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Hostname to be of type string, got %T instead", value)
}
sv.Hostname = ptr.String(jtv)
}
case "ipv4Address":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Ipv4Address to be of type string, got %T instead", value)
}
sv.Ipv4Address = ptr.String(jtv)
}
case "kernelVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KernelVersion to be of type string, got %T instead", value)
}
sv.KernelVersion = ptr.String(jtv)
}
case "operatingSystem":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OperatingSystem to be of type string, got %T instead", value)
}
sv.OperatingSystem = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAgentPreviewList(v *[]types.AgentPreview, 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.AgentPreview
if *v == nil {
cv = []types.AgentPreview{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AgentPreview
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAgentPreview(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAgentsAlreadyRunningAssessmentException(v **types.AgentsAlreadyRunningAssessmentException, 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.AgentsAlreadyRunningAssessmentException
if *v == nil {
sv = &types.AgentsAlreadyRunningAssessmentException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "agents":
if err := awsAwsjson11_deserializeDocumentAgentAlreadyRunningAssessmentList(&sv.Agents, value); err != nil {
return err
}
case "agentsTruncated":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.AgentsTruncated = ptr.Bool(jtv)
}
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRulesPackageArnList(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 Arn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRun(v **types.AssessmentRun, 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.AssessmentRun
if *v == nil {
sv = &types.AssessmentRun{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "assessmentTemplateArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentTemplateArn = ptr.String(jtv)
}
case "completedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "dataCollected":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.DataCollected = ptr.Bool(jtv)
}
case "durationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AssessmentRunDuration to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = int32(i64)
}
case "findingCounts":
if err := awsAwsjson11_deserializeDocumentAssessmentRunFindingCounts(&sv.FindingCounts, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentRunName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "notifications":
if err := awsAwsjson11_deserializeDocumentAssessmentRunNotificationList(&sv.Notifications, value); err != nil {
return err
}
case "rulesPackageArns":
if err := awsAwsjson11_deserializeDocumentAssessmentRulesPackageArnList(&sv.RulesPackageArns, value); err != nil {
return err
}
case "startedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "state":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentRunState to be of type string, got %T instead", value)
}
sv.State = types.AssessmentRunState(jtv)
}
case "stateChangedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StateChangedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "stateChanges":
if err := awsAwsjson11_deserializeDocumentAssessmentRunStateChangeList(&sv.StateChanges, value); err != nil {
return err
}
case "userAttributesForFindings":
if err := awsAwsjson11_deserializeDocumentUserAttributeList(&sv.UserAttributesForFindings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunAgent(v **types.AssessmentRunAgent, 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.AssessmentRunAgent
if *v == nil {
sv = &types.AssessmentRunAgent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "agentHealth":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AgentHealth to be of type string, got %T instead", value)
}
sv.AgentHealth = types.AgentHealth(jtv)
}
case "agentHealthCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AgentHealthCode to be of type string, got %T instead", value)
}
sv.AgentHealthCode = types.AgentHealthCode(jtv)
}
case "agentHealthDetails":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.AgentHealthDetails = ptr.String(jtv)
}
case "agentId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AgentId to be of type string, got %T instead", value)
}
sv.AgentId = ptr.String(jtv)
}
case "assessmentRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentRunArn = ptr.String(jtv)
}
case "autoScalingGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AutoScalingGroup to be of type string, got %T instead", value)
}
sv.AutoScalingGroup = ptr.String(jtv)
}
case "telemetryMetadata":
if err := awsAwsjson11_deserializeDocumentTelemetryMetadataList(&sv.TelemetryMetadata, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunAgentList(v *[]types.AssessmentRunAgent, 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.AssessmentRunAgent
if *v == nil {
cv = []types.AssessmentRunAgent{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AssessmentRunAgent
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAssessmentRunAgent(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunFindingCounts(v *map[string]int32, 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]int32
if *v == nil {
mv = map[string]int32{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal int32
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected FindingCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
parsedVal = int32(i64)
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunInProgressArnList(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 Arn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunInProgressException(v **types.AssessmentRunInProgressException, 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.AssessmentRunInProgressException
if *v == nil {
sv = &types.AssessmentRunInProgressException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentRunArns":
if err := awsAwsjson11_deserializeDocumentAssessmentRunInProgressArnList(&sv.AssessmentRunArns, value); err != nil {
return err
}
case "assessmentRunArnsTruncated":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.AssessmentRunArnsTruncated = ptr.Bool(jtv)
}
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunList(v *[]types.AssessmentRun, 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.AssessmentRun
if *v == nil {
cv = []types.AssessmentRun{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AssessmentRun
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAssessmentRun(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunNotification(v **types.AssessmentRunNotification, 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.AssessmentRunNotification
if *v == nil {
sv = &types.AssessmentRunNotification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "date":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "error":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.Error = ptr.Bool(jtv)
}
case "event":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InspectorEvent to be of type string, got %T instead", value)
}
sv.Event = types.InspectorEvent(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "snsPublishStatusCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentRunNotificationSnsStatusCode to be of type string, got %T instead", value)
}
sv.SnsPublishStatusCode = types.AssessmentRunNotificationSnsStatusCode(jtv)
}
case "snsTopicArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.SnsTopicArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunNotificationList(v *[]types.AssessmentRunNotification, 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.AssessmentRunNotification
if *v == nil {
cv = []types.AssessmentRunNotification{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AssessmentRunNotification
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAssessmentRunNotification(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunStateChange(v **types.AssessmentRunStateChange, 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.AssessmentRunStateChange
if *v == nil {
sv = &types.AssessmentRunStateChange{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "state":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentRunState to be of type string, got %T instead", value)
}
sv.State = types.AssessmentRunState(jtv)
}
case "stateChangedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StateChangedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentRunStateChangeList(v *[]types.AssessmentRunStateChange, 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.AssessmentRunStateChange
if *v == nil {
cv = []types.AssessmentRunStateChange{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AssessmentRunStateChange
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAssessmentRunStateChange(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentTarget(v **types.AssessmentTarget, 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.AssessmentTarget
if *v == nil {
sv = &types.AssessmentTarget{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentTargetName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "resourceGroupArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ResourceGroupArn = ptr.String(jtv)
}
case "updatedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentTargetList(v *[]types.AssessmentTarget, 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.AssessmentTarget
if *v == nil {
cv = []types.AssessmentTarget{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AssessmentTarget
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAssessmentTarget(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentTemplate(v **types.AssessmentTemplate, 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.AssessmentTemplate
if *v == nil {
sv = &types.AssessmentTemplate{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "assessmentRunCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ArnCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.AssessmentRunCount = ptr.Int32(int32(i64))
}
case "assessmentTargetArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentTargetArn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "durationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AssessmentRunDuration to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = int32(i64)
}
case "lastAssessmentRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.LastAssessmentRunArn = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentTemplateName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "rulesPackageArns":
if err := awsAwsjson11_deserializeDocumentAssessmentTemplateRulesPackageArnList(&sv.RulesPackageArns, value); err != nil {
return err
}
case "userAttributesForFindings":
if err := awsAwsjson11_deserializeDocumentUserAttributeList(&sv.UserAttributesForFindings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentTemplateList(v *[]types.AssessmentTemplate, 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.AssessmentTemplate
if *v == nil {
cv = []types.AssessmentTemplate{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AssessmentTemplate
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAssessmentTemplate(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssessmentTemplateRulesPackageArnList(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 Arn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAssetAttributes(v **types.AssetAttributes, 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.AssetAttributes
if *v == nil {
sv = &types.AssetAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "agentId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AgentId to be of type string, got %T instead", value)
}
sv.AgentId = ptr.String(jtv)
}
case "amiId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmiId to be of type string, got %T instead", value)
}
sv.AmiId = ptr.String(jtv)
}
case "autoScalingGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AutoScalingGroup to be of type string, got %T instead", value)
}
sv.AutoScalingGroup = ptr.String(jtv)
}
case "hostname":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Hostname to be of type string, got %T instead", value)
}
sv.Hostname = ptr.String(jtv)
}
case "ipv4Addresses":
if err := awsAwsjson11_deserializeDocumentIpv4AddressList(&sv.Ipv4Addresses, value); err != nil {
return err
}
case "networkInterfaces":
if err := awsAwsjson11_deserializeDocumentNetworkInterfaces(&sv.NetworkInterfaces, value); err != nil {
return err
}
case "schemaVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected NumericVersion to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SchemaVersion = int32(i64)
}
case "tags":
if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttribute(v **types.Attribute, 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.Attribute
if *v == nil {
sv = &types.Attribute{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttributeKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttributeValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttributeList(v *[]types.Attribute, 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.Attribute
if *v == nil {
cv = []types.Attribute{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Attribute
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAttribute(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentEventSubscription(v **types.EventSubscription, 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.EventSubscription
if *v == nil {
sv = &types.EventSubscription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "event":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InspectorEvent to be of type string, got %T instead", value)
}
sv.Event = types.InspectorEvent(jtv)
}
case "subscribedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SubscribedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEventSubscriptionList(v *[]types.EventSubscription, 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.EventSubscription
if *v == nil {
cv = []types.EventSubscription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EventSubscription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEventSubscription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentExclusion(v **types.Exclusion, 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.Exclusion
if *v == nil {
sv = &types.Exclusion{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "attributes":
if err := awsAwsjson11_deserializeDocumentAttributeList(&sv.Attributes, value); err != nil {
return err
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "recommendation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Recommendation = ptr.String(jtv)
}
case "scopes":
if err := awsAwsjson11_deserializeDocumentScopeList(&sv.Scopes, value); err != nil {
return err
}
case "title":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Title = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentExclusionMap(v *map[string]types.Exclusion, 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]types.Exclusion
if *v == nil {
mv = map[string]types.Exclusion{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.Exclusion
mapVar := parsedVal
destAddr := &mapVar
if err := awsAwsjson11_deserializeDocumentExclusion(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentExclusionPreview(v **types.ExclusionPreview, 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.ExclusionPreview
if *v == nil {
sv = &types.ExclusionPreview{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "attributes":
if err := awsAwsjson11_deserializeDocumentAttributeList(&sv.Attributes, value); err != nil {
return err
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "recommendation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Recommendation = ptr.String(jtv)
}
case "scopes":
if err := awsAwsjson11_deserializeDocumentScopeList(&sv.Scopes, value); err != nil {
return err
}
case "title":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Title = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentExclusionPreviewList(v *[]types.ExclusionPreview, 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.ExclusionPreview
if *v == nil {
cv = []types.ExclusionPreview{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExclusionPreview
destAddr := &col
if err := awsAwsjson11_deserializeDocumentExclusionPreview(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFailedItemDetails(v **types.FailedItemDetails, 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.FailedItemDetails
if *v == nil {
sv = &types.FailedItemDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "failureCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailedItemErrorCode to be of type string, got %T instead", value)
}
sv.FailureCode = types.FailedItemErrorCode(jtv)
}
case "retryable":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.Retryable = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFailedItems(v *map[string]types.FailedItemDetails, 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]types.FailedItemDetails
if *v == nil {
mv = map[string]types.FailedItemDetails{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.FailedItemDetails
mapVar := parsedVal
destAddr := &mapVar
if err := awsAwsjson11_deserializeDocumentFailedItemDetails(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentFinding(v **types.Finding, 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.Finding
if *v == nil {
sv = &types.Finding{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "assetAttributes":
if err := awsAwsjson11_deserializeDocumentAssetAttributes(&sv.AssetAttributes, value); err != nil {
return err
}
case "assetType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssetType to be of type string, got %T instead", value)
}
sv.AssetType = types.AssetType(jtv)
}
case "attributes":
if err := awsAwsjson11_deserializeDocumentAttributeList(&sv.Attributes, value); err != nil {
return err
}
case "confidence":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected IocConfidence to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Confidence = int32(i64)
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FindingId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "indicatorOfCompromise":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.IndicatorOfCompromise = ptr.Bool(jtv)
}
case "numericSeverity":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.NumericSeverity = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.NumericSeverity = f64
default:
return fmt.Errorf("expected NumericSeverity to be a JSON Number, got %T instead", value)
}
}
case "recommendation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Recommendation = ptr.String(jtv)
}
case "schemaVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected NumericVersion to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SchemaVersion = int32(i64)
}
case "service":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value)
}
sv.Service = ptr.String(jtv)
}
case "serviceAttributes":
if err := awsAwsjson11_deserializeDocumentInspectorServiceAttributes(&sv.ServiceAttributes, value); err != nil {
return err
}
case "severity":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Severity to be of type string, got %T instead", value)
}
sv.Severity = types.Severity(jtv)
}
case "title":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Title = ptr.String(jtv)
}
case "updatedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "userAttributes":
if err := awsAwsjson11_deserializeDocumentUserAttributeList(&sv.UserAttributes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFindingList(v *[]types.Finding, 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.Finding
if *v == nil {
cv = []types.Finding{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Finding
destAddr := &col
if err := awsAwsjson11_deserializeDocumentFinding(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInspectorServiceAttributes(v **types.InspectorServiceAttributes, 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.InspectorServiceAttributes
if *v == nil {
sv = &types.InspectorServiceAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentRunArn = ptr.String(jtv)
}
case "rulesPackageArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.RulesPackageArn = ptr.String(jtv)
}
case "schemaVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected NumericVersion to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SchemaVersion = int32(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInternalException(v **types.InternalException, 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.InternalException
if *v == nil {
sv = &types.InternalException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidCrossAccountRoleException(v **types.InvalidCrossAccountRoleException, 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.InvalidCrossAccountRoleException
if *v == nil {
sv = &types.InvalidCrossAccountRoleException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InvalidCrossAccountRoleErrorCode to be of type string, got %T instead", value)
}
sv.ErrorCode_ = types.InvalidCrossAccountRoleErrorCode(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidInputException(v **types.InvalidInputException, 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.InvalidInputException
if *v == nil {
sv = &types.InvalidInputException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InvalidInputErrorCode to be of type string, got %T instead", value)
}
sv.ErrorCode_ = types.InvalidInputErrorCode(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIpv4AddressList(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 Ipv4Address to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentIpv6Addresses(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 Text to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LimitExceededException
if *v == nil {
sv = &types.LimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LimitExceededErrorCode to be of type string, got %T instead", value)
}
sv.ErrorCode_ = types.LimitExceededErrorCode(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentListReturnedArnList(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 Arn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentNetworkInterface(v **types.NetworkInterface, 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.NetworkInterface
if *v == nil {
sv = &types.NetworkInterface{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ipv6Addresses":
if err := awsAwsjson11_deserializeDocumentIpv6Addresses(&sv.Ipv6Addresses, value); err != nil {
return err
}
case "networkInterfaceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.NetworkInterfaceId = ptr.String(jtv)
}
case "privateDnsName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.PrivateDnsName = ptr.String(jtv)
}
case "privateIpAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.PrivateIpAddress = ptr.String(jtv)
}
case "privateIpAddresses":
if err := awsAwsjson11_deserializeDocumentPrivateIpAddresses(&sv.PrivateIpAddresses, value); err != nil {
return err
}
case "publicDnsName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.PublicDnsName = ptr.String(jtv)
}
case "publicIp":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.PublicIp = ptr.String(jtv)
}
case "securityGroups":
if err := awsAwsjson11_deserializeDocumentSecurityGroups(&sv.SecurityGroups, value); err != nil {
return err
}
case "subnetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.SubnetId = ptr.String(jtv)
}
case "vpcId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.VpcId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentNetworkInterfaces(v *[]types.NetworkInterface, 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.NetworkInterface
if *v == nil {
cv = []types.NetworkInterface{}
} else {
cv = *v
}
for _, value := range shape {
var col types.NetworkInterface
destAddr := &col
if err := awsAwsjson11_deserializeDocumentNetworkInterface(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentNoSuchEntityException(v **types.NoSuchEntityException, 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.NoSuchEntityException
if *v == nil {
sv = &types.NoSuchEntityException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NoSuchEntityErrorCode to be of type string, got %T instead", value)
}
sv.ErrorCode_ = types.NoSuchEntityErrorCode(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPreviewGenerationInProgressException(v **types.PreviewGenerationInProgressException, 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.PreviewGenerationInProgressException
if *v == nil {
sv = &types.PreviewGenerationInProgressException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPrivateIp(v **types.PrivateIp, 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.PrivateIp
if *v == nil {
sv = &types.PrivateIp{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "privateDnsName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.PrivateDnsName = ptr.String(jtv)
}
case "privateIpAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.PrivateIpAddress = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPrivateIpAddresses(v *[]types.PrivateIp, 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.PrivateIp
if *v == nil {
cv = []types.PrivateIp{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PrivateIp
destAddr := &col
if err := awsAwsjson11_deserializeDocumentPrivateIp(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResourceGroup(v **types.ResourceGroup, 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.ResourceGroup
if *v == nil {
sv = &types.ResourceGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "tags":
if err := awsAwsjson11_deserializeDocumentResourceGroupTags(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceGroupList(v *[]types.ResourceGroup, 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.ResourceGroup
if *v == nil {
cv = []types.ResourceGroup{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ResourceGroup
destAddr := &col
if err := awsAwsjson11_deserializeDocumentResourceGroup(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResourceGroupTag(v **types.ResourceGroupTag, 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.ResourceGroupTag
if *v == nil {
sv = &types.ResourceGroupTag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceGroupTags(v *[]types.ResourceGroupTag, 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.ResourceGroupTag
if *v == nil {
cv = []types.ResourceGroupTag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ResourceGroupTag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentResourceGroupTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRulesPackage(v **types.RulesPackage, 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.RulesPackage
if *v == nil {
sv = &types.RulesPackage{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RulesPackageName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "provider":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProviderName to be of type string, got %T instead", value)
}
sv.Provider = ptr.String(jtv)
}
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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRulesPackageList(v *[]types.RulesPackage, 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.RulesPackage
if *v == nil {
cv = []types.RulesPackage{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RulesPackage
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRulesPackage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentScope(v **types.Scope, 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.Scope
if *v == nil {
sv = &types.Scope{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ScopeType to be of type string, got %T instead", value)
}
sv.Key = types.ScopeType(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ScopeValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentScopeList(v *[]types.Scope, 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.Scope
if *v == nil {
cv = []types.Scope{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Scope
destAddr := &col
if err := awsAwsjson11_deserializeDocumentScope(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSecurityGroup(v **types.SecurityGroup, 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.SecurityGroup
if *v == nil {
sv = &types.SecurityGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "groupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.GroupId = ptr.String(jtv)
}
case "groupName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.GroupName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSecurityGroups(v *[]types.SecurityGroup, 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.SecurityGroup
if *v == nil {
cv = []types.SecurityGroup{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SecurityGroup
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSecurityGroup(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentServiceTemporarilyUnavailableException(v **types.ServiceTemporarilyUnavailableException, 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.ServiceTemporarilyUnavailableException
if *v == nil {
sv = &types.ServiceTemporarilyUnavailableException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSubscription(v **types.Subscription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Subscription
if *v == nil {
sv = &types.Subscription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eventSubscriptions":
if err := awsAwsjson11_deserializeDocumentEventSubscriptionList(&sv.EventSubscriptions, value); err != nil {
return err
}
case "resourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "topicArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.TopicArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSubscriptionList(v *[]types.Subscription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Subscription
if *v == nil {
cv = []types.Subscription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Subscription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSubscription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, 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.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, 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.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTags(v *[]types.Tag, 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.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTelemetryMetadata(v **types.TelemetryMetadata, 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.TelemetryMetadata
if *v == nil {
sv = &types.TelemetryMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "count":
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.Count = ptr.Int64(i64)
}
case "dataSize":
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.DataSize = ptr.Int64(i64)
}
case "messageType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MessageType to be of type string, got %T instead", value)
}
sv.MessageType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTelemetryMetadataList(v *[]types.TelemetryMetadata, 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.TelemetryMetadata
if *v == nil {
cv = []types.TelemetryMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TelemetryMetadata
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTelemetryMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentUnsupportedFeatureException(v **types.UnsupportedFeatureException, 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.UnsupportedFeatureException
if *v == nil {
sv = &types.UnsupportedFeatureException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "canRetry":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.CanRetry = ptr.Bool(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentUserAttributeList(v *[]types.Attribute, 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.Attribute
if *v == nil {
cv = []types.Attribute{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Attribute
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAttribute(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddAttributesToFindingsOutput(v **AddAttributesToFindingsOutput, 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 *AddAttributesToFindingsOutput
if *v == nil {
sv = &AddAttributesToFindingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateAssessmentTargetOutput(v **CreateAssessmentTargetOutput, 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 *CreateAssessmentTargetOutput
if *v == nil {
sv = &CreateAssessmentTargetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentTargetArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentTargetArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateAssessmentTemplateOutput(v **CreateAssessmentTemplateOutput, 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 *CreateAssessmentTemplateOutput
if *v == nil {
sv = &CreateAssessmentTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentTemplateArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentTemplateArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateExclusionsPreviewOutput(v **CreateExclusionsPreviewOutput, 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 *CreateExclusionsPreviewOutput
if *v == nil {
sv = &CreateExclusionsPreviewOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "previewToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UUID to be of type string, got %T instead", value)
}
sv.PreviewToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateResourceGroupOutput(v **CreateResourceGroupOutput, 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 *CreateResourceGroupOutput
if *v == nil {
sv = &CreateResourceGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "resourceGroupArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ResourceGroupArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeAssessmentRunsOutput(v **DescribeAssessmentRunsOutput, 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 *DescribeAssessmentRunsOutput
if *v == nil {
sv = &DescribeAssessmentRunsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentRuns":
if err := awsAwsjson11_deserializeDocumentAssessmentRunList(&sv.AssessmentRuns, value); err != nil {
return err
}
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeAssessmentTargetsOutput(v **DescribeAssessmentTargetsOutput, 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 *DescribeAssessmentTargetsOutput
if *v == nil {
sv = &DescribeAssessmentTargetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentTargets":
if err := awsAwsjson11_deserializeDocumentAssessmentTargetList(&sv.AssessmentTargets, value); err != nil {
return err
}
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeAssessmentTemplatesOutput(v **DescribeAssessmentTemplatesOutput, 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 *DescribeAssessmentTemplatesOutput
if *v == nil {
sv = &DescribeAssessmentTemplatesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentTemplates":
if err := awsAwsjson11_deserializeDocumentAssessmentTemplateList(&sv.AssessmentTemplates, value); err != nil {
return err
}
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeCrossAccountAccessRoleOutput(v **DescribeCrossAccountAccessRoleOutput, 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 *DescribeCrossAccountAccessRoleOutput
if *v == nil {
sv = &DescribeCrossAccountAccessRoleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "registeredAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.RegisteredAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
case "valid":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Bool to be of type *bool, got %T instead", value)
}
sv.Valid = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeExclusionsOutput(v **DescribeExclusionsOutput, 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 *DescribeExclusionsOutput
if *v == nil {
sv = &DescribeExclusionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exclusions":
if err := awsAwsjson11_deserializeDocumentExclusionMap(&sv.Exclusions, value); err != nil {
return err
}
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeFindingsOutput(v **DescribeFindingsOutput, 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 *DescribeFindingsOutput
if *v == nil {
sv = &DescribeFindingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
case "findings":
if err := awsAwsjson11_deserializeDocumentFindingList(&sv.Findings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeResourceGroupsOutput(v **DescribeResourceGroupsOutput, 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 *DescribeResourceGroupsOutput
if *v == nil {
sv = &DescribeResourceGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
case "resourceGroups":
if err := awsAwsjson11_deserializeDocumentResourceGroupList(&sv.ResourceGroups, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeRulesPackagesOutput(v **DescribeRulesPackagesOutput, 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 *DescribeRulesPackagesOutput
if *v == nil {
sv = &DescribeRulesPackagesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
case "rulesPackages":
if err := awsAwsjson11_deserializeDocumentRulesPackageList(&sv.RulesPackages, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetAssessmentReportOutput(v **GetAssessmentReportOutput, 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 *GetAssessmentReportOutput
if *v == nil {
sv = &GetAssessmentReportOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReportStatus to be of type string, got %T instead", value)
}
sv.Status = types.ReportStatus(jtv)
}
case "url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
}
sv.Url = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetExclusionsPreviewOutput(v **GetExclusionsPreviewOutput, 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 *GetExclusionsPreviewOutput
if *v == nil {
sv = &GetExclusionsPreviewOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exclusionPreviews":
if err := awsAwsjson11_deserializeDocumentExclusionPreviewList(&sv.ExclusionPreviews, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "previewStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PreviewStatus to be of type string, got %T instead", value)
}
sv.PreviewStatus = types.PreviewStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetTelemetryMetadataOutput(v **GetTelemetryMetadataOutput, 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 *GetTelemetryMetadataOutput
if *v == nil {
sv = &GetTelemetryMetadataOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "telemetryMetadata":
if err := awsAwsjson11_deserializeDocumentTelemetryMetadataList(&sv.TelemetryMetadata, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAssessmentRunAgentsOutput(v **ListAssessmentRunAgentsOutput, 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 *ListAssessmentRunAgentsOutput
if *v == nil {
sv = &ListAssessmentRunAgentsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentRunAgents":
if err := awsAwsjson11_deserializeDocumentAssessmentRunAgentList(&sv.AssessmentRunAgents, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAssessmentRunsOutput(v **ListAssessmentRunsOutput, 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 *ListAssessmentRunsOutput
if *v == nil {
sv = &ListAssessmentRunsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentRunArns":
if err := awsAwsjson11_deserializeDocumentListReturnedArnList(&sv.AssessmentRunArns, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAssessmentTargetsOutput(v **ListAssessmentTargetsOutput, 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 *ListAssessmentTargetsOutput
if *v == nil {
sv = &ListAssessmentTargetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentTargetArns":
if err := awsAwsjson11_deserializeDocumentListReturnedArnList(&sv.AssessmentTargetArns, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAssessmentTemplatesOutput(v **ListAssessmentTemplatesOutput, 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 *ListAssessmentTemplatesOutput
if *v == nil {
sv = &ListAssessmentTemplatesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentTemplateArns":
if err := awsAwsjson11_deserializeDocumentListReturnedArnList(&sv.AssessmentTemplateArns, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListEventSubscriptionsOutput(v **ListEventSubscriptionsOutput, 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 *ListEventSubscriptionsOutput
if *v == nil {
sv = &ListEventSubscriptionsOutput{}
} 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 PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "subscriptions":
if err := awsAwsjson11_deserializeDocumentSubscriptionList(&sv.Subscriptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListExclusionsOutput(v **ListExclusionsOutput, 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 *ListExclusionsOutput
if *v == nil {
sv = &ListExclusionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exclusionArns":
if err := awsAwsjson11_deserializeDocumentListReturnedArnList(&sv.ExclusionArns, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput, 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 *ListFindingsOutput
if *v == nil {
sv = &ListFindingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "findingArns":
if err := awsAwsjson11_deserializeDocumentListReturnedArnList(&sv.FindingArns, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListRulesPackagesOutput(v **ListRulesPackagesOutput, 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 *ListRulesPackagesOutput
if *v == nil {
sv = &ListRulesPackagesOutput{}
} 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 PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "rulesPackageArns":
if err := awsAwsjson11_deserializeDocumentListReturnedArnList(&sv.RulesPackageArns, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPreviewAgentsOutput(v **PreviewAgentsOutput, 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 *PreviewAgentsOutput
if *v == nil {
sv = &PreviewAgentsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "agentPreviews":
if err := awsAwsjson11_deserializeDocumentAgentPreviewList(&sv.AgentPreviews, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRemoveAttributesFromFindingsOutput(v **RemoveAttributesFromFindingsOutput, 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 *RemoveAttributesFromFindingsOutput
if *v == nil {
sv = &RemoveAttributesFromFindingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "failedItems":
if err := awsAwsjson11_deserializeDocumentFailedItems(&sv.FailedItems, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStartAssessmentRunOutput(v **StartAssessmentRunOutput, 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 *StartAssessmentRunOutput
if *v == nil {
sv = &StartAssessmentRunOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentRunArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 9,703 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package inspector provides the API client, operations, and parameter types for
// Amazon Inspector.
//
// Amazon Inspector Amazon Inspector enables you to analyze the behavior of your
// AWS resources and to identify potential security issues. For more information,
// see Amazon Inspector User Guide (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_introduction.html)
// .
package inspector
| 11 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/inspector/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "inspector"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package inspector
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.13.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
"strings"
)
type awsAwsjson11_serializeOpAddAttributesToFindings struct {
}
func (*awsAwsjson11_serializeOpAddAttributesToFindings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddAttributesToFindings) 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.(*AddAttributesToFindingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.AddAttributesToFindings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddAttributesToFindingsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateAssessmentTarget struct {
}
func (*awsAwsjson11_serializeOpCreateAssessmentTarget) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateAssessmentTarget) 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.(*CreateAssessmentTargetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.CreateAssessmentTarget")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateAssessmentTargetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateAssessmentTemplate struct {
}
func (*awsAwsjson11_serializeOpCreateAssessmentTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateAssessmentTemplate) 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.(*CreateAssessmentTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.CreateAssessmentTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateAssessmentTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateExclusionsPreview struct {
}
func (*awsAwsjson11_serializeOpCreateExclusionsPreview) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateExclusionsPreview) 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.(*CreateExclusionsPreviewInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.CreateExclusionsPreview")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateExclusionsPreviewInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateResourceGroup struct {
}
func (*awsAwsjson11_serializeOpCreateResourceGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateResourceGroup) 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.(*CreateResourceGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.CreateResourceGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateResourceGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteAssessmentRun struct {
}
func (*awsAwsjson11_serializeOpDeleteAssessmentRun) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteAssessmentRun) 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.(*DeleteAssessmentRunInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DeleteAssessmentRun")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteAssessmentRunInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteAssessmentTarget struct {
}
func (*awsAwsjson11_serializeOpDeleteAssessmentTarget) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteAssessmentTarget) 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.(*DeleteAssessmentTargetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DeleteAssessmentTarget")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteAssessmentTargetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteAssessmentTemplate struct {
}
func (*awsAwsjson11_serializeOpDeleteAssessmentTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteAssessmentTemplate) 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.(*DeleteAssessmentTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DeleteAssessmentTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteAssessmentTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeAssessmentRuns struct {
}
func (*awsAwsjson11_serializeOpDescribeAssessmentRuns) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeAssessmentRuns) 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.(*DescribeAssessmentRunsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DescribeAssessmentRuns")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeAssessmentRunsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeAssessmentTargets struct {
}
func (*awsAwsjson11_serializeOpDescribeAssessmentTargets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeAssessmentTargets) 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.(*DescribeAssessmentTargetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DescribeAssessmentTargets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeAssessmentTargetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeAssessmentTemplates struct {
}
func (*awsAwsjson11_serializeOpDescribeAssessmentTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeAssessmentTemplates) 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.(*DescribeAssessmentTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DescribeAssessmentTemplates")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeAssessmentTemplatesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeCrossAccountAccessRole struct {
}
func (*awsAwsjson11_serializeOpDescribeCrossAccountAccessRole) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeCrossAccountAccessRole) 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.(*DescribeCrossAccountAccessRoleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DescribeCrossAccountAccessRole")
if request, err = request.SetStream(strings.NewReader(`{}`)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeExclusions struct {
}
func (*awsAwsjson11_serializeOpDescribeExclusions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeExclusions) 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.(*DescribeExclusionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DescribeExclusions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeExclusionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeFindings struct {
}
func (*awsAwsjson11_serializeOpDescribeFindings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeFindings) 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.(*DescribeFindingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DescribeFindings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeFindingsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeResourceGroups struct {
}
func (*awsAwsjson11_serializeOpDescribeResourceGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeResourceGroups) 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.(*DescribeResourceGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DescribeResourceGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeResourceGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeRulesPackages struct {
}
func (*awsAwsjson11_serializeOpDescribeRulesPackages) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeRulesPackages) 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.(*DescribeRulesPackagesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.DescribeRulesPackages")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeRulesPackagesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetAssessmentReport struct {
}
func (*awsAwsjson11_serializeOpGetAssessmentReport) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetAssessmentReport) 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.(*GetAssessmentReportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.GetAssessmentReport")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetAssessmentReportInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetExclusionsPreview struct {
}
func (*awsAwsjson11_serializeOpGetExclusionsPreview) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetExclusionsPreview) 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.(*GetExclusionsPreviewInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.GetExclusionsPreview")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetExclusionsPreviewInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetTelemetryMetadata struct {
}
func (*awsAwsjson11_serializeOpGetTelemetryMetadata) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetTelemetryMetadata) 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.(*GetTelemetryMetadataInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.GetTelemetryMetadata")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetTelemetryMetadataInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListAssessmentRunAgents struct {
}
func (*awsAwsjson11_serializeOpListAssessmentRunAgents) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAssessmentRunAgents) 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.(*ListAssessmentRunAgentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListAssessmentRunAgents")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAssessmentRunAgentsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListAssessmentRuns struct {
}
func (*awsAwsjson11_serializeOpListAssessmentRuns) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAssessmentRuns) 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.(*ListAssessmentRunsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListAssessmentRuns")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAssessmentRunsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListAssessmentTargets struct {
}
func (*awsAwsjson11_serializeOpListAssessmentTargets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAssessmentTargets) 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.(*ListAssessmentTargetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListAssessmentTargets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAssessmentTargetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListAssessmentTemplates struct {
}
func (*awsAwsjson11_serializeOpListAssessmentTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAssessmentTemplates) 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.(*ListAssessmentTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListAssessmentTemplates")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAssessmentTemplatesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListEventSubscriptions struct {
}
func (*awsAwsjson11_serializeOpListEventSubscriptions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListEventSubscriptions) 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.(*ListEventSubscriptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListEventSubscriptions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListEventSubscriptionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListExclusions struct {
}
func (*awsAwsjson11_serializeOpListExclusions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListExclusions) 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.(*ListExclusionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListExclusions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListExclusionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListFindings struct {
}
func (*awsAwsjson11_serializeOpListFindings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_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)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListFindingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListFindings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListFindingsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListRulesPackages struct {
}
func (*awsAwsjson11_serializeOpListRulesPackages) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListRulesPackages) 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.(*ListRulesPackagesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListRulesPackages")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListRulesPackagesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPreviewAgents struct {
}
func (*awsAwsjson11_serializeOpPreviewAgents) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPreviewAgents) 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.(*PreviewAgentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.PreviewAgents")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPreviewAgentsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRegisterCrossAccountAccessRole struct {
}
func (*awsAwsjson11_serializeOpRegisterCrossAccountAccessRole) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRegisterCrossAccountAccessRole) 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.(*RegisterCrossAccountAccessRoleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.RegisterCrossAccountAccessRole")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRegisterCrossAccountAccessRoleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRemoveAttributesFromFindings struct {
}
func (*awsAwsjson11_serializeOpRemoveAttributesFromFindings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRemoveAttributesFromFindings) 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.(*RemoveAttributesFromFindingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.RemoveAttributesFromFindings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRemoveAttributesFromFindingsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSetTagsForResource struct {
}
func (*awsAwsjson11_serializeOpSetTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSetTagsForResource) 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.(*SetTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.SetTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSetTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStartAssessmentRun struct {
}
func (*awsAwsjson11_serializeOpStartAssessmentRun) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartAssessmentRun) 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.(*StartAssessmentRunInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.StartAssessmentRun")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartAssessmentRunInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStopAssessmentRun struct {
}
func (*awsAwsjson11_serializeOpStopAssessmentRun) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopAssessmentRun) 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.(*StopAssessmentRunInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.StopAssessmentRun")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopAssessmentRunInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSubscribeToEvent struct {
}
func (*awsAwsjson11_serializeOpSubscribeToEvent) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSubscribeToEvent) 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.(*SubscribeToEventInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.SubscribeToEvent")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSubscribeToEventInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUnsubscribeFromEvent struct {
}
func (*awsAwsjson11_serializeOpUnsubscribeFromEvent) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUnsubscribeFromEvent) 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.(*UnsubscribeFromEventInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.UnsubscribeFromEvent")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUnsubscribeFromEventInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateAssessmentTarget struct {
}
func (*awsAwsjson11_serializeOpUpdateAssessmentTarget) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateAssessmentTarget) 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.(*UpdateAssessmentTargetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("InspectorService.UpdateAssessmentTarget")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateAssessmentTargetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsAwsjson11_serializeDocumentAddRemoveAttributesFindingArnList(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 awsAwsjson11_serializeDocumentAgentFilter(v *types.AgentFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AgentHealthCodes != nil {
ok := object.Key("agentHealthCodes")
if err := awsAwsjson11_serializeDocumentAgentHealthCodeList(v.AgentHealthCodes, ok); err != nil {
return err
}
}
if v.AgentHealths != nil {
ok := object.Key("agentHealths")
if err := awsAwsjson11_serializeDocumentAgentHealthList(v.AgentHealths, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAgentHealthCodeList(v []types.AgentHealthCode, 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 awsAwsjson11_serializeDocumentAgentHealthList(v []types.AgentHealth, 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 awsAwsjson11_serializeDocumentAgentIdList(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 awsAwsjson11_serializeDocumentAssessmentRunFilter(v *types.AssessmentRunFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CompletionTimeRange != nil {
ok := object.Key("completionTimeRange")
if err := awsAwsjson11_serializeDocumentTimestampRange(v.CompletionTimeRange, ok); err != nil {
return err
}
}
if v.DurationRange != nil {
ok := object.Key("durationRange")
if err := awsAwsjson11_serializeDocumentDurationRange(v.DurationRange, ok); err != nil {
return err
}
}
if v.NamePattern != nil {
ok := object.Key("namePattern")
ok.String(*v.NamePattern)
}
if v.RulesPackageArns != nil {
ok := object.Key("rulesPackageArns")
if err := awsAwsjson11_serializeDocumentFilterRulesPackageArnList(v.RulesPackageArns, ok); err != nil {
return err
}
}
if v.StartTimeRange != nil {
ok := object.Key("startTimeRange")
if err := awsAwsjson11_serializeDocumentTimestampRange(v.StartTimeRange, ok); err != nil {
return err
}
}
if v.StateChangeTimeRange != nil {
ok := object.Key("stateChangeTimeRange")
if err := awsAwsjson11_serializeDocumentTimestampRange(v.StateChangeTimeRange, ok); err != nil {
return err
}
}
if v.States != nil {
ok := object.Key("states")
if err := awsAwsjson11_serializeDocumentAssessmentRunStateList(v.States, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAssessmentRunStateList(v []types.AssessmentRunState, 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 awsAwsjson11_serializeDocumentAssessmentTargetFilter(v *types.AssessmentTargetFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTargetNamePattern != nil {
ok := object.Key("assessmentTargetNamePattern")
ok.String(*v.AssessmentTargetNamePattern)
}
return nil
}
func awsAwsjson11_serializeDocumentAssessmentTemplateFilter(v *types.AssessmentTemplateFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationRange != nil {
ok := object.Key("durationRange")
if err := awsAwsjson11_serializeDocumentDurationRange(v.DurationRange, ok); err != nil {
return err
}
}
if v.NamePattern != nil {
ok := object.Key("namePattern")
ok.String(*v.NamePattern)
}
if v.RulesPackageArns != nil {
ok := object.Key("rulesPackageArns")
if err := awsAwsjson11_serializeDocumentFilterRulesPackageArnList(v.RulesPackageArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAssessmentTemplateRulesPackageArnList(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 awsAwsjson11_serializeDocumentAttribute(v *types.Attribute, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
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 awsAwsjson11_serializeDocumentAttributeList(v []types.Attribute, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentAttribute(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAutoScalingGroupList(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 awsAwsjson11_serializeDocumentBatchDescribeArnList(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 awsAwsjson11_serializeDocumentBatchDescribeExclusionsArnList(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 awsAwsjson11_serializeDocumentDurationRange(v *types.DurationRange, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxSeconds != 0 {
ok := object.Key("maxSeconds")
ok.Integer(v.MaxSeconds)
}
if v.MinSeconds != 0 {
ok := object.Key("minSeconds")
ok.Integer(v.MinSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentFilterRulesPackageArnList(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 awsAwsjson11_serializeDocumentFindingFilter(v *types.FindingFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AgentIds != nil {
ok := object.Key("agentIds")
if err := awsAwsjson11_serializeDocumentAgentIdList(v.AgentIds, ok); err != nil {
return err
}
}
if v.Attributes != nil {
ok := object.Key("attributes")
if err := awsAwsjson11_serializeDocumentAttributeList(v.Attributes, ok); err != nil {
return err
}
}
if v.AutoScalingGroups != nil {
ok := object.Key("autoScalingGroups")
if err := awsAwsjson11_serializeDocumentAutoScalingGroupList(v.AutoScalingGroups, ok); err != nil {
return err
}
}
if v.CreationTimeRange != nil {
ok := object.Key("creationTimeRange")
if err := awsAwsjson11_serializeDocumentTimestampRange(v.CreationTimeRange, ok); err != nil {
return err
}
}
if v.RuleNames != nil {
ok := object.Key("ruleNames")
if err := awsAwsjson11_serializeDocumentRuleNameList(v.RuleNames, ok); err != nil {
return err
}
}
if v.RulesPackageArns != nil {
ok := object.Key("rulesPackageArns")
if err := awsAwsjson11_serializeDocumentFilterRulesPackageArnList(v.RulesPackageArns, ok); err != nil {
return err
}
}
if v.Severities != nil {
ok := object.Key("severities")
if err := awsAwsjson11_serializeDocumentSeverityList(v.Severities, ok); err != nil {
return err
}
}
if v.UserAttributes != nil {
ok := object.Key("userAttributes")
if err := awsAwsjson11_serializeDocumentAttributeList(v.UserAttributes, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentListParentArnList(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 awsAwsjson11_serializeDocumentResourceGroupTag(v *types.ResourceGroupTag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
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 awsAwsjson11_serializeDocumentResourceGroupTags(v []types.ResourceGroupTag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentResourceGroupTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRuleNameList(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 awsAwsjson11_serializeDocumentSeverityList(v []types.Severity, 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 awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
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 awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTimestampRange(v *types.TimestampRange, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BeginDate != nil {
ok := object.Key("beginDate")
ok.Double(smithytime.FormatEpochSeconds(*v.BeginDate))
}
if v.EndDate != nil {
ok := object.Key("endDate")
ok.Double(smithytime.FormatEpochSeconds(*v.EndDate))
}
return nil
}
func awsAwsjson11_serializeDocumentUserAttributeKeyList(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 awsAwsjson11_serializeDocumentUserAttributeList(v []types.Attribute, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentAttribute(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddAttributesToFindingsInput(v *AddAttributesToFindingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Attributes != nil {
ok := object.Key("attributes")
if err := awsAwsjson11_serializeDocumentUserAttributeList(v.Attributes, ok); err != nil {
return err
}
}
if v.FindingArns != nil {
ok := object.Key("findingArns")
if err := awsAwsjson11_serializeDocumentAddRemoveAttributesFindingArnList(v.FindingArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateAssessmentTargetInput(v *CreateAssessmentTargetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTargetName != nil {
ok := object.Key("assessmentTargetName")
ok.String(*v.AssessmentTargetName)
}
if v.ResourceGroupArn != nil {
ok := object.Key("resourceGroupArn")
ok.String(*v.ResourceGroupArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateAssessmentTemplateInput(v *CreateAssessmentTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTargetArn != nil {
ok := object.Key("assessmentTargetArn")
ok.String(*v.AssessmentTargetArn)
}
if v.AssessmentTemplateName != nil {
ok := object.Key("assessmentTemplateName")
ok.String(*v.AssessmentTemplateName)
}
{
ok := object.Key("durationInSeconds")
ok.Integer(v.DurationInSeconds)
}
if v.RulesPackageArns != nil {
ok := object.Key("rulesPackageArns")
if err := awsAwsjson11_serializeDocumentAssessmentTemplateRulesPackageArnList(v.RulesPackageArns, ok); err != nil {
return err
}
}
if v.UserAttributesForFindings != nil {
ok := object.Key("userAttributesForFindings")
if err := awsAwsjson11_serializeDocumentUserAttributeList(v.UserAttributesForFindings, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateExclusionsPreviewInput(v *CreateExclusionsPreviewInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTemplateArn != nil {
ok := object.Key("assessmentTemplateArn")
ok.String(*v.AssessmentTemplateArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateResourceGroupInput(v *CreateResourceGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceGroupTags != nil {
ok := object.Key("resourceGroupTags")
if err := awsAwsjson11_serializeDocumentResourceGroupTags(v.ResourceGroupTags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteAssessmentRunInput(v *DeleteAssessmentRunInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunArn != nil {
ok := object.Key("assessmentRunArn")
ok.String(*v.AssessmentRunArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteAssessmentTargetInput(v *DeleteAssessmentTargetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTargetArn != nil {
ok := object.Key("assessmentTargetArn")
ok.String(*v.AssessmentTargetArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteAssessmentTemplateInput(v *DeleteAssessmentTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTemplateArn != nil {
ok := object.Key("assessmentTemplateArn")
ok.String(*v.AssessmentTemplateArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeAssessmentRunsInput(v *DescribeAssessmentRunsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunArns != nil {
ok := object.Key("assessmentRunArns")
if err := awsAwsjson11_serializeDocumentBatchDescribeArnList(v.AssessmentRunArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeAssessmentTargetsInput(v *DescribeAssessmentTargetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTargetArns != nil {
ok := object.Key("assessmentTargetArns")
if err := awsAwsjson11_serializeDocumentBatchDescribeArnList(v.AssessmentTargetArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeAssessmentTemplatesInput(v *DescribeAssessmentTemplatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTemplateArns != nil {
ok := object.Key("assessmentTemplateArns")
if err := awsAwsjson11_serializeDocumentBatchDescribeArnList(v.AssessmentTemplateArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeExclusionsInput(v *DescribeExclusionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExclusionArns != nil {
ok := object.Key("exclusionArns")
if err := awsAwsjson11_serializeDocumentBatchDescribeExclusionsArnList(v.ExclusionArns, ok); err != nil {
return err
}
}
if len(v.Locale) > 0 {
ok := object.Key("locale")
ok.String(string(v.Locale))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeFindingsInput(v *DescribeFindingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FindingArns != nil {
ok := object.Key("findingArns")
if err := awsAwsjson11_serializeDocumentBatchDescribeArnList(v.FindingArns, ok); err != nil {
return err
}
}
if len(v.Locale) > 0 {
ok := object.Key("locale")
ok.String(string(v.Locale))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeResourceGroupsInput(v *DescribeResourceGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceGroupArns != nil {
ok := object.Key("resourceGroupArns")
if err := awsAwsjson11_serializeDocumentBatchDescribeArnList(v.ResourceGroupArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeRulesPackagesInput(v *DescribeRulesPackagesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Locale) > 0 {
ok := object.Key("locale")
ok.String(string(v.Locale))
}
if v.RulesPackageArns != nil {
ok := object.Key("rulesPackageArns")
if err := awsAwsjson11_serializeDocumentBatchDescribeArnList(v.RulesPackageArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetAssessmentReportInput(v *GetAssessmentReportInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunArn != nil {
ok := object.Key("assessmentRunArn")
ok.String(*v.AssessmentRunArn)
}
if len(v.ReportFileFormat) > 0 {
ok := object.Key("reportFileFormat")
ok.String(string(v.ReportFileFormat))
}
if len(v.ReportType) > 0 {
ok := object.Key("reportType")
ok.String(string(v.ReportType))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetExclusionsPreviewInput(v *GetExclusionsPreviewInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTemplateArn != nil {
ok := object.Key("assessmentTemplateArn")
ok.String(*v.AssessmentTemplateArn)
}
if len(v.Locale) > 0 {
ok := object.Key("locale")
ok.String(string(v.Locale))
}
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.PreviewToken != nil {
ok := object.Key("previewToken")
ok.String(*v.PreviewToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetTelemetryMetadataInput(v *GetTelemetryMetadataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunArn != nil {
ok := object.Key("assessmentRunArn")
ok.String(*v.AssessmentRunArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListAssessmentRunAgentsInput(v *ListAssessmentRunAgentsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunArn != nil {
ok := object.Key("assessmentRunArn")
ok.String(*v.AssessmentRunArn)
}
if v.Filter != nil {
ok := object.Key("filter")
if err := awsAwsjson11_serializeDocumentAgentFilter(v.Filter, 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
}
func awsAwsjson11_serializeOpDocumentListAssessmentRunsInput(v *ListAssessmentRunsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTemplateArns != nil {
ok := object.Key("assessmentTemplateArns")
if err := awsAwsjson11_serializeDocumentListParentArnList(v.AssessmentTemplateArns, ok); err != nil {
return err
}
}
if v.Filter != nil {
ok := object.Key("filter")
if err := awsAwsjson11_serializeDocumentAssessmentRunFilter(v.Filter, 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
}
func awsAwsjson11_serializeOpDocumentListAssessmentTargetsInput(v *ListAssessmentTargetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filter != nil {
ok := object.Key("filter")
if err := awsAwsjson11_serializeDocumentAssessmentTargetFilter(v.Filter, 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
}
func awsAwsjson11_serializeOpDocumentListAssessmentTemplatesInput(v *ListAssessmentTemplatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTargetArns != nil {
ok := object.Key("assessmentTargetArns")
if err := awsAwsjson11_serializeDocumentListParentArnList(v.AssessmentTargetArns, ok); err != nil {
return err
}
}
if v.Filter != nil {
ok := object.Key("filter")
if err := awsAwsjson11_serializeDocumentAssessmentTemplateFilter(v.Filter, 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
}
func awsAwsjson11_serializeOpDocumentListEventSubscriptionsInput(v *ListEventSubscriptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListExclusionsInput(v *ListExclusionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunArn != nil {
ok := object.Key("assessmentRunArn")
ok.String(*v.AssessmentRunArn)
}
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
}
func awsAwsjson11_serializeOpDocumentListFindingsInput(v *ListFindingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunArns != nil {
ok := object.Key("assessmentRunArns")
if err := awsAwsjson11_serializeDocumentListParentArnList(v.AssessmentRunArns, ok); err != nil {
return err
}
}
if v.Filter != nil {
ok := object.Key("filter")
if err := awsAwsjson11_serializeDocumentFindingFilter(v.Filter, 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
}
func awsAwsjson11_serializeOpDocumentListRulesPackagesInput(v *ListRulesPackagesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPreviewAgentsInput(v *PreviewAgentsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.PreviewAgentsArn != nil {
ok := object.Key("previewAgentsArn")
ok.String(*v.PreviewAgentsArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRegisterCrossAccountAccessRoleInput(v *RegisterCrossAccountAccessRoleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRemoveAttributesFromFindingsInput(v *RemoveAttributesFromFindingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AttributeKeys != nil {
ok := object.Key("attributeKeys")
if err := awsAwsjson11_serializeDocumentUserAttributeKeyList(v.AttributeKeys, ok); err != nil {
return err
}
}
if v.FindingArns != nil {
ok := object.Key("findingArns")
if err := awsAwsjson11_serializeDocumentAddRemoveAttributesFindingArnList(v.FindingArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentSetTagsForResourceInput(v *SetTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartAssessmentRunInput(v *StartAssessmentRunInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunName != nil {
ok := object.Key("assessmentRunName")
ok.String(*v.AssessmentRunName)
}
if v.AssessmentTemplateArn != nil {
ok := object.Key("assessmentTemplateArn")
ok.String(*v.AssessmentTemplateArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopAssessmentRunInput(v *StopAssessmentRunInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentRunArn != nil {
ok := object.Key("assessmentRunArn")
ok.String(*v.AssessmentRunArn)
}
if len(v.StopAction) > 0 {
ok := object.Key("stopAction")
ok.String(string(v.StopAction))
}
return nil
}
func awsAwsjson11_serializeOpDocumentSubscribeToEventInput(v *SubscribeToEventInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Event) > 0 {
ok := object.Key("event")
ok.String(string(v.Event))
}
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
if v.TopicArn != nil {
ok := object.Key("topicArn")
ok.String(*v.TopicArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUnsubscribeFromEventInput(v *UnsubscribeFromEventInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Event) > 0 {
ok := object.Key("event")
ok.String(string(v.Event))
}
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
if v.TopicArn != nil {
ok := object.Key("topicArn")
ok.String(*v.TopicArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateAssessmentTargetInput(v *UpdateAssessmentTargetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentTargetArn != nil {
ok := object.Key("assessmentTargetArn")
ok.String(*v.AssessmentTargetArn)
}
if v.AssessmentTargetName != nil {
ok := object.Key("assessmentTargetName")
ok.String(*v.AssessmentTargetName)
}
if v.ResourceGroupArn != nil {
ok := object.Key("resourceGroupArn")
ok.String(*v.ResourceGroupArn)
}
return nil
}
| 3,223 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/inspector/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAddAttributesToFindings struct {
}
func (*validateOpAddAttributesToFindings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddAttributesToFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddAttributesToFindingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddAttributesToFindingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAssessmentTarget struct {
}
func (*validateOpCreateAssessmentTarget) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAssessmentTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAssessmentTargetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAssessmentTargetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAssessmentTemplate struct {
}
func (*validateOpCreateAssessmentTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAssessmentTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAssessmentTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAssessmentTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateExclusionsPreview struct {
}
func (*validateOpCreateExclusionsPreview) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateExclusionsPreview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateExclusionsPreviewInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateExclusionsPreviewInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateResourceGroup struct {
}
func (*validateOpCreateResourceGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateResourceGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateResourceGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateResourceGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAssessmentRun struct {
}
func (*validateOpDeleteAssessmentRun) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAssessmentRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAssessmentRunInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAssessmentRunInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAssessmentTarget struct {
}
func (*validateOpDeleteAssessmentTarget) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAssessmentTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAssessmentTargetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAssessmentTargetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAssessmentTemplate struct {
}
func (*validateOpDeleteAssessmentTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAssessmentTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAssessmentTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAssessmentTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAssessmentRuns struct {
}
func (*validateOpDescribeAssessmentRuns) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAssessmentRuns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAssessmentRunsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAssessmentRunsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAssessmentTargets struct {
}
func (*validateOpDescribeAssessmentTargets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAssessmentTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAssessmentTargetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAssessmentTargetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAssessmentTemplates struct {
}
func (*validateOpDescribeAssessmentTemplates) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAssessmentTemplates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAssessmentTemplatesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAssessmentTemplatesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeExclusions struct {
}
func (*validateOpDescribeExclusions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeExclusions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeExclusionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeExclusionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeFindings struct {
}
func (*validateOpDescribeFindings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeFindingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeFindingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeResourceGroups struct {
}
func (*validateOpDescribeResourceGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeResourceGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeResourceGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeResourceGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeRulesPackages struct {
}
func (*validateOpDescribeRulesPackages) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeRulesPackages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeRulesPackagesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeRulesPackagesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAssessmentReport struct {
}
func (*validateOpGetAssessmentReport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAssessmentReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAssessmentReportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAssessmentReportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetExclusionsPreview struct {
}
func (*validateOpGetExclusionsPreview) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetExclusionsPreview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetExclusionsPreviewInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetExclusionsPreviewInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetTelemetryMetadata struct {
}
func (*validateOpGetTelemetryMetadata) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetTelemetryMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetTelemetryMetadataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetTelemetryMetadataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAssessmentRunAgents struct {
}
func (*validateOpListAssessmentRunAgents) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAssessmentRunAgents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAssessmentRunAgentsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAssessmentRunAgentsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListExclusions struct {
}
func (*validateOpListExclusions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListExclusions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListExclusionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListExclusionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListFindings struct {
}
func (*validateOpListFindings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListFindingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListFindingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForResource struct {
}
func (*validateOpListTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPreviewAgents struct {
}
func (*validateOpPreviewAgents) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPreviewAgents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PreviewAgentsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPreviewAgentsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRegisterCrossAccountAccessRole struct {
}
func (*validateOpRegisterCrossAccountAccessRole) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRegisterCrossAccountAccessRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RegisterCrossAccountAccessRoleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRegisterCrossAccountAccessRoleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveAttributesFromFindings struct {
}
func (*validateOpRemoveAttributesFromFindings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveAttributesFromFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveAttributesFromFindingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveAttributesFromFindingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSetTagsForResource struct {
}
func (*validateOpSetTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSetTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SetTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSetTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartAssessmentRun struct {
}
func (*validateOpStartAssessmentRun) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartAssessmentRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartAssessmentRunInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartAssessmentRunInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopAssessmentRun struct {
}
func (*validateOpStopAssessmentRun) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopAssessmentRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopAssessmentRunInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopAssessmentRunInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSubscribeToEvent struct {
}
func (*validateOpSubscribeToEvent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSubscribeToEvent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SubscribeToEventInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSubscribeToEventInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUnsubscribeFromEvent struct {
}
func (*validateOpUnsubscribeFromEvent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUnsubscribeFromEvent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UnsubscribeFromEventInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUnsubscribeFromEventInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateAssessmentTarget struct {
}
func (*validateOpUpdateAssessmentTarget) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAssessmentTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAssessmentTargetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAssessmentTargetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAddAttributesToFindingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddAttributesToFindings{}, middleware.After)
}
func addOpCreateAssessmentTargetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAssessmentTarget{}, middleware.After)
}
func addOpCreateAssessmentTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAssessmentTemplate{}, middleware.After)
}
func addOpCreateExclusionsPreviewValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateExclusionsPreview{}, middleware.After)
}
func addOpCreateResourceGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateResourceGroup{}, middleware.After)
}
func addOpDeleteAssessmentRunValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAssessmentRun{}, middleware.After)
}
func addOpDeleteAssessmentTargetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAssessmentTarget{}, middleware.After)
}
func addOpDeleteAssessmentTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAssessmentTemplate{}, middleware.After)
}
func addOpDescribeAssessmentRunsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAssessmentRuns{}, middleware.After)
}
func addOpDescribeAssessmentTargetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAssessmentTargets{}, middleware.After)
}
func addOpDescribeAssessmentTemplatesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAssessmentTemplates{}, middleware.After)
}
func addOpDescribeExclusionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeExclusions{}, middleware.After)
}
func addOpDescribeFindingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeFindings{}, middleware.After)
}
func addOpDescribeResourceGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeResourceGroups{}, middleware.After)
}
func addOpDescribeRulesPackagesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeRulesPackages{}, middleware.After)
}
func addOpGetAssessmentReportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAssessmentReport{}, middleware.After)
}
func addOpGetExclusionsPreviewValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetExclusionsPreview{}, middleware.After)
}
func addOpGetTelemetryMetadataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetTelemetryMetadata{}, middleware.After)
}
func addOpListAssessmentRunAgentsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAssessmentRunAgents{}, middleware.After)
}
func addOpListExclusionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListExclusions{}, middleware.After)
}
func addOpListFindingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListFindings{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpPreviewAgentsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPreviewAgents{}, middleware.After)
}
func addOpRegisterCrossAccountAccessRoleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRegisterCrossAccountAccessRole{}, middleware.After)
}
func addOpRemoveAttributesFromFindingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveAttributesFromFindings{}, middleware.After)
}
func addOpSetTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSetTagsForResource{}, middleware.After)
}
func addOpStartAssessmentRunValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartAssessmentRun{}, middleware.After)
}
func addOpStopAssessmentRunValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopAssessmentRun{}, middleware.After)
}
func addOpSubscribeToEventValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSubscribeToEvent{}, middleware.After)
}
func addOpUnsubscribeFromEventValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUnsubscribeFromEvent{}, middleware.After)
}
func addOpUpdateAssessmentTargetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAssessmentTarget{}, middleware.After)
}
func validateAgentFilter(v *types.AgentFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AgentFilter"}
if v.AgentHealths == nil {
invalidParams.Add(smithy.NewErrParamRequired("AgentHealths"))
}
if v.AgentHealthCodes == nil {
invalidParams.Add(smithy.NewErrParamRequired("AgentHealthCodes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAttribute(v *types.Attribute) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Attribute"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAttributeList(v []types.Attribute) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AttributeList"}
for i := range v {
if err := validateAttribute(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFindingFilter(v *types.FindingFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FindingFilter"}
if v.Attributes != nil {
if err := validateAttributeList(v.Attributes); err != nil {
invalidParams.AddNested("Attributes", err.(smithy.InvalidParamsError))
}
}
if v.UserAttributes != nil {
if err := validateAttributeList(v.UserAttributes); err != nil {
invalidParams.AddNested("UserAttributes", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResourceGroupTag(v *types.ResourceGroupTag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResourceGroupTag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResourceGroupTags(v []types.ResourceGroupTag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResourceGroupTags"}
for i := range v {
if err := validateResourceGroupTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagList(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagList"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUserAttributeList(v []types.Attribute) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UserAttributeList"}
for i := range v {
if err := validateAttribute(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddAttributesToFindingsInput(v *AddAttributesToFindingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddAttributesToFindingsInput"}
if v.FindingArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("FindingArns"))
}
if v.Attributes == nil {
invalidParams.Add(smithy.NewErrParamRequired("Attributes"))
} else if v.Attributes != nil {
if err := validateUserAttributeList(v.Attributes); err != nil {
invalidParams.AddNested("Attributes", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAssessmentTargetInput(v *CreateAssessmentTargetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAssessmentTargetInput"}
if v.AssessmentTargetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTargetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAssessmentTemplateInput(v *CreateAssessmentTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAssessmentTemplateInput"}
if v.AssessmentTargetArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTargetArn"))
}
if v.AssessmentTemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTemplateName"))
}
if v.RulesPackageArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("RulesPackageArns"))
}
if v.UserAttributesForFindings != nil {
if err := validateUserAttributeList(v.UserAttributesForFindings); err != nil {
invalidParams.AddNested("UserAttributesForFindings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateExclusionsPreviewInput(v *CreateExclusionsPreviewInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExclusionsPreviewInput"}
if v.AssessmentTemplateArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTemplateArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateResourceGroupInput(v *CreateResourceGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateResourceGroupInput"}
if v.ResourceGroupTags == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceGroupTags"))
} else if v.ResourceGroupTags != nil {
if err := validateResourceGroupTags(v.ResourceGroupTags); err != nil {
invalidParams.AddNested("ResourceGroupTags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAssessmentRunInput(v *DeleteAssessmentRunInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAssessmentRunInput"}
if v.AssessmentRunArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentRunArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAssessmentTargetInput(v *DeleteAssessmentTargetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAssessmentTargetInput"}
if v.AssessmentTargetArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTargetArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAssessmentTemplateInput(v *DeleteAssessmentTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAssessmentTemplateInput"}
if v.AssessmentTemplateArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTemplateArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAssessmentRunsInput(v *DescribeAssessmentRunsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAssessmentRunsInput"}
if v.AssessmentRunArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentRunArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAssessmentTargetsInput(v *DescribeAssessmentTargetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAssessmentTargetsInput"}
if v.AssessmentTargetArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTargetArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAssessmentTemplatesInput(v *DescribeAssessmentTemplatesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAssessmentTemplatesInput"}
if v.AssessmentTemplateArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTemplateArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeExclusionsInput(v *DescribeExclusionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeExclusionsInput"}
if v.ExclusionArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExclusionArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeFindingsInput(v *DescribeFindingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeFindingsInput"}
if v.FindingArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("FindingArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeResourceGroupsInput(v *DescribeResourceGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeResourceGroupsInput"}
if v.ResourceGroupArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceGroupArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeRulesPackagesInput(v *DescribeRulesPackagesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeRulesPackagesInput"}
if v.RulesPackageArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("RulesPackageArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAssessmentReportInput(v *GetAssessmentReportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAssessmentReportInput"}
if v.AssessmentRunArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentRunArn"))
}
if len(v.ReportFileFormat) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ReportFileFormat"))
}
if len(v.ReportType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ReportType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetExclusionsPreviewInput(v *GetExclusionsPreviewInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetExclusionsPreviewInput"}
if v.AssessmentTemplateArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTemplateArn"))
}
if v.PreviewToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("PreviewToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetTelemetryMetadataInput(v *GetTelemetryMetadataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetTelemetryMetadataInput"}
if v.AssessmentRunArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentRunArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAssessmentRunAgentsInput(v *ListAssessmentRunAgentsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAssessmentRunAgentsInput"}
if v.AssessmentRunArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentRunArn"))
}
if v.Filter != nil {
if err := validateAgentFilter(v.Filter); err != nil {
invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListExclusionsInput(v *ListExclusionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListExclusionsInput"}
if v.AssessmentRunArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentRunArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListFindingsInput(v *ListFindingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListFindingsInput"}
if v.Filter != nil {
if err := validateFindingFilter(v.Filter); err != nil {
invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPreviewAgentsInput(v *PreviewAgentsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PreviewAgentsInput"}
if v.PreviewAgentsArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("PreviewAgentsArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRegisterCrossAccountAccessRoleInput(v *RegisterCrossAccountAccessRoleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegisterCrossAccountAccessRoleInput"}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveAttributesFromFindingsInput(v *RemoveAttributesFromFindingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveAttributesFromFindingsInput"}
if v.FindingArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("FindingArns"))
}
if v.AttributeKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("AttributeKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSetTagsForResourceInput(v *SetTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SetTagsForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartAssessmentRunInput(v *StartAssessmentRunInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartAssessmentRunInput"}
if v.AssessmentTemplateArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTemplateArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopAssessmentRunInput(v *StopAssessmentRunInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopAssessmentRunInput"}
if v.AssessmentRunArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentRunArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSubscribeToEventInput(v *SubscribeToEventInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SubscribeToEventInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if len(v.Event) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Event"))
}
if v.TopicArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUnsubscribeFromEventInput(v *UnsubscribeFromEventInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UnsubscribeFromEventInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if len(v.Event) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Event"))
}
if v.TopicArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAssessmentTargetInput(v *UpdateAssessmentTargetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAssessmentTargetInput"}
if v.AssessmentTargetArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTargetArn"))
}
if v.AssessmentTargetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentTargetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,435 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver Inspector endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "inspector.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "inspector-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "inspector.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "inspector-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "inspector-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Hostname: "inspector-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "inspector-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "inspector.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "inspector-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "inspector.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "inspector.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "inspector.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "inspector.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "inspector.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "inspector.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "inspector-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "inspector.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "inspector-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "inspector-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "inspector-fips.us-gov-west-1.amazonaws.com",
},
},
},
}
| 433 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type AccessDeniedErrorCode string
// Enum values for AccessDeniedErrorCode
const (
AccessDeniedErrorCodeAccessDeniedToAssessmentTarget AccessDeniedErrorCode = "ACCESS_DENIED_TO_ASSESSMENT_TARGET"
AccessDeniedErrorCodeAccessDeniedToAssessmentTemplate AccessDeniedErrorCode = "ACCESS_DENIED_TO_ASSESSMENT_TEMPLATE"
AccessDeniedErrorCodeAccessDeniedToAssessmentRun AccessDeniedErrorCode = "ACCESS_DENIED_TO_ASSESSMENT_RUN"
AccessDeniedErrorCodeAccessDeniedToFinding AccessDeniedErrorCode = "ACCESS_DENIED_TO_FINDING"
AccessDeniedErrorCodeAccessDeniedToResourceGroup AccessDeniedErrorCode = "ACCESS_DENIED_TO_RESOURCE_GROUP"
AccessDeniedErrorCodeAccessDeniedToRulesPackage AccessDeniedErrorCode = "ACCESS_DENIED_TO_RULES_PACKAGE"
AccessDeniedErrorCodeAccessDeniedToSnsTopic AccessDeniedErrorCode = "ACCESS_DENIED_TO_SNS_TOPIC"
AccessDeniedErrorCodeAccessDeniedToIamRole AccessDeniedErrorCode = "ACCESS_DENIED_TO_IAM_ROLE"
)
// Values returns all known values for AccessDeniedErrorCode. 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 (AccessDeniedErrorCode) Values() []AccessDeniedErrorCode {
return []AccessDeniedErrorCode{
"ACCESS_DENIED_TO_ASSESSMENT_TARGET",
"ACCESS_DENIED_TO_ASSESSMENT_TEMPLATE",
"ACCESS_DENIED_TO_ASSESSMENT_RUN",
"ACCESS_DENIED_TO_FINDING",
"ACCESS_DENIED_TO_RESOURCE_GROUP",
"ACCESS_DENIED_TO_RULES_PACKAGE",
"ACCESS_DENIED_TO_SNS_TOPIC",
"ACCESS_DENIED_TO_IAM_ROLE",
}
}
type AgentHealth string
// Enum values for AgentHealth
const (
AgentHealthHealthy AgentHealth = "HEALTHY"
AgentHealthUnhealthy AgentHealth = "UNHEALTHY"
AgentHealthUnknown AgentHealth = "UNKNOWN"
)
// Values returns all known values for AgentHealth. 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 (AgentHealth) Values() []AgentHealth {
return []AgentHealth{
"HEALTHY",
"UNHEALTHY",
"UNKNOWN",
}
}
type AgentHealthCode string
// Enum values for AgentHealthCode
const (
AgentHealthCodeIdle AgentHealthCode = "IDLE"
AgentHealthCodeRunning AgentHealthCode = "RUNNING"
AgentHealthCodeShutdown AgentHealthCode = "SHUTDOWN"
AgentHealthCodeUnhealthy AgentHealthCode = "UNHEALTHY"
AgentHealthCodeThrottled AgentHealthCode = "THROTTLED"
AgentHealthCodeUnknown AgentHealthCode = "UNKNOWN"
)
// Values returns all known values for AgentHealthCode. 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 (AgentHealthCode) Values() []AgentHealthCode {
return []AgentHealthCode{
"IDLE",
"RUNNING",
"SHUTDOWN",
"UNHEALTHY",
"THROTTLED",
"UNKNOWN",
}
}
type AssessmentRunNotificationSnsStatusCode string
// Enum values for AssessmentRunNotificationSnsStatusCode
const (
AssessmentRunNotificationSnsStatusCodeSuccess AssessmentRunNotificationSnsStatusCode = "SUCCESS"
AssessmentRunNotificationSnsStatusCodeTopicDoesNotExist AssessmentRunNotificationSnsStatusCode = "TOPIC_DOES_NOT_EXIST"
AssessmentRunNotificationSnsStatusCodeAccessDenied AssessmentRunNotificationSnsStatusCode = "ACCESS_DENIED"
AssessmentRunNotificationSnsStatusCodeInternalError AssessmentRunNotificationSnsStatusCode = "INTERNAL_ERROR"
)
// Values returns all known values for AssessmentRunNotificationSnsStatusCode.
// 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 (AssessmentRunNotificationSnsStatusCode) Values() []AssessmentRunNotificationSnsStatusCode {
return []AssessmentRunNotificationSnsStatusCode{
"SUCCESS",
"TOPIC_DOES_NOT_EXIST",
"ACCESS_DENIED",
"INTERNAL_ERROR",
}
}
type AssessmentRunState string
// Enum values for AssessmentRunState
const (
AssessmentRunStateCreated AssessmentRunState = "CREATED"
AssessmentRunStateStartDataCollectionPending AssessmentRunState = "START_DATA_COLLECTION_PENDING"
AssessmentRunStateStartDataCollectionInProgress AssessmentRunState = "START_DATA_COLLECTION_IN_PROGRESS"
AssessmentRunStateCollectingData AssessmentRunState = "COLLECTING_DATA"
AssessmentRunStateStopDataCollectionPending AssessmentRunState = "STOP_DATA_COLLECTION_PENDING"
AssessmentRunStateDataCollected AssessmentRunState = "DATA_COLLECTED"
AssessmentRunStateStartEvaluatingRulesPending AssessmentRunState = "START_EVALUATING_RULES_PENDING"
AssessmentRunStateEvaluatingRules AssessmentRunState = "EVALUATING_RULES"
AssessmentRunStateFailed AssessmentRunState = "FAILED"
AssessmentRunStateError AssessmentRunState = "ERROR"
AssessmentRunStateCompleted AssessmentRunState = "COMPLETED"
AssessmentRunStateCompletedWithErrors AssessmentRunState = "COMPLETED_WITH_ERRORS"
AssessmentRunStateCanceled AssessmentRunState = "CANCELED"
)
// Values returns all known values for AssessmentRunState. 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 (AssessmentRunState) Values() []AssessmentRunState {
return []AssessmentRunState{
"CREATED",
"START_DATA_COLLECTION_PENDING",
"START_DATA_COLLECTION_IN_PROGRESS",
"COLLECTING_DATA",
"STOP_DATA_COLLECTION_PENDING",
"DATA_COLLECTED",
"START_EVALUATING_RULES_PENDING",
"EVALUATING_RULES",
"FAILED",
"ERROR",
"COMPLETED",
"COMPLETED_WITH_ERRORS",
"CANCELED",
}
}
type AssetType string
// Enum values for AssetType
const (
AssetTypeEc2Instance AssetType = "ec2-instance"
)
// Values returns all known values for AssetType. 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 (AssetType) Values() []AssetType {
return []AssetType{
"ec2-instance",
}
}
type FailedItemErrorCode string
// Enum values for FailedItemErrorCode
const (
FailedItemErrorCodeInvalidArn FailedItemErrorCode = "INVALID_ARN"
FailedItemErrorCodeDuplicateArn FailedItemErrorCode = "DUPLICATE_ARN"
FailedItemErrorCodeItemDoesNotExist FailedItemErrorCode = "ITEM_DOES_NOT_EXIST"
FailedItemErrorCodeAccessDenied FailedItemErrorCode = "ACCESS_DENIED"
FailedItemErrorCodeLimitExceeded FailedItemErrorCode = "LIMIT_EXCEEDED"
FailedItemErrorCodeInternalError FailedItemErrorCode = "INTERNAL_ERROR"
)
// Values returns all known values for FailedItemErrorCode. 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 (FailedItemErrorCode) Values() []FailedItemErrorCode {
return []FailedItemErrorCode{
"INVALID_ARN",
"DUPLICATE_ARN",
"ITEM_DOES_NOT_EXIST",
"ACCESS_DENIED",
"LIMIT_EXCEEDED",
"INTERNAL_ERROR",
}
}
type InspectorEvent string
// Enum values for InspectorEvent
const (
InspectorEventAssessmentRunStarted InspectorEvent = "ASSESSMENT_RUN_STARTED"
InspectorEventAssessmentRunCompleted InspectorEvent = "ASSESSMENT_RUN_COMPLETED"
InspectorEventAssessmentRunStateChanged InspectorEvent = "ASSESSMENT_RUN_STATE_CHANGED"
InspectorEventFindingReported InspectorEvent = "FINDING_REPORTED"
InspectorEventOther InspectorEvent = "OTHER"
)
// Values returns all known values for InspectorEvent. 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 (InspectorEvent) Values() []InspectorEvent {
return []InspectorEvent{
"ASSESSMENT_RUN_STARTED",
"ASSESSMENT_RUN_COMPLETED",
"ASSESSMENT_RUN_STATE_CHANGED",
"FINDING_REPORTED",
"OTHER",
}
}
type InvalidCrossAccountRoleErrorCode string
// Enum values for InvalidCrossAccountRoleErrorCode
const (
InvalidCrossAccountRoleErrorCodeRoleDoesNotExistOrInvalidTrustRelationship InvalidCrossAccountRoleErrorCode = "ROLE_DOES_NOT_EXIST_OR_INVALID_TRUST_RELATIONSHIP"
InvalidCrossAccountRoleErrorCodeRoleDoesNotHaveCorrectPolicy InvalidCrossAccountRoleErrorCode = "ROLE_DOES_NOT_HAVE_CORRECT_POLICY"
)
// Values returns all known values for InvalidCrossAccountRoleErrorCode. 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 (InvalidCrossAccountRoleErrorCode) Values() []InvalidCrossAccountRoleErrorCode {
return []InvalidCrossAccountRoleErrorCode{
"ROLE_DOES_NOT_EXIST_OR_INVALID_TRUST_RELATIONSHIP",
"ROLE_DOES_NOT_HAVE_CORRECT_POLICY",
}
}
type InvalidInputErrorCode string
// Enum values for InvalidInputErrorCode
const (
InvalidInputErrorCodeInvalidAssessmentTargetArn InvalidInputErrorCode = "INVALID_ASSESSMENT_TARGET_ARN"
InvalidInputErrorCodeInvalidAssessmentTemplateArn InvalidInputErrorCode = "INVALID_ASSESSMENT_TEMPLATE_ARN"
InvalidInputErrorCodeInvalidAssessmentRunArn InvalidInputErrorCode = "INVALID_ASSESSMENT_RUN_ARN"
InvalidInputErrorCodeInvalidFindingArn InvalidInputErrorCode = "INVALID_FINDING_ARN"
InvalidInputErrorCodeInvalidResourceGroupArn InvalidInputErrorCode = "INVALID_RESOURCE_GROUP_ARN"
InvalidInputErrorCodeInvalidRulesPackageArn InvalidInputErrorCode = "INVALID_RULES_PACKAGE_ARN"
InvalidInputErrorCodeInvalidResourceArn InvalidInputErrorCode = "INVALID_RESOURCE_ARN"
InvalidInputErrorCodeInvalidSnsTopicArn InvalidInputErrorCode = "INVALID_SNS_TOPIC_ARN"
InvalidInputErrorCodeInvalidIamRoleArn InvalidInputErrorCode = "INVALID_IAM_ROLE_ARN"
InvalidInputErrorCodeInvalidAssessmentTargetName InvalidInputErrorCode = "INVALID_ASSESSMENT_TARGET_NAME"
InvalidInputErrorCodeInvalidAssessmentTargetNamePattern InvalidInputErrorCode = "INVALID_ASSESSMENT_TARGET_NAME_PATTERN"
InvalidInputErrorCodeInvalidAssessmentTemplateName InvalidInputErrorCode = "INVALID_ASSESSMENT_TEMPLATE_NAME"
InvalidInputErrorCodeInvalidAssessmentTemplateNamePattern InvalidInputErrorCode = "INVALID_ASSESSMENT_TEMPLATE_NAME_PATTERN"
InvalidInputErrorCodeInvalidAssessmentTemplateDuration InvalidInputErrorCode = "INVALID_ASSESSMENT_TEMPLATE_DURATION"
InvalidInputErrorCodeInvalidAssessmentTemplateDurationRange InvalidInputErrorCode = "INVALID_ASSESSMENT_TEMPLATE_DURATION_RANGE"
InvalidInputErrorCodeInvalidAssessmentRunDurationRange InvalidInputErrorCode = "INVALID_ASSESSMENT_RUN_DURATION_RANGE"
InvalidInputErrorCodeInvalidAssessmentRunStartTimeRange InvalidInputErrorCode = "INVALID_ASSESSMENT_RUN_START_TIME_RANGE"
InvalidInputErrorCodeInvalidAssessmentRunCompletionTimeRange InvalidInputErrorCode = "INVALID_ASSESSMENT_RUN_COMPLETION_TIME_RANGE"
InvalidInputErrorCodeInvalidAssessmentRunStateChangeTimeRange InvalidInputErrorCode = "INVALID_ASSESSMENT_RUN_STATE_CHANGE_TIME_RANGE"
InvalidInputErrorCodeInvalidAssessmentRunState InvalidInputErrorCode = "INVALID_ASSESSMENT_RUN_STATE"
InvalidInputErrorCodeInvalidTag InvalidInputErrorCode = "INVALID_TAG"
InvalidInputErrorCodeInvalidTagKey InvalidInputErrorCode = "INVALID_TAG_KEY"
InvalidInputErrorCodeInvalidTagValue InvalidInputErrorCode = "INVALID_TAG_VALUE"
InvalidInputErrorCodeInvalidResourceGroupTagKey InvalidInputErrorCode = "INVALID_RESOURCE_GROUP_TAG_KEY"
InvalidInputErrorCodeInvalidResourceGroupTagValue InvalidInputErrorCode = "INVALID_RESOURCE_GROUP_TAG_VALUE"
InvalidInputErrorCodeInvalidAttribute InvalidInputErrorCode = "INVALID_ATTRIBUTE"
InvalidInputErrorCodeInvalidUserAttribute InvalidInputErrorCode = "INVALID_USER_ATTRIBUTE"
InvalidInputErrorCodeInvalidUserAttributeKey InvalidInputErrorCode = "INVALID_USER_ATTRIBUTE_KEY"
InvalidInputErrorCodeInvalidUserAttributeValue InvalidInputErrorCode = "INVALID_USER_ATTRIBUTE_VALUE"
InvalidInputErrorCodeInvalidPaginationToken InvalidInputErrorCode = "INVALID_PAGINATION_TOKEN"
InvalidInputErrorCodeInvalidMaxResults InvalidInputErrorCode = "INVALID_MAX_RESULTS"
InvalidInputErrorCodeInvalidAgentId InvalidInputErrorCode = "INVALID_AGENT_ID"
InvalidInputErrorCodeInvalidAutoScalingGroup InvalidInputErrorCode = "INVALID_AUTO_SCALING_GROUP"
InvalidInputErrorCodeInvalidRuleName InvalidInputErrorCode = "INVALID_RULE_NAME"
InvalidInputErrorCodeInvalidSeverity InvalidInputErrorCode = "INVALID_SEVERITY"
InvalidInputErrorCodeInvalidLocale InvalidInputErrorCode = "INVALID_LOCALE"
InvalidInputErrorCodeInvalidEvent InvalidInputErrorCode = "INVALID_EVENT"
InvalidInputErrorCodeAssessmentTargetNameAlreadyTaken InvalidInputErrorCode = "ASSESSMENT_TARGET_NAME_ALREADY_TAKEN"
InvalidInputErrorCodeAssessmentTemplateNameAlreadyTaken InvalidInputErrorCode = "ASSESSMENT_TEMPLATE_NAME_ALREADY_TAKEN"
InvalidInputErrorCodeInvalidNumberOfAssessmentTargetArns InvalidInputErrorCode = "INVALID_NUMBER_OF_ASSESSMENT_TARGET_ARNS"
InvalidInputErrorCodeInvalidNumberOfAssessmentTemplateArns InvalidInputErrorCode = "INVALID_NUMBER_OF_ASSESSMENT_TEMPLATE_ARNS"
InvalidInputErrorCodeInvalidNumberOfAssessmentRunArns InvalidInputErrorCode = "INVALID_NUMBER_OF_ASSESSMENT_RUN_ARNS"
InvalidInputErrorCodeInvalidNumberOfFindingArns InvalidInputErrorCode = "INVALID_NUMBER_OF_FINDING_ARNS"
InvalidInputErrorCodeInvalidNumberOfResourceGroupArns InvalidInputErrorCode = "INVALID_NUMBER_OF_RESOURCE_GROUP_ARNS"
InvalidInputErrorCodeInvalidNumberOfRulesPackageArns InvalidInputErrorCode = "INVALID_NUMBER_OF_RULES_PACKAGE_ARNS"
InvalidInputErrorCodeInvalidNumberOfAssessmentRunStates InvalidInputErrorCode = "INVALID_NUMBER_OF_ASSESSMENT_RUN_STATES"
InvalidInputErrorCodeInvalidNumberOfTags InvalidInputErrorCode = "INVALID_NUMBER_OF_TAGS"
InvalidInputErrorCodeInvalidNumberOfResourceGroupTags InvalidInputErrorCode = "INVALID_NUMBER_OF_RESOURCE_GROUP_TAGS"
InvalidInputErrorCodeInvalidNumberOfAttributes InvalidInputErrorCode = "INVALID_NUMBER_OF_ATTRIBUTES"
InvalidInputErrorCodeInvalidNumberOfUserAttributes InvalidInputErrorCode = "INVALID_NUMBER_OF_USER_ATTRIBUTES"
InvalidInputErrorCodeInvalidNumberOfAgentIds InvalidInputErrorCode = "INVALID_NUMBER_OF_AGENT_IDS"
InvalidInputErrorCodeInvalidNumberOfAutoScalingGroups InvalidInputErrorCode = "INVALID_NUMBER_OF_AUTO_SCALING_GROUPS"
InvalidInputErrorCodeInvalidNumberOfRuleNames InvalidInputErrorCode = "INVALID_NUMBER_OF_RULE_NAMES"
InvalidInputErrorCodeInvalidNumberOfSeverities InvalidInputErrorCode = "INVALID_NUMBER_OF_SEVERITIES"
)
// Values returns all known values for InvalidInputErrorCode. 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 (InvalidInputErrorCode) Values() []InvalidInputErrorCode {
return []InvalidInputErrorCode{
"INVALID_ASSESSMENT_TARGET_ARN",
"INVALID_ASSESSMENT_TEMPLATE_ARN",
"INVALID_ASSESSMENT_RUN_ARN",
"INVALID_FINDING_ARN",
"INVALID_RESOURCE_GROUP_ARN",
"INVALID_RULES_PACKAGE_ARN",
"INVALID_RESOURCE_ARN",
"INVALID_SNS_TOPIC_ARN",
"INVALID_IAM_ROLE_ARN",
"INVALID_ASSESSMENT_TARGET_NAME",
"INVALID_ASSESSMENT_TARGET_NAME_PATTERN",
"INVALID_ASSESSMENT_TEMPLATE_NAME",
"INVALID_ASSESSMENT_TEMPLATE_NAME_PATTERN",
"INVALID_ASSESSMENT_TEMPLATE_DURATION",
"INVALID_ASSESSMENT_TEMPLATE_DURATION_RANGE",
"INVALID_ASSESSMENT_RUN_DURATION_RANGE",
"INVALID_ASSESSMENT_RUN_START_TIME_RANGE",
"INVALID_ASSESSMENT_RUN_COMPLETION_TIME_RANGE",
"INVALID_ASSESSMENT_RUN_STATE_CHANGE_TIME_RANGE",
"INVALID_ASSESSMENT_RUN_STATE",
"INVALID_TAG",
"INVALID_TAG_KEY",
"INVALID_TAG_VALUE",
"INVALID_RESOURCE_GROUP_TAG_KEY",
"INVALID_RESOURCE_GROUP_TAG_VALUE",
"INVALID_ATTRIBUTE",
"INVALID_USER_ATTRIBUTE",
"INVALID_USER_ATTRIBUTE_KEY",
"INVALID_USER_ATTRIBUTE_VALUE",
"INVALID_PAGINATION_TOKEN",
"INVALID_MAX_RESULTS",
"INVALID_AGENT_ID",
"INVALID_AUTO_SCALING_GROUP",
"INVALID_RULE_NAME",
"INVALID_SEVERITY",
"INVALID_LOCALE",
"INVALID_EVENT",
"ASSESSMENT_TARGET_NAME_ALREADY_TAKEN",
"ASSESSMENT_TEMPLATE_NAME_ALREADY_TAKEN",
"INVALID_NUMBER_OF_ASSESSMENT_TARGET_ARNS",
"INVALID_NUMBER_OF_ASSESSMENT_TEMPLATE_ARNS",
"INVALID_NUMBER_OF_ASSESSMENT_RUN_ARNS",
"INVALID_NUMBER_OF_FINDING_ARNS",
"INVALID_NUMBER_OF_RESOURCE_GROUP_ARNS",
"INVALID_NUMBER_OF_RULES_PACKAGE_ARNS",
"INVALID_NUMBER_OF_ASSESSMENT_RUN_STATES",
"INVALID_NUMBER_OF_TAGS",
"INVALID_NUMBER_OF_RESOURCE_GROUP_TAGS",
"INVALID_NUMBER_OF_ATTRIBUTES",
"INVALID_NUMBER_OF_USER_ATTRIBUTES",
"INVALID_NUMBER_OF_AGENT_IDS",
"INVALID_NUMBER_OF_AUTO_SCALING_GROUPS",
"INVALID_NUMBER_OF_RULE_NAMES",
"INVALID_NUMBER_OF_SEVERITIES",
}
}
type LimitExceededErrorCode string
// Enum values for LimitExceededErrorCode
const (
LimitExceededErrorCodeAssessmentTargetLimitExceeded LimitExceededErrorCode = "ASSESSMENT_TARGET_LIMIT_EXCEEDED"
LimitExceededErrorCodeAssessmentTemplateLimitExceeded LimitExceededErrorCode = "ASSESSMENT_TEMPLATE_LIMIT_EXCEEDED"
LimitExceededErrorCodeAssessmentRunLimitExceeded LimitExceededErrorCode = "ASSESSMENT_RUN_LIMIT_EXCEEDED"
LimitExceededErrorCodeResourceGroupLimitExceeded LimitExceededErrorCode = "RESOURCE_GROUP_LIMIT_EXCEEDED"
LimitExceededErrorCodeEventSubscriptionLimitExceeded LimitExceededErrorCode = "EVENT_SUBSCRIPTION_LIMIT_EXCEEDED"
)
// Values returns all known values for LimitExceededErrorCode. 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 (LimitExceededErrorCode) Values() []LimitExceededErrorCode {
return []LimitExceededErrorCode{
"ASSESSMENT_TARGET_LIMIT_EXCEEDED",
"ASSESSMENT_TEMPLATE_LIMIT_EXCEEDED",
"ASSESSMENT_RUN_LIMIT_EXCEEDED",
"RESOURCE_GROUP_LIMIT_EXCEEDED",
"EVENT_SUBSCRIPTION_LIMIT_EXCEEDED",
}
}
type Locale string
// Enum values for Locale
const (
LocaleEnUs Locale = "EN_US"
)
// Values returns all known values for Locale. 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 (Locale) Values() []Locale {
return []Locale{
"EN_US",
}
}
type NoSuchEntityErrorCode string
// Enum values for NoSuchEntityErrorCode
const (
NoSuchEntityErrorCodeAssessmentTargetDoesNotExist NoSuchEntityErrorCode = "ASSESSMENT_TARGET_DOES_NOT_EXIST"
NoSuchEntityErrorCodeAssessmentTemplateDoesNotExist NoSuchEntityErrorCode = "ASSESSMENT_TEMPLATE_DOES_NOT_EXIST"
NoSuchEntityErrorCodeAssessmentRunDoesNotExist NoSuchEntityErrorCode = "ASSESSMENT_RUN_DOES_NOT_EXIST"
NoSuchEntityErrorCodeFindingDoesNotExist NoSuchEntityErrorCode = "FINDING_DOES_NOT_EXIST"
NoSuchEntityErrorCodeResourceGroupDoesNotExist NoSuchEntityErrorCode = "RESOURCE_GROUP_DOES_NOT_EXIST"
NoSuchEntityErrorCodeRulesPackageDoesNotExist NoSuchEntityErrorCode = "RULES_PACKAGE_DOES_NOT_EXIST"
NoSuchEntityErrorCodeSnsTopicDoesNotExist NoSuchEntityErrorCode = "SNS_TOPIC_DOES_NOT_EXIST"
NoSuchEntityErrorCodeIamRoleDoesNotExist NoSuchEntityErrorCode = "IAM_ROLE_DOES_NOT_EXIST"
)
// Values returns all known values for NoSuchEntityErrorCode. 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 (NoSuchEntityErrorCode) Values() []NoSuchEntityErrorCode {
return []NoSuchEntityErrorCode{
"ASSESSMENT_TARGET_DOES_NOT_EXIST",
"ASSESSMENT_TEMPLATE_DOES_NOT_EXIST",
"ASSESSMENT_RUN_DOES_NOT_EXIST",
"FINDING_DOES_NOT_EXIST",
"RESOURCE_GROUP_DOES_NOT_EXIST",
"RULES_PACKAGE_DOES_NOT_EXIST",
"SNS_TOPIC_DOES_NOT_EXIST",
"IAM_ROLE_DOES_NOT_EXIST",
}
}
type PreviewStatus string
// Enum values for PreviewStatus
const (
PreviewStatusWorkInProgress PreviewStatus = "WORK_IN_PROGRESS"
PreviewStatusCompleted PreviewStatus = "COMPLETED"
)
// Values returns all known values for PreviewStatus. 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 (PreviewStatus) Values() []PreviewStatus {
return []PreviewStatus{
"WORK_IN_PROGRESS",
"COMPLETED",
}
}
type ReportFileFormat string
// Enum values for ReportFileFormat
const (
ReportFileFormatHtml ReportFileFormat = "HTML"
ReportFileFormatPdf ReportFileFormat = "PDF"
)
// Values returns all known values for ReportFileFormat. 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 (ReportFileFormat) Values() []ReportFileFormat {
return []ReportFileFormat{
"HTML",
"PDF",
}
}
type ReportStatus string
// Enum values for ReportStatus
const (
ReportStatusWorkInProgress ReportStatus = "WORK_IN_PROGRESS"
ReportStatusFailed ReportStatus = "FAILED"
ReportStatusCompleted ReportStatus = "COMPLETED"
)
// Values returns all known values for ReportStatus. 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 (ReportStatus) Values() []ReportStatus {
return []ReportStatus{
"WORK_IN_PROGRESS",
"FAILED",
"COMPLETED",
}
}
type ReportType string
// Enum values for ReportType
const (
ReportTypeFinding ReportType = "FINDING"
ReportTypeFull ReportType = "FULL"
)
// Values returns all known values for ReportType. 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 (ReportType) Values() []ReportType {
return []ReportType{
"FINDING",
"FULL",
}
}
type ScopeType string
// Enum values for ScopeType
const (
ScopeTypeInstanceId ScopeType = "INSTANCE_ID"
ScopeTypeRulesPackageArn ScopeType = "RULES_PACKAGE_ARN"
)
// Values returns all known values for ScopeType. 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 (ScopeType) Values() []ScopeType {
return []ScopeType{
"INSTANCE_ID",
"RULES_PACKAGE_ARN",
}
}
type Severity string
// Enum values for Severity
const (
SeverityLow Severity = "Low"
SeverityMedium Severity = "Medium"
SeverityHigh Severity = "High"
SeverityInformational Severity = "Informational"
SeverityUndefined Severity = "Undefined"
)
// Values returns all known values for Severity. 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 (Severity) Values() []Severity {
return []Severity{
"Low",
"Medium",
"High",
"Informational",
"Undefined",
}
}
type StopAction string
// Enum values for StopAction
const (
StopActionStartEvaluation StopAction = "START_EVALUATION"
StopActionSkipEvaluation StopAction = "SKIP_EVALUATION"
)
// Values returns all known values for StopAction. 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 (StopAction) Values() []StopAction {
return []StopAction{
"START_EVALUATION",
"SKIP_EVALUATION",
}
}
| 554 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// You do not have required permissions to access the requested resource.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ AccessDeniedErrorCode
CanRetry *bool
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You started an assessment run, but one of the instances is already
// participating in another assessment run.
type AgentsAlreadyRunningAssessmentException struct {
Message *string
ErrorCodeOverride *string
Agents []AgentAlreadyRunningAssessment
AgentsTruncated *bool
CanRetry *bool
noSmithyDocumentSerde
}
func (e *AgentsAlreadyRunningAssessmentException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AgentsAlreadyRunningAssessmentException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AgentsAlreadyRunningAssessmentException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AgentsAlreadyRunningAssessmentException"
}
return *e.ErrorCodeOverride
}
func (e *AgentsAlreadyRunningAssessmentException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// You cannot perform a specified action if an assessment run is currently in
// progress.
type AssessmentRunInProgressException struct {
Message *string
ErrorCodeOverride *string
AssessmentRunArns []string
AssessmentRunArnsTruncated *bool
CanRetry *bool
noSmithyDocumentSerde
}
func (e *AssessmentRunInProgressException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AssessmentRunInProgressException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AssessmentRunInProgressException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AssessmentRunInProgressException"
}
return *e.ErrorCodeOverride
}
func (e *AssessmentRunInProgressException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Internal server error.
type InternalException struct {
Message *string
ErrorCodeOverride *string
CanRetry *bool
noSmithyDocumentSerde
}
func (e *InternalException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalException"
}
return *e.ErrorCodeOverride
}
func (e *InternalException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Amazon Inspector cannot assume the cross-account role that it needs to list
// your EC2 instances during the assessment run.
type InvalidCrossAccountRoleException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ InvalidCrossAccountRoleErrorCode
CanRetry *bool
noSmithyDocumentSerde
}
func (e *InvalidCrossAccountRoleException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidCrossAccountRoleException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidCrossAccountRoleException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidCrossAccountRoleException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidCrossAccountRoleException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because an invalid or out-of-range value was supplied
// for an input parameter.
type InvalidInputException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ InvalidInputErrorCode
CanRetry *bool
noSmithyDocumentSerde
}
func (e *InvalidInputException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidInputException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidInputException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidInputException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because it attempted to create resources beyond the
// current AWS account limits. The error code describes the limit exceeded.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ LimitExceededErrorCode
CanRetry *bool
noSmithyDocumentSerde
}
func (e *LimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because it referenced an entity that does not exist.
// The error code describes the entity.
type NoSuchEntityException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ NoSuchEntityErrorCode
CanRetry *bool
noSmithyDocumentSerde
}
func (e *NoSuchEntityException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NoSuchEntityException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NoSuchEntityException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NoSuchEntityException"
}
return *e.ErrorCodeOverride
}
func (e *NoSuchEntityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request is rejected. The specified assessment template is currently
// generating an exclusions preview.
type PreviewGenerationInProgressException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *PreviewGenerationInProgressException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *PreviewGenerationInProgressException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *PreviewGenerationInProgressException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "PreviewGenerationInProgressException"
}
return *e.ErrorCodeOverride
}
func (e *PreviewGenerationInProgressException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The serice is temporary unavailable.
type ServiceTemporarilyUnavailableException struct {
Message *string
ErrorCodeOverride *string
CanRetry *bool
noSmithyDocumentSerde
}
func (e *ServiceTemporarilyUnavailableException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceTemporarilyUnavailableException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceTemporarilyUnavailableException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceTemporarilyUnavailableException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceTemporarilyUnavailableException) ErrorFault() smithy.ErrorFault {
return smithy.FaultServer
}
// Used by the GetAssessmentReport API. The request was rejected because you tried
// to generate a report for an assessment run that existed before reporting was
// supported in Amazon Inspector. You can only generate reports for assessment runs
// that took place or will take place after generating reports in Amazon Inspector
// became available.
type UnsupportedFeatureException struct {
Message *string
ErrorCodeOverride *string
CanRetry *bool
noSmithyDocumentSerde
}
func (e *UnsupportedFeatureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnsupportedFeatureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnsupportedFeatureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnsupportedFeatureException"
}
return *e.ErrorCodeOverride
}
func (e *UnsupportedFeatureException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 341 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// Used in the exception error that is thrown if you start an assessment run for
// an assessment target that includes an EC2 instance that is already participating
// in another started assessment run.
type AgentAlreadyRunningAssessment struct {
// ID of the agent that is running on an EC2 instance that is already
// participating in another started assessment run.
//
// This member is required.
AgentId *string
// The ARN of the assessment run that has already been started.
//
// This member is required.
AssessmentRunArn *string
noSmithyDocumentSerde
}
// Contains information about an Amazon Inspector agent. This data type is used as
// a request parameter in the ListAssessmentRunAgents action.
type AgentFilter struct {
// The detailed health state of the agent. Values can be set to IDLE, RUNNING,
// SHUTDOWN, UNHEALTHY, THROTTLED, and UNKNOWN.
//
// This member is required.
AgentHealthCodes []AgentHealthCode
// The current health state of the agent. Values can be set to HEALTHY or
// UNHEALTHY.
//
// This member is required.
AgentHealths []AgentHealth
noSmithyDocumentSerde
}
// Used as a response element in the PreviewAgents action.
type AgentPreview struct {
// The ID of the EC2 instance where the agent is installed.
//
// This member is required.
AgentId *string
// The health status of the Amazon Inspector Agent.
AgentHealth AgentHealth
// The version of the Amazon Inspector Agent.
AgentVersion *string
// The Auto Scaling group for the EC2 instance where the agent is installed.
AutoScalingGroup *string
// The hostname of the EC2 instance on which the Amazon Inspector Agent is
// installed.
Hostname *string
// The IP address of the EC2 instance on which the Amazon Inspector Agent is
// installed.
Ipv4Address *string
// The kernel version of the operating system running on the EC2 instance on which
// the Amazon Inspector Agent is installed.
KernelVersion *string
// The operating system running on the EC2 instance on which the Amazon Inspector
// Agent is installed.
OperatingSystem *string
noSmithyDocumentSerde
}
// A snapshot of an Amazon Inspector assessment run that contains the findings of
// the assessment run . Used as the response element in the DescribeAssessmentRuns
// action.
type AssessmentRun struct {
// The ARN of the assessment run.
//
// This member is required.
Arn *string
// The ARN of the assessment template that is associated with the assessment run.
//
// This member is required.
AssessmentTemplateArn *string
// The time when StartAssessmentRun was called.
//
// This member is required.
CreatedAt *time.Time
// A Boolean value (true or false) that specifies whether the process of
// collecting data from the agents is completed.
//
// This member is required.
DataCollected *bool
// The duration of the assessment run.
//
// This member is required.
DurationInSeconds int32
// Provides a total count of generated findings per severity.
//
// This member is required.
FindingCounts map[string]int32
// The auto-generated name for the assessment run.
//
// This member is required.
Name *string
// A list of notifications for the event subscriptions. A notification about a
// particular generated finding is added to this list only once.
//
// This member is required.
Notifications []AssessmentRunNotification
// The rules packages selected for the assessment run.
//
// This member is required.
RulesPackageArns []string
// The state of the assessment run.
//
// This member is required.
State AssessmentRunState
// The last time when the assessment run's state changed.
//
// This member is required.
StateChangedAt *time.Time
// A list of the assessment run state changes.
//
// This member is required.
StateChanges []AssessmentRunStateChange
// The user-defined attributes that are assigned to every generated finding.
//
// This member is required.
UserAttributesForFindings []Attribute
// The assessment run completion time that corresponds to the rules packages
// evaluation completion time or failure.
CompletedAt *time.Time
// The time when StartAssessmentRun was called.
StartedAt *time.Time
noSmithyDocumentSerde
}
// Contains information about an Amazon Inspector agent. This data type is used as
// a response element in the ListAssessmentRunAgents action.
type AssessmentRunAgent struct {
// The current health state of the agent.
//
// This member is required.
AgentHealth AgentHealth
// The detailed health state of the agent.
//
// This member is required.
AgentHealthCode AgentHealthCode
// The AWS account of the EC2 instance where the agent is installed.
//
// This member is required.
AgentId *string
// The ARN of the assessment run that is associated with the agent.
//
// This member is required.
AssessmentRunArn *string
// The Amazon Inspector application data metrics that are collected by the agent.
//
// This member is required.
TelemetryMetadata []TelemetryMetadata
// The description for the agent health code.
AgentHealthDetails *string
// The Auto Scaling group of the EC2 instance that is specified by the agent ID.
AutoScalingGroup *string
noSmithyDocumentSerde
}
// Used as the request parameter in the ListAssessmentRuns action.
type AssessmentRunFilter struct {
// For a record to match a filter, the value that is specified for this data type
// property must inclusively match any value between the specified minimum and
// maximum values of the completedAt property of the AssessmentRun data type.
CompletionTimeRange *TimestampRange
// For a record to match a filter, the value that is specified for this data type
// property must inclusively match any value between the specified minimum and
// maximum values of the durationInSeconds property of the AssessmentRun data type.
DurationRange *DurationRange
// For a record to match a filter, an explicit value or a string containing a
// wildcard that is specified for this data type property must match the value of
// the assessmentRunName property of the AssessmentRun data type.
NamePattern *string
// For a record to match a filter, the value that is specified for this data type
// property must be contained in the list of values of the rulesPackages property
// of the AssessmentRun data type.
RulesPackageArns []string
// For a record to match a filter, the value that is specified for this data type
// property must inclusively match any value between the specified minimum and
// maximum values of the startTime property of the AssessmentRun data type.
StartTimeRange *TimestampRange
// For a record to match a filter, the value that is specified for this data type
// property must match the stateChangedAt property of the AssessmentRun data type.
StateChangeTimeRange *TimestampRange
// For a record to match a filter, one of the values specified for this data type
// property must be the exact match of the value of the assessmentRunState property
// of the AssessmentRun data type.
States []AssessmentRunState
noSmithyDocumentSerde
}
// Used as one of the elements of the AssessmentRun data type.
type AssessmentRunNotification struct {
// The date of the notification.
//
// This member is required.
Date *time.Time
// The Boolean value that specifies whether the notification represents an error.
//
// This member is required.
Error *bool
// The event for which a notification is sent.
//
// This member is required.
Event InspectorEvent
// The message included in the notification.
Message *string
// The status code of the SNS notification.
SnsPublishStatusCode AssessmentRunNotificationSnsStatusCode
// The SNS topic to which the SNS notification is sent.
SnsTopicArn *string
noSmithyDocumentSerde
}
// Used as one of the elements of the AssessmentRun data type.
type AssessmentRunStateChange struct {
// The assessment run state.
//
// This member is required.
State AssessmentRunState
// The last time the assessment run state changed.
//
// This member is required.
StateChangedAt *time.Time
noSmithyDocumentSerde
}
// Contains information about an Amazon Inspector application. This data type is
// used as the response element in the DescribeAssessmentTargets action.
type AssessmentTarget struct {
// The ARN that specifies the Amazon Inspector assessment target.
//
// This member is required.
Arn *string
// The time at which the assessment target is created.
//
// This member is required.
CreatedAt *time.Time
// The name of the Amazon Inspector assessment target.
//
// This member is required.
Name *string
// The time at which UpdateAssessmentTarget is called.
//
// This member is required.
UpdatedAt *time.Time
// The ARN that specifies the resource group that is associated with the
// assessment target.
ResourceGroupArn *string
noSmithyDocumentSerde
}
// Used as the request parameter in the ListAssessmentTargets action.
type AssessmentTargetFilter struct {
// For a record to match a filter, an explicit value or a string that contains a
// wildcard that is specified for this data type property must match the value of
// the assessmentTargetName property of the AssessmentTarget data type.
AssessmentTargetNamePattern *string
noSmithyDocumentSerde
}
// Contains information about an Amazon Inspector assessment template. This data
// type is used as the response element in the DescribeAssessmentTemplates action.
type AssessmentTemplate struct {
// The ARN of the assessment template.
//
// This member is required.
Arn *string
// The number of existing assessment runs associated with this assessment
// template. This value can be zero or a positive integer.
//
// This member is required.
AssessmentRunCount *int32
// The ARN of the assessment target that corresponds to this assessment template.
//
// This member is required.
AssessmentTargetArn *string
// The time at which the assessment template is created.
//
// This member is required.
CreatedAt *time.Time
// The duration in seconds specified for this assessment template. The default
// value is 3600 seconds (one hour). The maximum value is 86400 seconds (one day).
//
// This member is required.
DurationInSeconds int32
// The name of the assessment template.
//
// This member is required.
Name *string
// The rules packages that are specified for this assessment template.
//
// This member is required.
RulesPackageArns []string
// The user-defined attributes that are assigned to every generated finding from
// the assessment run that uses this assessment template.
//
// This member is required.
UserAttributesForFindings []Attribute
// The Amazon Resource Name (ARN) of the most recent assessment run associated
// with this assessment template. This value exists only when the value of
// assessmentRunCount is greaterpa than zero.
LastAssessmentRunArn *string
noSmithyDocumentSerde
}
// Used as the request parameter in the ListAssessmentTemplates action.
type AssessmentTemplateFilter struct {
// For a record to match a filter, the value specified for this data type property
// must inclusively match any value between the specified minimum and maximum
// values of the durationInSeconds property of the AssessmentTemplate data type.
DurationRange *DurationRange
// For a record to match a filter, an explicit value or a string that contains a
// wildcard that is specified for this data type property must match the value of
// the assessmentTemplateName property of the AssessmentTemplate data type.
NamePattern *string
// For a record to match a filter, the values that are specified for this data
// type property must be contained in the list of values of the rulesPackageArns
// property of the AssessmentTemplate data type.
RulesPackageArns []string
noSmithyDocumentSerde
}
// A collection of attributes of the host from which the finding is generated.
type AssetAttributes struct {
// The schema version of this data type.
//
// This member is required.
SchemaVersion int32
// The ID of the agent that is installed on the EC2 instance where the finding is
// generated.
AgentId *string
// The ID of the Amazon Machine Image (AMI) that is installed on the EC2 instance
// where the finding is generated.
AmiId *string
// The Auto Scaling group of the EC2 instance where the finding is generated.
AutoScalingGroup *string
// The hostname of the EC2 instance where the finding is generated.
Hostname *string
// The list of IP v4 addresses of the EC2 instance where the finding is generated.
Ipv4Addresses []string
// An array of the network interfaces interacting with the EC2 instance where the
// finding is generated.
NetworkInterfaces []NetworkInterface
// The tags related to the EC2 instance where the finding is generated.
Tags []Tag
noSmithyDocumentSerde
}
// This data type is used as a request parameter in the AddAttributesToFindings
// and CreateAssessmentTemplate actions.
type Attribute struct {
// The attribute key.
//
// This member is required.
Key *string
// The value assigned to the attribute key.
Value *string
noSmithyDocumentSerde
}
// This data type is used in the AssessmentTemplateFilter data type.
type DurationRange struct {
// The maximum value of the duration range. Must be less than or equal to 604800
// seconds (1 week).
MaxSeconds int32
// The minimum value of the duration range. Must be greater than zero.
MinSeconds int32
noSmithyDocumentSerde
}
// This data type is used in the Subscription data type.
type EventSubscription struct {
// The event for which Amazon Simple Notification Service (SNS) notifications are
// sent.
//
// This member is required.
Event InspectorEvent
// The time at which SubscribeToEvent is called.
//
// This member is required.
SubscribedAt *time.Time
noSmithyDocumentSerde
}
// Contains information about what was excluded from an assessment run.
type Exclusion struct {
// The ARN that specifies the exclusion.
//
// This member is required.
Arn *string
// The description of the exclusion.
//
// This member is required.
Description *string
// The recommendation for the exclusion.
//
// This member is required.
Recommendation *string
// The AWS resources for which the exclusion pertains.
//
// This member is required.
Scopes []Scope
// The name of the exclusion.
//
// This member is required.
Title *string
// The system-defined attributes for the exclusion.
Attributes []Attribute
noSmithyDocumentSerde
}
// Contains information about what is excluded from an assessment run given the
// current state of the assessment template.
type ExclusionPreview struct {
// The description of the exclusion preview.
//
// This member is required.
Description *string
// The recommendation for the exclusion preview.
//
// This member is required.
Recommendation *string
// The AWS resources for which the exclusion preview pertains.
//
// This member is required.
Scopes []Scope
// The name of the exclusion preview.
//
// This member is required.
Title *string
// The system-defined attributes for the exclusion preview.
Attributes []Attribute
noSmithyDocumentSerde
}
// Includes details about the failed items.
type FailedItemDetails struct {
// The status code of a failed item.
//
// This member is required.
FailureCode FailedItemErrorCode
// Indicates whether you can immediately retry a request for this item for a
// specified resource.
//
// This member is required.
Retryable *bool
noSmithyDocumentSerde
}
// Contains information about an Amazon Inspector finding. This data type is used
// as the response element in the DescribeFindings action.
type Finding struct {
// The ARN that specifies the finding.
//
// This member is required.
Arn *string
// The system-defined attributes for the finding.
//
// This member is required.
Attributes []Attribute
// The time when the finding was generated.
//
// This member is required.
CreatedAt *time.Time
// The time when AddAttributesToFindings is called.
//
// This member is required.
UpdatedAt *time.Time
// The user-defined attributes that are assigned to the finding.
//
// This member is required.
UserAttributes []Attribute
// A collection of attributes of the host from which the finding is generated.
AssetAttributes *AssetAttributes
// The type of the host from which the finding is generated.
AssetType AssetType
// This data element is currently not used.
Confidence int32
// The description of the finding.
Description *string
// The ID of the finding.
Id *string
// This data element is currently not used.
IndicatorOfCompromise *bool
// The numeric value of the finding severity.
NumericSeverity float64
// The recommendation for the finding.
Recommendation *string
// The schema version of this data type.
SchemaVersion int32
// The data element is set to "Inspector".
Service *string
// This data type is used in the Finding data type.
ServiceAttributes *InspectorServiceAttributes
// The finding severity. Values can be set to High, Medium, Low, and Informational.
Severity Severity
// The name of the finding.
Title *string
noSmithyDocumentSerde
}
// This data type is used as a request parameter in the ListFindings action.
type FindingFilter struct {
// For a record to match a filter, one of the values that is specified for this
// data type property must be the exact match of the value of the agentId property
// of the Finding data type.
AgentIds []string
// For a record to match a filter, the list of values that are specified for this
// data type property must be contained in the list of values of the attributes
// property of the Finding data type.
Attributes []Attribute
// For a record to match a filter, one of the values that is specified for this
// data type property must be the exact match of the value of the autoScalingGroup
// property of the Finding data type.
AutoScalingGroups []string
// The time range during which the finding is generated.
CreationTimeRange *TimestampRange
// For a record to match a filter, one of the values that is specified for this
// data type property must be the exact match of the value of the ruleName property
// of the Finding data type.
RuleNames []string
// For a record to match a filter, one of the values that is specified for this
// data type property must be the exact match of the value of the rulesPackageArn
// property of the Finding data type.
RulesPackageArns []string
// For a record to match a filter, one of the values that is specified for this
// data type property must be the exact match of the value of the severity property
// of the Finding data type.
Severities []Severity
// For a record to match a filter, the value that is specified for this data type
// property must be contained in the list of values of the userAttributes property
// of the Finding data type.
UserAttributes []Attribute
noSmithyDocumentSerde
}
// This data type is used in the Finding data type.
type InspectorServiceAttributes struct {
// The schema version of this data type.
//
// This member is required.
SchemaVersion int32
// The ARN of the assessment run during which the finding is generated.
AssessmentRunArn *string
// The ARN of the rules package that is used to generate the finding.
RulesPackageArn *string
noSmithyDocumentSerde
}
// Contains information about the network interfaces interacting with an EC2
// instance. This data type is used as one of the elements of the AssetAttributes
// data type.
type NetworkInterface struct {
// The IP addresses associated with the network interface.
Ipv6Addresses []string
// The ID of the network interface.
NetworkInterfaceId *string
// The name of a private DNS associated with the network interface.
PrivateDnsName *string
// The private IP address associated with the network interface.
PrivateIpAddress *string
// A list of the private IP addresses associated with the network interface.
// Includes the privateDnsName and privateIpAddress.
PrivateIpAddresses []PrivateIp
// The name of a public DNS associated with the network interface.
PublicDnsName *string
// The public IP address from which the network interface is reachable.
PublicIp *string
// A list of the security groups associated with the network interface. Includes
// the groupId and groupName.
SecurityGroups []SecurityGroup
// The ID of a subnet associated with the network interface.
SubnetId *string
// The ID of a VPC associated with the network interface.
VpcId *string
noSmithyDocumentSerde
}
// Contains information about a private IP address associated with a network
// interface. This data type is used as a response element in the DescribeFindings
// action.
type PrivateIp struct {
// The DNS name of the private IP address.
PrivateDnsName *string
// The full IP address of the network inteface.
PrivateIpAddress *string
noSmithyDocumentSerde
}
// Contains information about a resource group. The resource group defines a set
// of tags that, when queried, identify the AWS resources that make up the
// assessment target. This data type is used as the response element in the
// DescribeResourceGroups action.
type ResourceGroup struct {
// The ARN of the resource group.
//
// This member is required.
Arn *string
// The time at which resource group is created.
//
// This member is required.
CreatedAt *time.Time
// The tags (key and value pairs) of the resource group. This data type property
// is used in the CreateResourceGroup action.
//
// This member is required.
Tags []ResourceGroupTag
noSmithyDocumentSerde
}
// This data type is used as one of the elements of the ResourceGroup data type.
type ResourceGroupTag struct {
// A tag key.
//
// This member is required.
Key *string
// The value assigned to a tag key.
Value *string
noSmithyDocumentSerde
}
// Contains information about an Amazon Inspector rules package. This data type is
// used as the response element in the DescribeRulesPackages action.
type RulesPackage struct {
// The ARN of the rules package.
//
// This member is required.
Arn *string
// The name of the rules package.
//
// This member is required.
Name *string
// The provider of the rules package.
//
// This member is required.
Provider *string
// The version ID of the rules package.
//
// This member is required.
Version *string
// The description of the rules package.
Description *string
noSmithyDocumentSerde
}
// This data type contains key-value pairs that identify various Amazon resources.
type Scope struct {
// The type of the scope.
Key ScopeType
// The resource identifier for the specified scope type.
Value *string
noSmithyDocumentSerde
}
// Contains information about a security group associated with a network
// interface. This data type is used as one of the elements of the NetworkInterface
// data type.
type SecurityGroup struct {
// The ID of the security group.
GroupId *string
// The name of the security group.
GroupName *string
noSmithyDocumentSerde
}
// This data type is used as a response element in the ListEventSubscriptions
// action.
type Subscription struct {
// The list of existing event subscriptions.
//
// This member is required.
EventSubscriptions []EventSubscription
// The ARN of the assessment template that is used during the event for which the
// SNS notification is sent.
//
// This member is required.
ResourceArn *string
// The ARN of the Amazon Simple Notification Service (SNS) topic to which the SNS
// notifications are sent.
//
// This member is required.
TopicArn *string
noSmithyDocumentSerde
}
// A key and value pair. This data type is used as a request parameter in the
// SetTagsForResource action and a response element in the ListTagsForResource
// action.
type Tag struct {
// A tag key.
//
// This member is required.
Key *string
// A value assigned to a tag key.
Value *string
noSmithyDocumentSerde
}
// The metadata about the Amazon Inspector application data metrics collected by
// the agent. This data type is used as the response element in the
// GetTelemetryMetadata action.
type TelemetryMetadata struct {
// The count of messages that the agent sends to the Amazon Inspector service.
//
// This member is required.
Count *int64
// A specific type of behavioral data that is collected by the agent.
//
// This member is required.
MessageType *string
// The data size of messages that the agent sends to the Amazon Inspector service.
DataSize *int64
noSmithyDocumentSerde
}
// This data type is used in the AssessmentRunFilter data type.
type TimestampRange struct {
// The minimum value of the timestamp range.
BeginDate *time.Time
// The maximum value of the timestamp range.
EndDate *time.Time
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 924 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
cryptorand "crypto/rand"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Inspector2"
const ServiceAPIVersion = "2020-06-08"
// Client provides the API client to make operations call for Inspector2.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
resolveIdempotencyTokenProvider(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// Provides idempotency tokens values that will be automatically populated into
// idempotent API operations.
IdempotencyTokenProvider IdempotencyTokenProvider
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "inspector2", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
}
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 454 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates an Amazon Web Services account with an Amazon Inspector delegated
// administrator. An HTTP 200 response indicates the association was successfully
// started, but doesn’t indicate whether it was completed. You can check if the
// association completed by using ListMembers (https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListMembers.html)
// for multiple accounts or GetMembers (https://docs.aws.amazon.com/inspector/v2/APIReference/API_GetMember.html)
// for a single account.
func (c *Client) AssociateMember(ctx context.Context, params *AssociateMemberInput, optFns ...func(*Options)) (*AssociateMemberOutput, error) {
if params == nil {
params = &AssociateMemberInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateMember", params, optFns, c.addOperationAssociateMemberMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateMemberOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateMemberInput struct {
// The Amazon Web Services account ID of the member account to be associated.
//
// This member is required.
AccountId *string
noSmithyDocumentSerde
}
type AssociateMemberOutput struct {
// The Amazon Web Services account ID of the successfully associated member
// account.
//
// This member is required.
AccountId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateMemberMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateMember{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateMember{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateMemberValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateMember(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
}
return nil
}
func newServiceMetadataMiddleware_opAssociateMember(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "AssociateMember",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the Amazon Inspector status of multiple Amazon Web Services accounts
// within your environment.
func (c *Client) BatchGetAccountStatus(ctx context.Context, params *BatchGetAccountStatusInput, optFns ...func(*Options)) (*BatchGetAccountStatusOutput, error) {
if params == nil {
params = &BatchGetAccountStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchGetAccountStatus", params, optFns, c.addOperationBatchGetAccountStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchGetAccountStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchGetAccountStatusInput struct {
// The 12-digit Amazon Web Services account IDs of the accounts to retrieve Amazon
// Inspector status for.
AccountIds []string
noSmithyDocumentSerde
}
type BatchGetAccountStatusOutput struct {
// An array of objects that provide details on the status of Amazon Inspector for
// each of the requested accounts.
//
// This member is required.
Accounts []types.AccountState
// An array of objects detailing any accounts that failed to enable Amazon
// Inspector and why.
FailedAccounts []types.FailedAccount
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchGetAccountStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetAccountStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetAccountStatus{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetAccountStatus(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
}
return nil
}
func newServiceMetadataMiddleware_opBatchGetAccountStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "BatchGetAccountStatus",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves code snippets from findings that Amazon Inspector detected code
// vulnerabilities in.
func (c *Client) BatchGetCodeSnippet(ctx context.Context, params *BatchGetCodeSnippetInput, optFns ...func(*Options)) (*BatchGetCodeSnippetOutput, error) {
if params == nil {
params = &BatchGetCodeSnippetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchGetCodeSnippet", params, optFns, c.addOperationBatchGetCodeSnippetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchGetCodeSnippetOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchGetCodeSnippetInput struct {
// An array of finding ARNs for the findings you want to retrieve code snippets
// from.
//
// This member is required.
FindingArns []string
noSmithyDocumentSerde
}
type BatchGetCodeSnippetOutput struct {
// The retrieved code snippets associated with the provided finding ARNs.
CodeSnippetResults []types.CodeSnippetResult
// Any errors Amazon Inspector encountered while trying to retrieve the requested
// code snippets.
Errors []types.CodeSnippetError
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchGetCodeSnippetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetCodeSnippet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetCodeSnippet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchGetCodeSnippetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetCodeSnippet(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
}
return nil
}
func newServiceMetadataMiddleware_opBatchGetCodeSnippet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "BatchGetCodeSnippet",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets free trial status for multiple Amazon Web Services accounts.
func (c *Client) BatchGetFreeTrialInfo(ctx context.Context, params *BatchGetFreeTrialInfoInput, optFns ...func(*Options)) (*BatchGetFreeTrialInfoOutput, error) {
if params == nil {
params = &BatchGetFreeTrialInfoInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchGetFreeTrialInfo", params, optFns, c.addOperationBatchGetFreeTrialInfoMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchGetFreeTrialInfoOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchGetFreeTrialInfoInput struct {
// The account IDs to get free trial status for.
//
// This member is required.
AccountIds []string
noSmithyDocumentSerde
}
type BatchGetFreeTrialInfoOutput struct {
// An array of objects that provide Amazon Inspector free trial details for each
// of the requested accounts.
//
// This member is required.
Accounts []types.FreeTrialAccountInfo
// An array of objects detailing any accounts that free trial data could not be
// returned for.
//
// This member is required.
FailedAccounts []types.FreeTrialInfoError
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchGetFreeTrialInfoMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetFreeTrialInfo{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetFreeTrialInfo{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchGetFreeTrialInfoValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetFreeTrialInfo(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
}
return nil
}
func newServiceMetadataMiddleware_opBatchGetFreeTrialInfo(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "BatchGetFreeTrialInfo",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves Amazon Inspector deep inspection activation status of multiple member
// accounts within your organization. You must be the delegated administrator of an
// organization in Amazon Inspector to use this API.
func (c *Client) BatchGetMemberEc2DeepInspectionStatus(ctx context.Context, params *BatchGetMemberEc2DeepInspectionStatusInput, optFns ...func(*Options)) (*BatchGetMemberEc2DeepInspectionStatusOutput, error) {
if params == nil {
params = &BatchGetMemberEc2DeepInspectionStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchGetMemberEc2DeepInspectionStatus", params, optFns, c.addOperationBatchGetMemberEc2DeepInspectionStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchGetMemberEc2DeepInspectionStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchGetMemberEc2DeepInspectionStatusInput struct {
// The unique identifiers for the Amazon Web Services accounts to retrieve Amazon
// Inspector deep inspection activation status for.
AccountIds []string
noSmithyDocumentSerde
}
type BatchGetMemberEc2DeepInspectionStatusOutput struct {
// An array of objects that provide details on the activation status of Amazon
// Inspector deep inspection for each of the requested accounts.
AccountIds []types.MemberAccountEc2DeepInspectionStatusState
// An array of objects that provide details on any accounts that failed to
// activate Amazon Inspector deep inspection and why.
FailedAccountIds []types.FailedMemberAccountEc2DeepInspectionStatusState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchGetMemberEc2DeepInspectionStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetMemberEc2DeepInspectionStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetMemberEc2DeepInspectionStatus{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetMemberEc2DeepInspectionStatus(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
}
return nil
}
func newServiceMetadataMiddleware_opBatchGetMemberEc2DeepInspectionStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "BatchGetMemberEc2DeepInspectionStatus",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Activates or deactivates Amazon Inspector deep inspection for the provided
// member accounts in your organization. You must be the delegated administrator of
// an organization in Amazon Inspector to use this API.
func (c *Client) BatchUpdateMemberEc2DeepInspectionStatus(ctx context.Context, params *BatchUpdateMemberEc2DeepInspectionStatusInput, optFns ...func(*Options)) (*BatchUpdateMemberEc2DeepInspectionStatusOutput, error) {
if params == nil {
params = &BatchUpdateMemberEc2DeepInspectionStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchUpdateMemberEc2DeepInspectionStatus", params, optFns, c.addOperationBatchUpdateMemberEc2DeepInspectionStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchUpdateMemberEc2DeepInspectionStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchUpdateMemberEc2DeepInspectionStatusInput struct {
// The unique identifiers for the Amazon Web Services accounts to change Amazon
// Inspector deep inspection status for.
//
// This member is required.
AccountIds []types.MemberAccountEc2DeepInspectionStatus
noSmithyDocumentSerde
}
type BatchUpdateMemberEc2DeepInspectionStatusOutput struct {
// An array of objects that provide details for each of the accounts that Amazon
// Inspector deep inspection status was successfully changed for.
AccountIds []types.MemberAccountEc2DeepInspectionStatusState
// An array of objects that provide details for each of the accounts that Amazon
// Inspector deep inspection status could not be successfully changed for.
FailedAccountIds []types.FailedMemberAccountEc2DeepInspectionStatusState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchUpdateMemberEc2DeepInspectionStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchUpdateMemberEc2DeepInspectionStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchUpdateMemberEc2DeepInspectionStatus{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchUpdateMemberEc2DeepInspectionStatusValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchUpdateMemberEc2DeepInspectionStatus(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
}
return nil
}
func newServiceMetadataMiddleware_opBatchUpdateMemberEc2DeepInspectionStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "BatchUpdateMemberEc2DeepInspectionStatus",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Cancels the given findings report.
func (c *Client) CancelFindingsReport(ctx context.Context, params *CancelFindingsReportInput, optFns ...func(*Options)) (*CancelFindingsReportOutput, error) {
if params == nil {
params = &CancelFindingsReportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CancelFindingsReport", params, optFns, c.addOperationCancelFindingsReportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CancelFindingsReportOutput)
out.ResultMetadata = metadata
return out, nil
}
type CancelFindingsReportInput struct {
// The ID of the report to be canceled.
//
// This member is required.
ReportId *string
noSmithyDocumentSerde
}
type CancelFindingsReportOutput struct {
// The ID of the canceled report.
//
// This member is required.
ReportId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCancelFindingsReportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelFindingsReport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelFindingsReport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCancelFindingsReportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelFindingsReport(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
}
return nil
}
func newServiceMetadataMiddleware_opCancelFindingsReport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "CancelFindingsReport",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Cancels a software bill of materials (SBOM) report.
func (c *Client) CancelSbomExport(ctx context.Context, params *CancelSbomExportInput, optFns ...func(*Options)) (*CancelSbomExportOutput, error) {
if params == nil {
params = &CancelSbomExportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CancelSbomExport", params, optFns, c.addOperationCancelSbomExportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CancelSbomExportOutput)
out.ResultMetadata = metadata
return out, nil
}
type CancelSbomExportInput struct {
// The report ID of the SBOM export to cancel.
//
// This member is required.
ReportId *string
noSmithyDocumentSerde
}
type CancelSbomExportOutput struct {
// The report ID of the canceled SBOM export.
ReportId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCancelSbomExportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelSbomExport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelSbomExport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCancelSbomExportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelSbomExport(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
}
return nil
}
func newServiceMetadataMiddleware_opCancelSbomExport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "CancelSbomExport",
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a filter resource using specified filter criteria.
func (c *Client) CreateFilter(ctx context.Context, params *CreateFilterInput, optFns ...func(*Options)) (*CreateFilterOutput, error) {
if params == nil {
params = &CreateFilterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateFilter", params, optFns, c.addOperationCreateFilterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateFilterOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateFilterInput struct {
// Defines the action that is to be applied to the findings that match the filter.
//
// This member is required.
Action types.FilterAction
// Defines the criteria to be used in the filter for querying findings.
//
// This member is required.
FilterCriteria *types.FilterCriteria
// The name of the filter. Minimum length of 3. Maximum length of 64. Valid
// characters include alphanumeric characters, dot (.), underscore (_), and dash
// (-). Spaces are not allowed.
//
// This member is required.
Name *string
// A description of the filter.
Description *string
// The reason for creating the filter.
Reason *string
// A list of tags for the filter.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateFilterOutput struct {
// The Amazon Resource Number (ARN) of the successfully created filter.
//
// This member is required.
Arn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateFilterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateFilter{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateFilter{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateFilterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFilter(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
}
return nil
}
func newServiceMetadataMiddleware_opCreateFilter(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "CreateFilter",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a finding report. By default only ACTIVE findings are returned in the
// report. To see SUPRESSED or CLOSED findings you must specify a value for the
// findingStatus filter criteria.
func (c *Client) CreateFindingsReport(ctx context.Context, params *CreateFindingsReportInput, optFns ...func(*Options)) (*CreateFindingsReportOutput, error) {
if params == nil {
params = &CreateFindingsReportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateFindingsReport", params, optFns, c.addOperationCreateFindingsReportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateFindingsReportOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateFindingsReportInput struct {
// The format to generate the report in.
//
// This member is required.
ReportFormat types.ReportFormat
// The Amazon S3 export destination for the report.
//
// This member is required.
S3Destination *types.Destination
// The filter criteria to apply to the results of the finding report.
FilterCriteria *types.FilterCriteria
noSmithyDocumentSerde
}
type CreateFindingsReportOutput struct {
// The ID of the report.
ReportId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateFindingsReportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateFindingsReport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateFindingsReport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateFindingsReportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFindingsReport(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
}
return nil
}
func newServiceMetadataMiddleware_opCreateFindingsReport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "CreateFindingsReport",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a software bill of materials (SBOM) report.
func (c *Client) CreateSbomExport(ctx context.Context, params *CreateSbomExportInput, optFns ...func(*Options)) (*CreateSbomExportOutput, error) {
if params == nil {
params = &CreateSbomExportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSbomExport", params, optFns, c.addOperationCreateSbomExportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSbomExportOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSbomExportInput struct {
// The output format for the software bill of materials (SBOM) report.
//
// This member is required.
ReportFormat types.SbomReportFormat
// Contains details of the Amazon S3 bucket and KMS key used to export findings.
//
// This member is required.
S3Destination *types.Destination
// The resource filter criteria for the software bill of materials (SBOM) report.
ResourceFilterCriteria *types.ResourceFilterCriteria
noSmithyDocumentSerde
}
type CreateSbomExportOutput struct {
// The report ID for the software bill of materials (SBOM) report.
ReportId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSbomExportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSbomExport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSbomExport{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSbomExportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSbomExport(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
}
return nil
}
func newServiceMetadataMiddleware_opCreateSbomExport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "CreateSbomExport",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a filter resource.
func (c *Client) DeleteFilter(ctx context.Context, params *DeleteFilterInput, optFns ...func(*Options)) (*DeleteFilterOutput, error) {
if params == nil {
params = &DeleteFilterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteFilter", params, optFns, c.addOperationDeleteFilterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteFilterOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteFilterInput struct {
// The Amazon Resource Number (ARN) of the filter to be deleted.
//
// This member is required.
Arn *string
noSmithyDocumentSerde
}
type DeleteFilterOutput struct {
// The Amazon Resource Number (ARN) of the filter that has been deleted.
//
// This member is required.
Arn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteFilterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteFilter{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteFilter{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteFilterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFilter(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
}
return nil
}
func newServiceMetadataMiddleware_opDeleteFilter(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "DeleteFilter",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describe Amazon Inspector configuration settings for an Amazon Web Services
// organization.
func (c *Client) DescribeOrganizationConfiguration(ctx context.Context, params *DescribeOrganizationConfigurationInput, optFns ...func(*Options)) (*DescribeOrganizationConfigurationOutput, error) {
if params == nil {
params = &DescribeOrganizationConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeOrganizationConfiguration", params, optFns, c.addOperationDescribeOrganizationConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeOrganizationConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeOrganizationConfigurationInput struct {
noSmithyDocumentSerde
}
type DescribeOrganizationConfigurationOutput struct {
// The scan types are automatically enabled for new members of your organization.
AutoEnable *types.AutoEnable
// Represents whether your organization has reached the maximum Amazon Web
// Services account limit for Amazon Inspector.
MaxAccountLimitReached *bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeOrganizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeOrganizationConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeOrganizationConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOrganizationConfiguration(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
}
return nil
}
func newServiceMetadataMiddleware_opDescribeOrganizationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "DescribeOrganizationConfiguration",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package inspector2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disables Amazon Inspector scans for one or more Amazon Web Services accounts.
// Disabling all scan types in an account disables the Amazon Inspector service.
func (c *Client) Disable(ctx context.Context, params *DisableInput, optFns ...func(*Options)) (*DisableOutput, error) {
if params == nil {
params = &DisableInput{}
}
result, metadata, err := c.invokeOperation(ctx, "Disable", params, optFns, c.addOperationDisableMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisableOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisableInput struct {
// An array of account IDs you want to disable Amazon Inspector scans for.
AccountIds []string
// The resource scan types you want to disable.
ResourceTypes []types.ResourceScanType
noSmithyDocumentSerde
}
type DisableOutput struct {
// Information on the accounts that have had Amazon Inspector scans successfully
// disabled. Details are provided for each account.
//
// This member is required.
Accounts []types.Account
// Information on any accounts for which Amazon Inspector scans could not be
// disabled. Details are provided for each account.
FailedAccounts []types.FailedAccount
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisableMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDisable{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisable{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisable(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
}
return nil
}
func newServiceMetadataMiddleware_opDisable(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "inspector2",
OperationName: "Disable",
}
}
| 131 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.