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 rekognition
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"
)
// Stops a running stream processor that was created by CreateStreamProcessor .
func (c *Client) StopStreamProcessor(ctx context.Context, params *StopStreamProcessorInput, optFns ...func(*Options)) (*StopStreamProcessorOutput, error) {
if params == nil {
params = &StopStreamProcessorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopStreamProcessor", params, optFns, c.addOperationStopStreamProcessorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopStreamProcessorOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopStreamProcessorInput struct {
// The name of a stream processor created by CreateStreamProcessor .
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type StopStreamProcessorOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopStreamProcessorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopStreamProcessor{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopStreamProcessor{}, 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 = addOpStopStreamProcessorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopStreamProcessor(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_opStopStreamProcessor(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "rekognition",
OperationName: "StopStreamProcessor",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
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 one or more key-value tags to an Amazon Rekognition collection, stream
// processor, or Custom Labels model. For more information, see Tagging AWS
// Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) .
// This operation requires permissions to perform the rekognition:TagResource
// action.
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 {
// Amazon Resource Name (ARN) of the model, collection, or stream processor that
// you want to assign the tags to.
//
// This member is required.
ResourceArn *string
// The key-value tags to assign 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(&awsAwsjson11_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_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: "rekognition",
OperationName: "TagResource",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
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 one or more tags from an Amazon Rekognition collection, stream
// processor, or Custom Labels model. This operation requires permissions to
// perform the rekognition:UntagResource action.
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 {
// Amazon Resource Name (ARN) of the model, collection, or stream processor that
// you want to remove the tags from.
//
// This member is required.
ResourceArn *string
// A list of the tags that you want to remove.
//
// 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(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_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: "rekognition",
OperationName: "UntagResource",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
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/rekognition/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds or updates one or more entries (images) in a dataset. An entry is a JSON
// Line which contains the information for a single image, including the image
// location, assigned labels, and object location bounding boxes. For more
// information, see Image-Level labels in manifest files and Object localization in
// manifest files in the Amazon Rekognition Custom Labels Developer Guide. If the
// source-ref field in the JSON line references an existing image, the existing
// image in the dataset is updated. If source-ref field doesn't reference an
// existing image, the image is added as a new image to the dataset. You specify
// the changes that you want to make in the Changes input parameter. There isn't a
// limit to the number JSON Lines that you can change, but the size of Changes
// must be less than 5MB. UpdateDatasetEntries returns immediatly, but the dataset
// update might take a while to complete. Use DescribeDataset to check the current
// status. The dataset updated successfully if the value of Status is
// UPDATE_COMPLETE . To check if any non-terminal errors occured, call
// ListDatasetEntries and check for the presence of errors lists in the JSON
// Lines. Dataset update fails if a terminal error occurs ( Status = UPDATE_FAILED
// ). Currently, you can't access the terminal error information from the Amazon
// Rekognition Custom Labels SDK. This operation requires permissions to perform
// the rekognition:UpdateDatasetEntries action.
func (c *Client) UpdateDatasetEntries(ctx context.Context, params *UpdateDatasetEntriesInput, optFns ...func(*Options)) (*UpdateDatasetEntriesOutput, error) {
if params == nil {
params = &UpdateDatasetEntriesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateDatasetEntries", params, optFns, c.addOperationUpdateDatasetEntriesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateDatasetEntriesOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateDatasetEntriesInput struct {
// The changes that you want to make to the dataset.
//
// This member is required.
Changes *types.DatasetChanges
// The Amazon Resource Name (ARN) of the dataset that you want to update.
//
// This member is required.
DatasetArn *string
noSmithyDocumentSerde
}
type UpdateDatasetEntriesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateDatasetEntriesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDatasetEntries{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDatasetEntries{}, 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 = addOpUpdateDatasetEntriesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDatasetEntries(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_opUpdateDatasetEntries(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "rekognition",
OperationName: "UpdateDatasetEntries",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
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/rekognition/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Allows you to update a stream processor. You can change some settings and
// regions of interest and delete certain parameters.
func (c *Client) UpdateStreamProcessor(ctx context.Context, params *UpdateStreamProcessorInput, optFns ...func(*Options)) (*UpdateStreamProcessorOutput, error) {
if params == nil {
params = &UpdateStreamProcessorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateStreamProcessor", params, optFns, c.addOperationUpdateStreamProcessorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateStreamProcessorOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateStreamProcessorInput struct {
// Name of the stream processor that you want to update.
//
// This member is required.
Name *string
// Shows whether you are sharing data with Rekognition to improve model
// performance. You can choose this option at the account level or on a per-stream
// basis. Note that if you opt out at the account level this setting is ignored on
// individual streams.
DataSharingPreferenceForUpdate *types.StreamProcessorDataSharingPreference
// A list of parameters you want to delete from the stream processor.
ParametersToDelete []types.StreamProcessorParameterToDelete
// Specifies locations in the frames where Amazon Rekognition checks for objects
// or people. This is an optional parameter for label detection stream processors.
RegionsOfInterestForUpdate []types.RegionOfInterest
// The stream processor settings that you want to update. Label detection settings
// can be updated to detect different labels with a different minimum confidence.
SettingsForUpdate *types.StreamProcessorSettingsForUpdate
noSmithyDocumentSerde
}
type UpdateStreamProcessorOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateStreamProcessorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateStreamProcessor{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateStreamProcessor{}, 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 = addOpUpdateStreamProcessorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateStreamProcessor(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_opUpdateStreamProcessor(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "rekognition",
OperationName: "UpdateStreamProcessor",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package rekognition provides the API client, operations, and parameter types
// for Amazon Rekognition.
//
// This is the API Reference for Amazon Rekognition Image (https://docs.aws.amazon.com/rekognition/latest/dg/images.html)
// , Amazon Rekognition Custom Labels (https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/what-is.html)
// , Amazon Rekognition Stored Video (https://docs.aws.amazon.com/rekognition/latest/dg/video.html)
// , Amazon Rekognition Streaming Video (https://docs.aws.amazon.com/rekognition/latest/dg/streaming-video.html)
// . It provides descriptions of actions, data types, common parameters, and common
// errors. Amazon Rekognition Image
// - AssociateFaces (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_AssociateFaces.html)
// - CompareFaces (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CompareFaces.html)
// - CreateCollection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateCollection.html)
// - CreateUser (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateUser.html)
// - DeleteCollection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteCollection.html)
// - DeleteFaces (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteFaces.html)
// - DeleteUser (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteUser.html)
// - DescribeCollection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeCollection.html)
// - DetectFaces (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectFaces.html)
// - DetectLabels (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectLabels.html)
// - DetectModerationLabels (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectModerationLabels.html)
// - DetectProtectiveEquipment (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectProtectiveEquipment.html)
// - DetectText (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectText.html)
// - DisassociateFaces (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DisassociateFaces.html)
// - GetCelebrityInfo (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetCelebrityInfo.html)
// - IndexFaces (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_IndexFaces.html)
// - ListCollections (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListCollections.html)
// - ListFaces (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListFaces.html)
// - ListUsers (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListFaces.html)
// - RecognizeCelebrities (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_RecognizeCelebrities.html)
// - SearchFaces (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_SearchFaces.html)
// - SearchFacesByImage (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_SearchFacesByImage.html)
// - SearchUsers (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_SearchUsers.html)
// - SearchUsersByImage (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_SearchUsersByImage.html)
//
// Amazon Rekognition Custom Labels
// - CopyProjectVersion (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CopyProjectVersion.html)
// - CreateDataset (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateDataset.html)
// - CreateProject (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateProject.html)
// - CreateProjectVersion (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateProjectVersion.html)
// - DeleteDataset (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteDataset.html)
// - DeleteProject (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteProject.html)
// - DeleteProjectPolicy (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteProjectPolicy.html)
// - DeleteProjectVersion (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteProjectVersion.html)
// - DescribeDataset (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeDataset.html)
// - DescribeProjects (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeProjects.html)
// - DescribeProjectVersions (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeProjectVersions.html)
// - DetectCustomLabels (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectCustomLabels.html)
// - DistributeDatasetEntries (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DistributeDatasetEntries.html)
// - ListDatasetEntries (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListDatasetEntries.html)
// - ListDatasetLabels (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListDatasetLabels.html)
// - ListProjectPolicies (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListProjectPolicies.html)
// - PutProjectPolicy (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_PutProjectPolicy.html)
// - StartProjectVersion (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartProjectVersion.html)
// - StopProjectVersion (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StopProjectVersion.html)
// - UpdateDatasetEntries (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_UpdateDatasetEntries.html)
//
// Amazon Rekognition Video Stored Video
// - GetCelebrityRecognition (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetCelebrityRecognition.html)
// - GetContentModeration (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetContentModeration.html)
// - GetFaceDetection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetFaceDetection.html)
// - GetFaceSearch (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetFaceSearch.html)
// - GetLabelDetection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetLabelDetection.html)
// - GetPersonTracking (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetPersonTracking.html)
// - GetSegmentDetection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetSegmentDetection.html)
// - GetTextDetection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetTextDetection.html)
// - StartCelebrityRecognition (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartCelebrityRecognition.html)
// - StartContentModeration (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartContentModeration.html)
// - StartFaceDetection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartFaceDetection.html)
// - StartFaceSearch (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartFaceSearch.html)
// - StartLabelDetection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartLabelDetection.html)
// - StartPersonTracking (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartPersonTracking.html)
// - StartSegmentDetection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartSegmentDetection.html)
// - StartTextDetection (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartTextDetection.html)
//
// Amazon Rekognition Video Streaming Video
// - CreateStreamProcessor (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateStreamProcessor.html)
// - DeleteStreamProcessor (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteStreamProcessor.html)
// - DescribeStreamProcessor (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeStreamProcessor.html)
// - ListStreamProcessors (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListStreamProcessors.html)
// - StartStreamProcessor (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartStreamProcessor.html)
// - StopStreamProcessor (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StopStreamProcessor.html)
// - UpdateStreamProcessor (https://docs.aws.amazon.com/rekognition/latest/APIReference/API_UpdateStreamProcessor.html)
package rekognition
| 86 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
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/rekognition/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 = "rekognition"
}
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 rekognition
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.29.2"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/rekognition/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"
"math"
"path"
)
type awsAwsjson11_serializeOpAssociateFaces struct {
}
func (*awsAwsjson11_serializeOpAssociateFaces) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateFaces) 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.(*AssociateFacesInput)
_ = 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("RekognitionService.AssociateFaces")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateFacesInput(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_serializeOpCompareFaces struct {
}
func (*awsAwsjson11_serializeOpCompareFaces) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCompareFaces) 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.(*CompareFacesInput)
_ = 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("RekognitionService.CompareFaces")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCompareFacesInput(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_serializeOpCopyProjectVersion struct {
}
func (*awsAwsjson11_serializeOpCopyProjectVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCopyProjectVersion) 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.(*CopyProjectVersionInput)
_ = 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("RekognitionService.CopyProjectVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCopyProjectVersionInput(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_serializeOpCreateCollection struct {
}
func (*awsAwsjson11_serializeOpCreateCollection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateCollection) 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.(*CreateCollectionInput)
_ = 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("RekognitionService.CreateCollection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateCollectionInput(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_serializeOpCreateDataset struct {
}
func (*awsAwsjson11_serializeOpCreateDataset) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateDataset) 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.(*CreateDatasetInput)
_ = 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("RekognitionService.CreateDataset")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateDatasetInput(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_serializeOpCreateFaceLivenessSession struct {
}
func (*awsAwsjson11_serializeOpCreateFaceLivenessSession) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateFaceLivenessSession) 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.(*CreateFaceLivenessSessionInput)
_ = 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("RekognitionService.CreateFaceLivenessSession")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateFaceLivenessSessionInput(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_serializeOpCreateProject struct {
}
func (*awsAwsjson11_serializeOpCreateProject) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateProject) 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.(*CreateProjectInput)
_ = 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("RekognitionService.CreateProject")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateProjectInput(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_serializeOpCreateProjectVersion struct {
}
func (*awsAwsjson11_serializeOpCreateProjectVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateProjectVersion) 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.(*CreateProjectVersionInput)
_ = 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("RekognitionService.CreateProjectVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateProjectVersionInput(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_serializeOpCreateStreamProcessor struct {
}
func (*awsAwsjson11_serializeOpCreateStreamProcessor) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateStreamProcessor) 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.(*CreateStreamProcessorInput)
_ = 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("RekognitionService.CreateStreamProcessor")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateStreamProcessorInput(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_serializeOpCreateUser struct {
}
func (*awsAwsjson11_serializeOpCreateUser) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateUser) 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.(*CreateUserInput)
_ = 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("RekognitionService.CreateUser")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateUserInput(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_serializeOpDeleteCollection struct {
}
func (*awsAwsjson11_serializeOpDeleteCollection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteCollection) 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.(*DeleteCollectionInput)
_ = 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("RekognitionService.DeleteCollection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteCollectionInput(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_serializeOpDeleteDataset struct {
}
func (*awsAwsjson11_serializeOpDeleteDataset) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteDataset) 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.(*DeleteDatasetInput)
_ = 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("RekognitionService.DeleteDataset")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteDatasetInput(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_serializeOpDeleteFaces struct {
}
func (*awsAwsjson11_serializeOpDeleteFaces) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteFaces) 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.(*DeleteFacesInput)
_ = 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("RekognitionService.DeleteFaces")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteFacesInput(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_serializeOpDeleteProject struct {
}
func (*awsAwsjson11_serializeOpDeleteProject) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteProject) 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.(*DeleteProjectInput)
_ = 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("RekognitionService.DeleteProject")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteProjectInput(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_serializeOpDeleteProjectPolicy struct {
}
func (*awsAwsjson11_serializeOpDeleteProjectPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteProjectPolicy) 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.(*DeleteProjectPolicyInput)
_ = 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("RekognitionService.DeleteProjectPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteProjectPolicyInput(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_serializeOpDeleteProjectVersion struct {
}
func (*awsAwsjson11_serializeOpDeleteProjectVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteProjectVersion) 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.(*DeleteProjectVersionInput)
_ = 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("RekognitionService.DeleteProjectVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteProjectVersionInput(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_serializeOpDeleteStreamProcessor struct {
}
func (*awsAwsjson11_serializeOpDeleteStreamProcessor) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteStreamProcessor) 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.(*DeleteStreamProcessorInput)
_ = 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("RekognitionService.DeleteStreamProcessor")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteStreamProcessorInput(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_serializeOpDeleteUser struct {
}
func (*awsAwsjson11_serializeOpDeleteUser) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteUser) 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.(*DeleteUserInput)
_ = 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("RekognitionService.DeleteUser")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteUserInput(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_serializeOpDescribeCollection struct {
}
func (*awsAwsjson11_serializeOpDescribeCollection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeCollection) 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.(*DescribeCollectionInput)
_ = 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("RekognitionService.DescribeCollection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeCollectionInput(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_serializeOpDescribeDataset struct {
}
func (*awsAwsjson11_serializeOpDescribeDataset) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeDataset) 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.(*DescribeDatasetInput)
_ = 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("RekognitionService.DescribeDataset")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeDatasetInput(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_serializeOpDescribeProjects struct {
}
func (*awsAwsjson11_serializeOpDescribeProjects) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeProjects) 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.(*DescribeProjectsInput)
_ = 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("RekognitionService.DescribeProjects")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeProjectsInput(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_serializeOpDescribeProjectVersions struct {
}
func (*awsAwsjson11_serializeOpDescribeProjectVersions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeProjectVersions) 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.(*DescribeProjectVersionsInput)
_ = 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("RekognitionService.DescribeProjectVersions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeProjectVersionsInput(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_serializeOpDescribeStreamProcessor struct {
}
func (*awsAwsjson11_serializeOpDescribeStreamProcessor) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeStreamProcessor) 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.(*DescribeStreamProcessorInput)
_ = 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("RekognitionService.DescribeStreamProcessor")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeStreamProcessorInput(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_serializeOpDetectCustomLabels struct {
}
func (*awsAwsjson11_serializeOpDetectCustomLabels) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetectCustomLabels) 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.(*DetectCustomLabelsInput)
_ = 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("RekognitionService.DetectCustomLabels")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetectCustomLabelsInput(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_serializeOpDetectFaces struct {
}
func (*awsAwsjson11_serializeOpDetectFaces) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetectFaces) 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.(*DetectFacesInput)
_ = 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("RekognitionService.DetectFaces")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetectFacesInput(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_serializeOpDetectLabels struct {
}
func (*awsAwsjson11_serializeOpDetectLabels) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetectLabels) 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.(*DetectLabelsInput)
_ = 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("RekognitionService.DetectLabels")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetectLabelsInput(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_serializeOpDetectModerationLabels struct {
}
func (*awsAwsjson11_serializeOpDetectModerationLabels) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetectModerationLabels) 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.(*DetectModerationLabelsInput)
_ = 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("RekognitionService.DetectModerationLabels")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetectModerationLabelsInput(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_serializeOpDetectProtectiveEquipment struct {
}
func (*awsAwsjson11_serializeOpDetectProtectiveEquipment) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetectProtectiveEquipment) 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.(*DetectProtectiveEquipmentInput)
_ = 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("RekognitionService.DetectProtectiveEquipment")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetectProtectiveEquipmentInput(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_serializeOpDetectText struct {
}
func (*awsAwsjson11_serializeOpDetectText) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetectText) 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.(*DetectTextInput)
_ = 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("RekognitionService.DetectText")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetectTextInput(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_serializeOpDisassociateFaces struct {
}
func (*awsAwsjson11_serializeOpDisassociateFaces) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisassociateFaces) 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.(*DisassociateFacesInput)
_ = 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("RekognitionService.DisassociateFaces")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisassociateFacesInput(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_serializeOpDistributeDatasetEntries struct {
}
func (*awsAwsjson11_serializeOpDistributeDatasetEntries) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDistributeDatasetEntries) 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.(*DistributeDatasetEntriesInput)
_ = 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("RekognitionService.DistributeDatasetEntries")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDistributeDatasetEntriesInput(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_serializeOpGetCelebrityInfo struct {
}
func (*awsAwsjson11_serializeOpGetCelebrityInfo) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetCelebrityInfo) 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.(*GetCelebrityInfoInput)
_ = 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("RekognitionService.GetCelebrityInfo")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetCelebrityInfoInput(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_serializeOpGetCelebrityRecognition struct {
}
func (*awsAwsjson11_serializeOpGetCelebrityRecognition) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetCelebrityRecognition) 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.(*GetCelebrityRecognitionInput)
_ = 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("RekognitionService.GetCelebrityRecognition")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetCelebrityRecognitionInput(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_serializeOpGetContentModeration struct {
}
func (*awsAwsjson11_serializeOpGetContentModeration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContentModeration) 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.(*GetContentModerationInput)
_ = 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("RekognitionService.GetContentModeration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContentModerationInput(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_serializeOpGetFaceDetection struct {
}
func (*awsAwsjson11_serializeOpGetFaceDetection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetFaceDetection) 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.(*GetFaceDetectionInput)
_ = 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("RekognitionService.GetFaceDetection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetFaceDetectionInput(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_serializeOpGetFaceLivenessSessionResults struct {
}
func (*awsAwsjson11_serializeOpGetFaceLivenessSessionResults) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetFaceLivenessSessionResults) 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.(*GetFaceLivenessSessionResultsInput)
_ = 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("RekognitionService.GetFaceLivenessSessionResults")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetFaceLivenessSessionResultsInput(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_serializeOpGetFaceSearch struct {
}
func (*awsAwsjson11_serializeOpGetFaceSearch) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetFaceSearch) 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.(*GetFaceSearchInput)
_ = 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("RekognitionService.GetFaceSearch")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetFaceSearchInput(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_serializeOpGetLabelDetection struct {
}
func (*awsAwsjson11_serializeOpGetLabelDetection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLabelDetection) 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.(*GetLabelDetectionInput)
_ = 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("RekognitionService.GetLabelDetection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLabelDetectionInput(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_serializeOpGetPersonTracking struct {
}
func (*awsAwsjson11_serializeOpGetPersonTracking) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetPersonTracking) 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.(*GetPersonTrackingInput)
_ = 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("RekognitionService.GetPersonTracking")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetPersonTrackingInput(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_serializeOpGetSegmentDetection struct {
}
func (*awsAwsjson11_serializeOpGetSegmentDetection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSegmentDetection) 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.(*GetSegmentDetectionInput)
_ = 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("RekognitionService.GetSegmentDetection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSegmentDetectionInput(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_serializeOpGetTextDetection struct {
}
func (*awsAwsjson11_serializeOpGetTextDetection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetTextDetection) 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.(*GetTextDetectionInput)
_ = 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("RekognitionService.GetTextDetection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetTextDetectionInput(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_serializeOpIndexFaces struct {
}
func (*awsAwsjson11_serializeOpIndexFaces) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpIndexFaces) 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.(*IndexFacesInput)
_ = 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("RekognitionService.IndexFaces")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentIndexFacesInput(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_serializeOpListCollections struct {
}
func (*awsAwsjson11_serializeOpListCollections) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListCollections) 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.(*ListCollectionsInput)
_ = 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("RekognitionService.ListCollections")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListCollectionsInput(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_serializeOpListDatasetEntries struct {
}
func (*awsAwsjson11_serializeOpListDatasetEntries) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListDatasetEntries) 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.(*ListDatasetEntriesInput)
_ = 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("RekognitionService.ListDatasetEntries")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListDatasetEntriesInput(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_serializeOpListDatasetLabels struct {
}
func (*awsAwsjson11_serializeOpListDatasetLabels) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListDatasetLabels) 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.(*ListDatasetLabelsInput)
_ = 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("RekognitionService.ListDatasetLabels")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListDatasetLabelsInput(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_serializeOpListFaces struct {
}
func (*awsAwsjson11_serializeOpListFaces) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListFaces) 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.(*ListFacesInput)
_ = 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("RekognitionService.ListFaces")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListFacesInput(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_serializeOpListProjectPolicies struct {
}
func (*awsAwsjson11_serializeOpListProjectPolicies) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListProjectPolicies) 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.(*ListProjectPoliciesInput)
_ = 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("RekognitionService.ListProjectPolicies")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListProjectPoliciesInput(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_serializeOpListStreamProcessors struct {
}
func (*awsAwsjson11_serializeOpListStreamProcessors) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListStreamProcessors) 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.(*ListStreamProcessorsInput)
_ = 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("RekognitionService.ListStreamProcessors")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListStreamProcessorsInput(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("RekognitionService.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_serializeOpListUsers struct {
}
func (*awsAwsjson11_serializeOpListUsers) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListUsers) 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.(*ListUsersInput)
_ = 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("RekognitionService.ListUsers")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListUsersInput(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_serializeOpPutProjectPolicy struct {
}
func (*awsAwsjson11_serializeOpPutProjectPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutProjectPolicy) 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.(*PutProjectPolicyInput)
_ = 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("RekognitionService.PutProjectPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutProjectPolicyInput(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_serializeOpRecognizeCelebrities struct {
}
func (*awsAwsjson11_serializeOpRecognizeCelebrities) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRecognizeCelebrities) 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.(*RecognizeCelebritiesInput)
_ = 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("RekognitionService.RecognizeCelebrities")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRecognizeCelebritiesInput(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_serializeOpSearchFaces struct {
}
func (*awsAwsjson11_serializeOpSearchFaces) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchFaces) 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.(*SearchFacesInput)
_ = 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("RekognitionService.SearchFaces")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchFacesInput(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_serializeOpSearchFacesByImage struct {
}
func (*awsAwsjson11_serializeOpSearchFacesByImage) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchFacesByImage) 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.(*SearchFacesByImageInput)
_ = 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("RekognitionService.SearchFacesByImage")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchFacesByImageInput(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_serializeOpSearchUsers struct {
}
func (*awsAwsjson11_serializeOpSearchUsers) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchUsers) 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.(*SearchUsersInput)
_ = 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("RekognitionService.SearchUsers")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchUsersInput(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_serializeOpSearchUsersByImage struct {
}
func (*awsAwsjson11_serializeOpSearchUsersByImage) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchUsersByImage) 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.(*SearchUsersByImageInput)
_ = 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("RekognitionService.SearchUsersByImage")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchUsersByImageInput(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_serializeOpStartCelebrityRecognition struct {
}
func (*awsAwsjson11_serializeOpStartCelebrityRecognition) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartCelebrityRecognition) 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.(*StartCelebrityRecognitionInput)
_ = 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("RekognitionService.StartCelebrityRecognition")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartCelebrityRecognitionInput(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_serializeOpStartContentModeration struct {
}
func (*awsAwsjson11_serializeOpStartContentModeration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartContentModeration) 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.(*StartContentModerationInput)
_ = 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("RekognitionService.StartContentModeration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartContentModerationInput(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_serializeOpStartFaceDetection struct {
}
func (*awsAwsjson11_serializeOpStartFaceDetection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartFaceDetection) 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.(*StartFaceDetectionInput)
_ = 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("RekognitionService.StartFaceDetection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartFaceDetectionInput(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_serializeOpStartFaceSearch struct {
}
func (*awsAwsjson11_serializeOpStartFaceSearch) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartFaceSearch) 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.(*StartFaceSearchInput)
_ = 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("RekognitionService.StartFaceSearch")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartFaceSearchInput(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_serializeOpStartLabelDetection struct {
}
func (*awsAwsjson11_serializeOpStartLabelDetection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartLabelDetection) 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.(*StartLabelDetectionInput)
_ = 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("RekognitionService.StartLabelDetection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartLabelDetectionInput(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_serializeOpStartPersonTracking struct {
}
func (*awsAwsjson11_serializeOpStartPersonTracking) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartPersonTracking) 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.(*StartPersonTrackingInput)
_ = 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("RekognitionService.StartPersonTracking")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartPersonTrackingInput(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_serializeOpStartProjectVersion struct {
}
func (*awsAwsjson11_serializeOpStartProjectVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartProjectVersion) 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.(*StartProjectVersionInput)
_ = 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("RekognitionService.StartProjectVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartProjectVersionInput(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_serializeOpStartSegmentDetection struct {
}
func (*awsAwsjson11_serializeOpStartSegmentDetection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartSegmentDetection) 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.(*StartSegmentDetectionInput)
_ = 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("RekognitionService.StartSegmentDetection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartSegmentDetectionInput(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_serializeOpStartStreamProcessor struct {
}
func (*awsAwsjson11_serializeOpStartStreamProcessor) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartStreamProcessor) 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.(*StartStreamProcessorInput)
_ = 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("RekognitionService.StartStreamProcessor")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartStreamProcessorInput(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_serializeOpStartTextDetection struct {
}
func (*awsAwsjson11_serializeOpStartTextDetection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartTextDetection) 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.(*StartTextDetectionInput)
_ = 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("RekognitionService.StartTextDetection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartTextDetectionInput(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_serializeOpStopProjectVersion struct {
}
func (*awsAwsjson11_serializeOpStopProjectVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopProjectVersion) 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.(*StopProjectVersionInput)
_ = 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("RekognitionService.StopProjectVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopProjectVersionInput(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_serializeOpStopStreamProcessor struct {
}
func (*awsAwsjson11_serializeOpStopStreamProcessor) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopStreamProcessor) 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.(*StopStreamProcessorInput)
_ = 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("RekognitionService.StopStreamProcessor")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopStreamProcessorInput(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_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_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)}
}
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("RekognitionService.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_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)}
}
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("RekognitionService.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(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_serializeOpUpdateDatasetEntries struct {
}
func (*awsAwsjson11_serializeOpUpdateDatasetEntries) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateDatasetEntries) 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.(*UpdateDatasetEntriesInput)
_ = 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("RekognitionService.UpdateDatasetEntries")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateDatasetEntriesInput(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_serializeOpUpdateStreamProcessor struct {
}
func (*awsAwsjson11_serializeOpUpdateStreamProcessor) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateStreamProcessor) 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.(*UpdateStreamProcessorInput)
_ = 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("RekognitionService.UpdateStreamProcessor")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateStreamProcessorInput(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_serializeDocumentAsset(v *types.Asset, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GroundTruthManifest != nil {
ok := object.Key("GroundTruthManifest")
if err := awsAwsjson11_serializeDocumentGroundTruthManifest(v.GroundTruthManifest, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAssets(v []types.Asset, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentAsset(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAttributes(v []types.Attribute, 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_serializeDocumentBlackFrame(v *types.BlackFrame, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxPixelThreshold != nil {
ok := object.Key("MaxPixelThreshold")
switch {
case math.IsNaN(float64(*v.MaxPixelThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.MaxPixelThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MaxPixelThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MaxPixelThreshold)
}
}
if v.MinCoveragePercentage != nil {
ok := object.Key("MinCoveragePercentage")
switch {
case math.IsNaN(float64(*v.MinCoveragePercentage)):
ok.String("NaN")
case math.IsInf(float64(*v.MinCoveragePercentage), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinCoveragePercentage), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinCoveragePercentage)
}
}
return nil
}
func awsAwsjson11_serializeDocumentBoundingBox(v *types.BoundingBox, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Height != nil {
ok := object.Key("Height")
switch {
case math.IsNaN(float64(*v.Height)):
ok.String("NaN")
case math.IsInf(float64(*v.Height), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.Height), -1):
ok.String("-Infinity")
default:
ok.Float(*v.Height)
}
}
if v.Left != nil {
ok := object.Key("Left")
switch {
case math.IsNaN(float64(*v.Left)):
ok.String("NaN")
case math.IsInf(float64(*v.Left), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.Left), -1):
ok.String("-Infinity")
default:
ok.Float(*v.Left)
}
}
if v.Top != nil {
ok := object.Key("Top")
switch {
case math.IsNaN(float64(*v.Top)):
ok.String("NaN")
case math.IsInf(float64(*v.Top), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.Top), -1):
ok.String("-Infinity")
default:
ok.Float(*v.Top)
}
}
if v.Width != nil {
ok := object.Key("Width")
switch {
case math.IsNaN(float64(*v.Width)):
ok.String("NaN")
case math.IsInf(float64(*v.Width), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.Width), -1):
ok.String("-Infinity")
default:
ok.Float(*v.Width)
}
}
return nil
}
func awsAwsjson11_serializeDocumentConnectedHomeLabels(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_serializeDocumentConnectedHomeSettings(v *types.ConnectedHomeSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Labels != nil {
ok := object.Key("Labels")
if err := awsAwsjson11_serializeDocumentConnectedHomeLabels(v.Labels, ok); err != nil {
return err
}
}
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
return nil
}
func awsAwsjson11_serializeDocumentConnectedHomeSettingsForUpdate(v *types.ConnectedHomeSettingsForUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Labels != nil {
ok := object.Key("Labels")
if err := awsAwsjson11_serializeDocumentConnectedHomeLabels(v.Labels, ok); err != nil {
return err
}
}
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
return nil
}
func awsAwsjson11_serializeDocumentContentClassifiers(v []types.ContentClassifier, 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_serializeDocumentCreateFaceLivenessSessionRequestSettings(v *types.CreateFaceLivenessSessionRequestSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AuditImagesLimit != nil {
ok := object.Key("AuditImagesLimit")
ok.Integer(*v.AuditImagesLimit)
}
if v.OutputConfig != nil {
ok := object.Key("OutputConfig")
if err := awsAwsjson11_serializeDocumentLivenessOutputConfig(v.OutputConfig, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentDatasetChanges(v *types.DatasetChanges, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GroundTruth != nil {
ok := object.Key("GroundTruth")
ok.Base64EncodeBytes(v.GroundTruth)
}
return nil
}
func awsAwsjson11_serializeDocumentDatasetLabels(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_serializeDocumentDatasetSource(v *types.DatasetSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DatasetArn != nil {
ok := object.Key("DatasetArn")
ok.String(*v.DatasetArn)
}
if v.GroundTruthManifest != nil {
ok := object.Key("GroundTruthManifest")
if err := awsAwsjson11_serializeDocumentGroundTruthManifest(v.GroundTruthManifest, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentDetectionFilter(v *types.DetectionFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MinBoundingBoxHeight != nil {
ok := object.Key("MinBoundingBoxHeight")
switch {
case math.IsNaN(float64(*v.MinBoundingBoxHeight)):
ok.String("NaN")
case math.IsInf(float64(*v.MinBoundingBoxHeight), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinBoundingBoxHeight), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinBoundingBoxHeight)
}
}
if v.MinBoundingBoxWidth != nil {
ok := object.Key("MinBoundingBoxWidth")
switch {
case math.IsNaN(float64(*v.MinBoundingBoxWidth)):
ok.String("NaN")
case math.IsInf(float64(*v.MinBoundingBoxWidth), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinBoundingBoxWidth), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinBoundingBoxWidth)
}
}
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
return nil
}
func awsAwsjson11_serializeDocumentDetectLabelsFeatureList(v []types.DetectLabelsFeatureName, 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_serializeDocumentDetectLabelsImagePropertiesSettings(v *types.DetectLabelsImagePropertiesSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxDominantColors != 0 {
ok := object.Key("MaxDominantColors")
ok.Integer(v.MaxDominantColors)
}
return nil
}
func awsAwsjson11_serializeDocumentDetectLabelsSettings(v *types.DetectLabelsSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GeneralLabels != nil {
ok := object.Key("GeneralLabels")
if err := awsAwsjson11_serializeDocumentGeneralLabelsSettings(v.GeneralLabels, ok); err != nil {
return err
}
}
if v.ImageProperties != nil {
ok := object.Key("ImageProperties")
if err := awsAwsjson11_serializeDocumentDetectLabelsImagePropertiesSettings(v.ImageProperties, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentDetectTextFilters(v *types.DetectTextFilters, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RegionsOfInterest != nil {
ok := object.Key("RegionsOfInterest")
if err := awsAwsjson11_serializeDocumentRegionsOfInterest(v.RegionsOfInterest, ok); err != nil {
return err
}
}
if v.WordFilter != nil {
ok := object.Key("WordFilter")
if err := awsAwsjson11_serializeDocumentDetectionFilter(v.WordFilter, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentDistributeDataset(v *types.DistributeDataset, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("Arn")
ok.String(*v.Arn)
}
return nil
}
func awsAwsjson11_serializeDocumentDistributeDatasetMetadataList(v []types.DistributeDataset, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentDistributeDataset(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFaceIdList(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_serializeDocumentFaceSearchSettings(v *types.FaceSearchSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceMatchThreshold != nil {
ok := object.Key("FaceMatchThreshold")
switch {
case math.IsNaN(float64(*v.FaceMatchThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.FaceMatchThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.FaceMatchThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.FaceMatchThreshold)
}
}
return nil
}
func awsAwsjson11_serializeDocumentGeneralLabelsFilterList(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_serializeDocumentGeneralLabelsSettings(v *types.GeneralLabelsSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LabelCategoryExclusionFilters != nil {
ok := object.Key("LabelCategoryExclusionFilters")
if err := awsAwsjson11_serializeDocumentGeneralLabelsFilterList(v.LabelCategoryExclusionFilters, ok); err != nil {
return err
}
}
if v.LabelCategoryInclusionFilters != nil {
ok := object.Key("LabelCategoryInclusionFilters")
if err := awsAwsjson11_serializeDocumentGeneralLabelsFilterList(v.LabelCategoryInclusionFilters, ok); err != nil {
return err
}
}
if v.LabelExclusionFilters != nil {
ok := object.Key("LabelExclusionFilters")
if err := awsAwsjson11_serializeDocumentGeneralLabelsFilterList(v.LabelExclusionFilters, ok); err != nil {
return err
}
}
if v.LabelInclusionFilters != nil {
ok := object.Key("LabelInclusionFilters")
if err := awsAwsjson11_serializeDocumentGeneralLabelsFilterList(v.LabelInclusionFilters, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentGroundTruthManifest(v *types.GroundTruthManifest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3Object != nil {
ok := object.Key("S3Object")
if err := awsAwsjson11_serializeDocumentS3Object(v.S3Object, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentHumanLoopConfig(v *types.HumanLoopConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataAttributes != nil {
ok := object.Key("DataAttributes")
if err := awsAwsjson11_serializeDocumentHumanLoopDataAttributes(v.DataAttributes, ok); err != nil {
return err
}
}
if v.FlowDefinitionArn != nil {
ok := object.Key("FlowDefinitionArn")
ok.String(*v.FlowDefinitionArn)
}
if v.HumanLoopName != nil {
ok := object.Key("HumanLoopName")
ok.String(*v.HumanLoopName)
}
return nil
}
func awsAwsjson11_serializeDocumentHumanLoopDataAttributes(v *types.HumanLoopDataAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContentClassifiers != nil {
ok := object.Key("ContentClassifiers")
if err := awsAwsjson11_serializeDocumentContentClassifiers(v.ContentClassifiers, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentImage(v *types.Image, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bytes != nil {
ok := object.Key("Bytes")
ok.Base64EncodeBytes(v.Bytes)
}
if v.S3Object != nil {
ok := object.Key("S3Object")
if err := awsAwsjson11_serializeDocumentS3Object(v.S3Object, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisDataStream(v *types.KinesisDataStream, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("Arn")
ok.String(*v.Arn)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisVideoStream(v *types.KinesisVideoStream, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("Arn")
ok.String(*v.Arn)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisVideoStreamStartSelector(v *types.KinesisVideoStreamStartSelector, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FragmentNumber != nil {
ok := object.Key("FragmentNumber")
ok.String(*v.FragmentNumber)
}
if v.ProducerTimestamp != nil {
ok := object.Key("ProducerTimestamp")
ok.Long(*v.ProducerTimestamp)
}
return nil
}
func awsAwsjson11_serializeDocumentLabelDetectionFeatureList(v []types.LabelDetectionFeatureName, 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_serializeDocumentLabelDetectionSettings(v *types.LabelDetectionSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GeneralLabels != nil {
ok := object.Key("GeneralLabels")
if err := awsAwsjson11_serializeDocumentGeneralLabelsSettings(v.GeneralLabels, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentLivenessOutputConfig(v *types.LivenessOutputConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3Bucket != nil {
ok := object.Key("S3Bucket")
ok.String(*v.S3Bucket)
}
if v.S3KeyPrefix != nil {
ok := object.Key("S3KeyPrefix")
ok.String(*v.S3KeyPrefix)
}
return nil
}
func awsAwsjson11_serializeDocumentNotificationChannel(v *types.NotificationChannel, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RoleArn != nil {
ok := object.Key("RoleArn")
ok.String(*v.RoleArn)
}
if v.SNSTopicArn != nil {
ok := object.Key("SNSTopicArn")
ok.String(*v.SNSTopicArn)
}
return nil
}
func awsAwsjson11_serializeDocumentOutputConfig(v *types.OutputConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3Bucket != nil {
ok := object.Key("S3Bucket")
ok.String(*v.S3Bucket)
}
if v.S3KeyPrefix != nil {
ok := object.Key("S3KeyPrefix")
ok.String(*v.S3KeyPrefix)
}
return nil
}
func awsAwsjson11_serializeDocumentPoint(v *types.Point, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.X != nil {
ok := object.Key("X")
switch {
case math.IsNaN(float64(*v.X)):
ok.String("NaN")
case math.IsInf(float64(*v.X), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.X), -1):
ok.String("-Infinity")
default:
ok.Float(*v.X)
}
}
if v.Y != nil {
ok := object.Key("Y")
switch {
case math.IsNaN(float64(*v.Y)):
ok.String("NaN")
case math.IsInf(float64(*v.Y), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.Y), -1):
ok.String("-Infinity")
default:
ok.Float(*v.Y)
}
}
return nil
}
func awsAwsjson11_serializeDocumentPolygon(v []types.Point, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentPoint(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentProjectNames(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_serializeDocumentProtectiveEquipmentSummarizationAttributes(v *types.ProtectiveEquipmentSummarizationAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
if v.RequiredEquipmentTypes != nil {
ok := object.Key("RequiredEquipmentTypes")
if err := awsAwsjson11_serializeDocumentProtectiveEquipmentTypes(v.RequiredEquipmentTypes, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentProtectiveEquipmentTypes(v []types.ProtectiveEquipmentType, 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_serializeDocumentRegionOfInterest(v *types.RegionOfInterest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BoundingBox != nil {
ok := object.Key("BoundingBox")
if err := awsAwsjson11_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil {
return err
}
}
if v.Polygon != nil {
ok := object.Key("Polygon")
if err := awsAwsjson11_serializeDocumentPolygon(v.Polygon, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRegionsOfInterest(v []types.RegionOfInterest, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRegionOfInterest(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentS3Destination(v *types.S3Destination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bucket != nil {
ok := object.Key("Bucket")
ok.String(*v.Bucket)
}
if v.KeyPrefix != nil {
ok := object.Key("KeyPrefix")
ok.String(*v.KeyPrefix)
}
return nil
}
func awsAwsjson11_serializeDocumentS3Object(v *types.S3Object, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bucket != nil {
ok := object.Key("Bucket")
ok.String(*v.Bucket)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Version != nil {
ok := object.Key("Version")
ok.String(*v.Version)
}
return nil
}
func awsAwsjson11_serializeDocumentSegmentTypes(v []types.SegmentType, 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_serializeDocumentStartSegmentDetectionFilters(v *types.StartSegmentDetectionFilters, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ShotFilter != nil {
ok := object.Key("ShotFilter")
if err := awsAwsjson11_serializeDocumentStartShotDetectionFilter(v.ShotFilter, ok); err != nil {
return err
}
}
if v.TechnicalCueFilter != nil {
ok := object.Key("TechnicalCueFilter")
if err := awsAwsjson11_serializeDocumentStartTechnicalCueDetectionFilter(v.TechnicalCueFilter, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStartShotDetectionFilter(v *types.StartShotDetectionFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MinSegmentConfidence != nil {
ok := object.Key("MinSegmentConfidence")
switch {
case math.IsNaN(float64(*v.MinSegmentConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinSegmentConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinSegmentConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinSegmentConfidence)
}
}
return nil
}
func awsAwsjson11_serializeDocumentStartTechnicalCueDetectionFilter(v *types.StartTechnicalCueDetectionFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BlackFrame != nil {
ok := object.Key("BlackFrame")
if err := awsAwsjson11_serializeDocumentBlackFrame(v.BlackFrame, ok); err != nil {
return err
}
}
if v.MinSegmentConfidence != nil {
ok := object.Key("MinSegmentConfidence")
switch {
case math.IsNaN(float64(*v.MinSegmentConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinSegmentConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinSegmentConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinSegmentConfidence)
}
}
return nil
}
func awsAwsjson11_serializeDocumentStartTextDetectionFilters(v *types.StartTextDetectionFilters, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RegionsOfInterest != nil {
ok := object.Key("RegionsOfInterest")
if err := awsAwsjson11_serializeDocumentRegionsOfInterest(v.RegionsOfInterest, ok); err != nil {
return err
}
}
if v.WordFilter != nil {
ok := object.Key("WordFilter")
if err := awsAwsjson11_serializeDocumentDetectionFilter(v.WordFilter, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStreamProcessingStartSelector(v *types.StreamProcessingStartSelector, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KVSStreamStartSelector != nil {
ok := object.Key("KVSStreamStartSelector")
if err := awsAwsjson11_serializeDocumentKinesisVideoStreamStartSelector(v.KVSStreamStartSelector, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStreamProcessingStopSelector(v *types.StreamProcessingStopSelector, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxDurationInSeconds != nil {
ok := object.Key("MaxDurationInSeconds")
ok.Long(*v.MaxDurationInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentStreamProcessorDataSharingPreference(v *types.StreamProcessorDataSharingPreference, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("OptIn")
ok.Boolean(v.OptIn)
}
return nil
}
func awsAwsjson11_serializeDocumentStreamProcessorInput(v *types.StreamProcessorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KinesisVideoStream != nil {
ok := object.Key("KinesisVideoStream")
if err := awsAwsjson11_serializeDocumentKinesisVideoStream(v.KinesisVideoStream, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStreamProcessorNotificationChannel(v *types.StreamProcessorNotificationChannel, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SNSTopicArn != nil {
ok := object.Key("SNSTopicArn")
ok.String(*v.SNSTopicArn)
}
return nil
}
func awsAwsjson11_serializeDocumentStreamProcessorOutput(v *types.StreamProcessorOutput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KinesisDataStream != nil {
ok := object.Key("KinesisDataStream")
if err := awsAwsjson11_serializeDocumentKinesisDataStream(v.KinesisDataStream, ok); err != nil {
return err
}
}
if v.S3Destination != nil {
ok := object.Key("S3Destination")
if err := awsAwsjson11_serializeDocumentS3Destination(v.S3Destination, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStreamProcessorParametersToDelete(v []types.StreamProcessorParameterToDelete, 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_serializeDocumentStreamProcessorSettings(v *types.StreamProcessorSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConnectedHome != nil {
ok := object.Key("ConnectedHome")
if err := awsAwsjson11_serializeDocumentConnectedHomeSettings(v.ConnectedHome, ok); err != nil {
return err
}
}
if v.FaceSearch != nil {
ok := object.Key("FaceSearch")
if err := awsAwsjson11_serializeDocumentFaceSearchSettings(v.FaceSearch, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStreamProcessorSettingsForUpdate(v *types.StreamProcessorSettingsForUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConnectedHomeForUpdate != nil {
ok := object.Key("ConnectedHomeForUpdate")
if err := awsAwsjson11_serializeDocumentConnectedHomeSettingsForUpdate(v.ConnectedHomeForUpdate, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTagKeyList(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_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 awsAwsjson11_serializeDocumentTestingData(v *types.TestingData, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Assets != nil {
ok := object.Key("Assets")
if err := awsAwsjson11_serializeDocumentAssets(v.Assets, ok); err != nil {
return err
}
}
if v.AutoCreate {
ok := object.Key("AutoCreate")
ok.Boolean(v.AutoCreate)
}
return nil
}
func awsAwsjson11_serializeDocumentTrainingData(v *types.TrainingData, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Assets != nil {
ok := object.Key("Assets")
if err := awsAwsjson11_serializeDocumentAssets(v.Assets, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentUserFaceIdList(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_serializeDocumentVersionNames(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_serializeDocumentVideo(v *types.Video, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3Object != nil {
ok := object.Key("S3Object")
if err := awsAwsjson11_serializeDocumentS3Object(v.S3Object, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssociateFacesInput(v *AssociateFacesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceIds != nil {
ok := object.Key("FaceIds")
if err := awsAwsjson11_serializeDocumentUserFaceIdList(v.FaceIds, ok); err != nil {
return err
}
}
if v.UserId != nil {
ok := object.Key("UserId")
ok.String(*v.UserId)
}
if v.UserMatchThreshold != nil {
ok := object.Key("UserMatchThreshold")
switch {
case math.IsNaN(float64(*v.UserMatchThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.UserMatchThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.UserMatchThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.UserMatchThreshold)
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCompareFacesInput(v *CompareFacesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.QualityFilter) > 0 {
ok := object.Key("QualityFilter")
ok.String(string(v.QualityFilter))
}
if v.SimilarityThreshold != nil {
ok := object.Key("SimilarityThreshold")
switch {
case math.IsNaN(float64(*v.SimilarityThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.SimilarityThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.SimilarityThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.SimilarityThreshold)
}
}
if v.SourceImage != nil {
ok := object.Key("SourceImage")
if err := awsAwsjson11_serializeDocumentImage(v.SourceImage, ok); err != nil {
return err
}
}
if v.TargetImage != nil {
ok := object.Key("TargetImage")
if err := awsAwsjson11_serializeDocumentImage(v.TargetImage, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCopyProjectVersionInput(v *CopyProjectVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DestinationProjectArn != nil {
ok := object.Key("DestinationProjectArn")
ok.String(*v.DestinationProjectArn)
}
if v.KmsKeyId != nil {
ok := object.Key("KmsKeyId")
ok.String(*v.KmsKeyId)
}
if v.OutputConfig != nil {
ok := object.Key("OutputConfig")
if err := awsAwsjson11_serializeDocumentOutputConfig(v.OutputConfig, ok); err != nil {
return err
}
}
if v.SourceProjectArn != nil {
ok := object.Key("SourceProjectArn")
ok.String(*v.SourceProjectArn)
}
if v.SourceProjectVersionArn != nil {
ok := object.Key("SourceProjectVersionArn")
ok.String(*v.SourceProjectVersionArn)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.VersionName != nil {
ok := object.Key("VersionName")
ok.String(*v.VersionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateCollectionInput(v *CreateCollectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateDatasetInput(v *CreateDatasetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DatasetSource != nil {
ok := object.Key("DatasetSource")
if err := awsAwsjson11_serializeDocumentDatasetSource(v.DatasetSource, ok); err != nil {
return err
}
}
if len(v.DatasetType) > 0 {
ok := object.Key("DatasetType")
ok.String(string(v.DatasetType))
}
if v.ProjectArn != nil {
ok := object.Key("ProjectArn")
ok.String(*v.ProjectArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateFaceLivenessSessionInput(v *CreateFaceLivenessSessionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.KmsKeyId != nil {
ok := object.Key("KmsKeyId")
ok.String(*v.KmsKeyId)
}
if v.Settings != nil {
ok := object.Key("Settings")
if err := awsAwsjson11_serializeDocumentCreateFaceLivenessSessionRequestSettings(v.Settings, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProjectName != nil {
ok := object.Key("ProjectName")
ok.String(*v.ProjectName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateProjectVersionInput(v *CreateProjectVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KmsKeyId != nil {
ok := object.Key("KmsKeyId")
ok.String(*v.KmsKeyId)
}
if v.OutputConfig != nil {
ok := object.Key("OutputConfig")
if err := awsAwsjson11_serializeDocumentOutputConfig(v.OutputConfig, ok); err != nil {
return err
}
}
if v.ProjectArn != nil {
ok := object.Key("ProjectArn")
ok.String(*v.ProjectArn)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.TestingData != nil {
ok := object.Key("TestingData")
if err := awsAwsjson11_serializeDocumentTestingData(v.TestingData, ok); err != nil {
return err
}
}
if v.TrainingData != nil {
ok := object.Key("TrainingData")
if err := awsAwsjson11_serializeDocumentTrainingData(v.TrainingData, ok); err != nil {
return err
}
}
if v.VersionName != nil {
ok := object.Key("VersionName")
ok.String(*v.VersionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateStreamProcessorInput(v *CreateStreamProcessorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataSharingPreference != nil {
ok := object.Key("DataSharingPreference")
if err := awsAwsjson11_serializeDocumentStreamProcessorDataSharingPreference(v.DataSharingPreference, ok); err != nil {
return err
}
}
if v.Input != nil {
ok := object.Key("Input")
if err := awsAwsjson11_serializeDocumentStreamProcessorInput(v.Input, 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.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentStreamProcessorNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.Output != nil {
ok := object.Key("Output")
if err := awsAwsjson11_serializeDocumentStreamProcessorOutput(v.Output, ok); err != nil {
return err
}
}
if v.RegionsOfInterest != nil {
ok := object.Key("RegionsOfInterest")
if err := awsAwsjson11_serializeDocumentRegionsOfInterest(v.RegionsOfInterest, ok); err != nil {
return err
}
}
if v.RoleArn != nil {
ok := object.Key("RoleArn")
ok.String(*v.RoleArn)
}
if v.Settings != nil {
ok := object.Key("Settings")
if err := awsAwsjson11_serializeDocumentStreamProcessorSettings(v.Settings, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateUserInput(v *CreateUserInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.UserId != nil {
ok := object.Key("UserId")
ok.String(*v.UserId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteCollectionInput(v *DeleteCollectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteDatasetInput(v *DeleteDatasetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DatasetArn != nil {
ok := object.Key("DatasetArn")
ok.String(*v.DatasetArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteFacesInput(v *DeleteFacesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceIds != nil {
ok := object.Key("FaceIds")
if err := awsAwsjson11_serializeDocumentFaceIdList(v.FaceIds, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteProjectInput(v *DeleteProjectInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProjectArn != nil {
ok := object.Key("ProjectArn")
ok.String(*v.ProjectArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteProjectPolicyInput(v *DeleteProjectPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PolicyName != nil {
ok := object.Key("PolicyName")
ok.String(*v.PolicyName)
}
if v.PolicyRevisionId != nil {
ok := object.Key("PolicyRevisionId")
ok.String(*v.PolicyRevisionId)
}
if v.ProjectArn != nil {
ok := object.Key("ProjectArn")
ok.String(*v.ProjectArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteProjectVersionInput(v *DeleteProjectVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProjectVersionArn != nil {
ok := object.Key("ProjectVersionArn")
ok.String(*v.ProjectVersionArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteStreamProcessorInput(v *DeleteStreamProcessorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteUserInput(v *DeleteUserInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.UserId != nil {
ok := object.Key("UserId")
ok.String(*v.UserId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeCollectionInput(v *DescribeCollectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeDatasetInput(v *DescribeDatasetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DatasetArn != nil {
ok := object.Key("DatasetArn")
ok.String(*v.DatasetArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeProjectsInput(v *DescribeProjectsInput, 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.ProjectNames != nil {
ok := object.Key("ProjectNames")
if err := awsAwsjson11_serializeDocumentProjectNames(v.ProjectNames, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeProjectVersionsInput(v *DescribeProjectVersionsInput, 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.ProjectArn != nil {
ok := object.Key("ProjectArn")
ok.String(*v.ProjectArn)
}
if v.VersionNames != nil {
ok := object.Key("VersionNames")
if err := awsAwsjson11_serializeDocumentVersionNames(v.VersionNames, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeStreamProcessorInput(v *DescribeStreamProcessorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetectCustomLabelsInput(v *DetectCustomLabelsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
if v.ProjectVersionArn != nil {
ok := object.Key("ProjectVersionArn")
ok.String(*v.ProjectVersionArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetectFacesInput(v *DetectFacesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Attributes != nil {
ok := object.Key("Attributes")
if err := awsAwsjson11_serializeDocumentAttributes(v.Attributes, ok); err != nil {
return err
}
}
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetectLabelsInput(v *DetectLabelsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Features != nil {
ok := object.Key("Features")
if err := awsAwsjson11_serializeDocumentDetectLabelsFeatureList(v.Features, ok); err != nil {
return err
}
}
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
if v.MaxLabels != nil {
ok := object.Key("MaxLabels")
ok.Integer(*v.MaxLabels)
}
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
if v.Settings != nil {
ok := object.Key("Settings")
if err := awsAwsjson11_serializeDocumentDetectLabelsSettings(v.Settings, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetectModerationLabelsInput(v *DetectModerationLabelsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HumanLoopConfig != nil {
ok := object.Key("HumanLoopConfig")
if err := awsAwsjson11_serializeDocumentHumanLoopConfig(v.HumanLoopConfig, ok); err != nil {
return err
}
}
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetectProtectiveEquipmentInput(v *DetectProtectiveEquipmentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
if v.SummarizationAttributes != nil {
ok := object.Key("SummarizationAttributes")
if err := awsAwsjson11_serializeDocumentProtectiveEquipmentSummarizationAttributes(v.SummarizationAttributes, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetectTextInput(v *DetectTextInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentDetectTextFilters(v.Filters, ok); err != nil {
return err
}
}
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisassociateFacesInput(v *DisassociateFacesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceIds != nil {
ok := object.Key("FaceIds")
if err := awsAwsjson11_serializeDocumentUserFaceIdList(v.FaceIds, ok); err != nil {
return err
}
}
if v.UserId != nil {
ok := object.Key("UserId")
ok.String(*v.UserId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDistributeDatasetEntriesInput(v *DistributeDatasetEntriesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Datasets != nil {
ok := object.Key("Datasets")
if err := awsAwsjson11_serializeDocumentDistributeDatasetMetadataList(v.Datasets, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetCelebrityInfoInput(v *GetCelebrityInfoInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetCelebrityRecognitionInput(v *GetCelebrityRecognitionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobId != nil {
ok := object.Key("JobId")
ok.String(*v.JobId)
}
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.SortBy) > 0 {
ok := object.Key("SortBy")
ok.String(string(v.SortBy))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetContentModerationInput(v *GetContentModerationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AggregateBy) > 0 {
ok := object.Key("AggregateBy")
ok.String(string(v.AggregateBy))
}
if v.JobId != nil {
ok := object.Key("JobId")
ok.String(*v.JobId)
}
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.SortBy) > 0 {
ok := object.Key("SortBy")
ok.String(string(v.SortBy))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetFaceDetectionInput(v *GetFaceDetectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobId != nil {
ok := object.Key("JobId")
ok.String(*v.JobId)
}
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_serializeOpDocumentGetFaceLivenessSessionResultsInput(v *GetFaceLivenessSessionResultsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SessionId != nil {
ok := object.Key("SessionId")
ok.String(*v.SessionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetFaceSearchInput(v *GetFaceSearchInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobId != nil {
ok := object.Key("JobId")
ok.String(*v.JobId)
}
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.SortBy) > 0 {
ok := object.Key("SortBy")
ok.String(string(v.SortBy))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLabelDetectionInput(v *GetLabelDetectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AggregateBy) > 0 {
ok := object.Key("AggregateBy")
ok.String(string(v.AggregateBy))
}
if v.JobId != nil {
ok := object.Key("JobId")
ok.String(*v.JobId)
}
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.SortBy) > 0 {
ok := object.Key("SortBy")
ok.String(string(v.SortBy))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetPersonTrackingInput(v *GetPersonTrackingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobId != nil {
ok := object.Key("JobId")
ok.String(*v.JobId)
}
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.SortBy) > 0 {
ok := object.Key("SortBy")
ok.String(string(v.SortBy))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetSegmentDetectionInput(v *GetSegmentDetectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobId != nil {
ok := object.Key("JobId")
ok.String(*v.JobId)
}
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_serializeOpDocumentGetTextDetectionInput(v *GetTextDetectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobId != nil {
ok := object.Key("JobId")
ok.String(*v.JobId)
}
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_serializeOpDocumentIndexFacesInput(v *IndexFacesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.DetectionAttributes != nil {
ok := object.Key("DetectionAttributes")
if err := awsAwsjson11_serializeDocumentAttributes(v.DetectionAttributes, ok); err != nil {
return err
}
}
if v.ExternalImageId != nil {
ok := object.Key("ExternalImageId")
ok.String(*v.ExternalImageId)
}
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
if v.MaxFaces != nil {
ok := object.Key("MaxFaces")
ok.Integer(*v.MaxFaces)
}
if len(v.QualityFilter) > 0 {
ok := object.Key("QualityFilter")
ok.String(string(v.QualityFilter))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListCollectionsInput(v *ListCollectionsInput, 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_serializeOpDocumentListDatasetEntriesInput(v *ListDatasetEntriesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainsLabels != nil {
ok := object.Key("ContainsLabels")
if err := awsAwsjson11_serializeDocumentDatasetLabels(v.ContainsLabels, ok); err != nil {
return err
}
}
if v.DatasetArn != nil {
ok := object.Key("DatasetArn")
ok.String(*v.DatasetArn)
}
if v.HasErrors != nil {
ok := object.Key("HasErrors")
ok.Boolean(*v.HasErrors)
}
if v.Labeled != nil {
ok := object.Key("Labeled")
ok.Boolean(*v.Labeled)
}
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.SourceRefContains != nil {
ok := object.Key("SourceRefContains")
ok.String(*v.SourceRefContains)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListDatasetLabelsInput(v *ListDatasetLabelsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DatasetArn != nil {
ok := object.Key("DatasetArn")
ok.String(*v.DatasetArn)
}
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_serializeOpDocumentListFacesInput(v *ListFacesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceIds != nil {
ok := object.Key("FaceIds")
if err := awsAwsjson11_serializeDocumentFaceIdList(v.FaceIds, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if v.UserId != nil {
ok := object.Key("UserId")
ok.String(*v.UserId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListProjectPoliciesInput(v *ListProjectPoliciesInput, 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.ProjectArn != nil {
ok := object.Key("ProjectArn")
ok.String(*v.ProjectArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListStreamProcessorsInput(v *ListStreamProcessorsInput, 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_serializeOpDocumentListUsersInput(v *ListUsersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
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_serializeOpDocumentPutProjectPolicyInput(v *PutProjectPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PolicyDocument != nil {
ok := object.Key("PolicyDocument")
ok.String(*v.PolicyDocument)
}
if v.PolicyName != nil {
ok := object.Key("PolicyName")
ok.String(*v.PolicyName)
}
if v.PolicyRevisionId != nil {
ok := object.Key("PolicyRevisionId")
ok.String(*v.PolicyRevisionId)
}
if v.ProjectArn != nil {
ok := object.Key("ProjectArn")
ok.String(*v.ProjectArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRecognizeCelebritiesInput(v *RecognizeCelebritiesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchFacesByImageInput(v *SearchFacesByImageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceMatchThreshold != nil {
ok := object.Key("FaceMatchThreshold")
switch {
case math.IsNaN(float64(*v.FaceMatchThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.FaceMatchThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.FaceMatchThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.FaceMatchThreshold)
}
}
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
if v.MaxFaces != nil {
ok := object.Key("MaxFaces")
ok.Integer(*v.MaxFaces)
}
if len(v.QualityFilter) > 0 {
ok := object.Key("QualityFilter")
ok.String(string(v.QualityFilter))
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchFacesInput(v *SearchFacesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceId != nil {
ok := object.Key("FaceId")
ok.String(*v.FaceId)
}
if v.FaceMatchThreshold != nil {
ok := object.Key("FaceMatchThreshold")
switch {
case math.IsNaN(float64(*v.FaceMatchThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.FaceMatchThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.FaceMatchThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.FaceMatchThreshold)
}
}
if v.MaxFaces != nil {
ok := object.Key("MaxFaces")
ok.Integer(*v.MaxFaces)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchUsersByImageInput(v *SearchUsersByImageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.Image != nil {
ok := object.Key("Image")
if err := awsAwsjson11_serializeDocumentImage(v.Image, ok); err != nil {
return err
}
}
if v.MaxUsers != nil {
ok := object.Key("MaxUsers")
ok.Integer(*v.MaxUsers)
}
if len(v.QualityFilter) > 0 {
ok := object.Key("QualityFilter")
ok.String(string(v.QualityFilter))
}
if v.UserMatchThreshold != nil {
ok := object.Key("UserMatchThreshold")
switch {
case math.IsNaN(float64(*v.UserMatchThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.UserMatchThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.UserMatchThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.UserMatchThreshold)
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchUsersInput(v *SearchUsersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceId != nil {
ok := object.Key("FaceId")
ok.String(*v.FaceId)
}
if v.MaxUsers != nil {
ok := object.Key("MaxUsers")
ok.Integer(*v.MaxUsers)
}
if v.UserId != nil {
ok := object.Key("UserId")
ok.String(*v.UserId)
}
if v.UserMatchThreshold != nil {
ok := object.Key("UserMatchThreshold")
switch {
case math.IsNaN(float64(*v.UserMatchThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.UserMatchThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.UserMatchThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.UserMatchThreshold)
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartCelebrityRecognitionInput(v *StartCelebrityRecognitionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.JobTag != nil {
ok := object.Key("JobTag")
ok.String(*v.JobTag)
}
if v.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.Video != nil {
ok := object.Key("Video")
if err := awsAwsjson11_serializeDocumentVideo(v.Video, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartContentModerationInput(v *StartContentModerationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.JobTag != nil {
ok := object.Key("JobTag")
ok.String(*v.JobTag)
}
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
if v.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.Video != nil {
ok := object.Key("Video")
if err := awsAwsjson11_serializeDocumentVideo(v.Video, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartFaceDetectionInput(v *StartFaceDetectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if len(v.FaceAttributes) > 0 {
ok := object.Key("FaceAttributes")
ok.String(string(v.FaceAttributes))
}
if v.JobTag != nil {
ok := object.Key("JobTag")
ok.String(*v.JobTag)
}
if v.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.Video != nil {
ok := object.Key("Video")
if err := awsAwsjson11_serializeDocumentVideo(v.Video, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartFaceSearchInput(v *StartFaceSearchInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.CollectionId != nil {
ok := object.Key("CollectionId")
ok.String(*v.CollectionId)
}
if v.FaceMatchThreshold != nil {
ok := object.Key("FaceMatchThreshold")
switch {
case math.IsNaN(float64(*v.FaceMatchThreshold)):
ok.String("NaN")
case math.IsInf(float64(*v.FaceMatchThreshold), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.FaceMatchThreshold), -1):
ok.String("-Infinity")
default:
ok.Float(*v.FaceMatchThreshold)
}
}
if v.JobTag != nil {
ok := object.Key("JobTag")
ok.String(*v.JobTag)
}
if v.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.Video != nil {
ok := object.Key("Video")
if err := awsAwsjson11_serializeDocumentVideo(v.Video, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartLabelDetectionInput(v *StartLabelDetectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.Features != nil {
ok := object.Key("Features")
if err := awsAwsjson11_serializeDocumentLabelDetectionFeatureList(v.Features, ok); err != nil {
return err
}
}
if v.JobTag != nil {
ok := object.Key("JobTag")
ok.String(*v.JobTag)
}
if v.MinConfidence != nil {
ok := object.Key("MinConfidence")
switch {
case math.IsNaN(float64(*v.MinConfidence)):
ok.String("NaN")
case math.IsInf(float64(*v.MinConfidence), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.MinConfidence), -1):
ok.String("-Infinity")
default:
ok.Float(*v.MinConfidence)
}
}
if v.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.Settings != nil {
ok := object.Key("Settings")
if err := awsAwsjson11_serializeDocumentLabelDetectionSettings(v.Settings, ok); err != nil {
return err
}
}
if v.Video != nil {
ok := object.Key("Video")
if err := awsAwsjson11_serializeDocumentVideo(v.Video, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartPersonTrackingInput(v *StartPersonTrackingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.JobTag != nil {
ok := object.Key("JobTag")
ok.String(*v.JobTag)
}
if v.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.Video != nil {
ok := object.Key("Video")
if err := awsAwsjson11_serializeDocumentVideo(v.Video, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartProjectVersionInput(v *StartProjectVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxInferenceUnits != nil {
ok := object.Key("MaxInferenceUnits")
ok.Integer(*v.MaxInferenceUnits)
}
if v.MinInferenceUnits != nil {
ok := object.Key("MinInferenceUnits")
ok.Integer(*v.MinInferenceUnits)
}
if v.ProjectVersionArn != nil {
ok := object.Key("ProjectVersionArn")
ok.String(*v.ProjectVersionArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartSegmentDetectionInput(v *StartSegmentDetectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentStartSegmentDetectionFilters(v.Filters, ok); err != nil {
return err
}
}
if v.JobTag != nil {
ok := object.Key("JobTag")
ok.String(*v.JobTag)
}
if v.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.SegmentTypes != nil {
ok := object.Key("SegmentTypes")
if err := awsAwsjson11_serializeDocumentSegmentTypes(v.SegmentTypes, ok); err != nil {
return err
}
}
if v.Video != nil {
ok := object.Key("Video")
if err := awsAwsjson11_serializeDocumentVideo(v.Video, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartStreamProcessorInput(v *StartStreamProcessorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.StartSelector != nil {
ok := object.Key("StartSelector")
if err := awsAwsjson11_serializeDocumentStreamProcessingStartSelector(v.StartSelector, ok); err != nil {
return err
}
}
if v.StopSelector != nil {
ok := object.Key("StopSelector")
if err := awsAwsjson11_serializeDocumentStreamProcessingStopSelector(v.StopSelector, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartTextDetectionInput(v *StartTextDetectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("ClientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentStartTextDetectionFilters(v.Filters, ok); err != nil {
return err
}
}
if v.JobTag != nil {
ok := object.Key("JobTag")
ok.String(*v.JobTag)
}
if v.NotificationChannel != nil {
ok := object.Key("NotificationChannel")
if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil {
return err
}
}
if v.Video != nil {
ok := object.Key("Video")
if err := awsAwsjson11_serializeDocumentVideo(v.Video, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopProjectVersionInput(v *StopProjectVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProjectVersionArn != nil {
ok := object.Key("ProjectVersionArn")
ok.String(*v.ProjectVersionArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopStreamProcessorInput(v *StopStreamProcessorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, 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_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateDatasetEntriesInput(v *UpdateDatasetEntriesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Changes != nil {
ok := object.Key("Changes")
if err := awsAwsjson11_serializeDocumentDatasetChanges(v.Changes, ok); err != nil {
return err
}
}
if v.DatasetArn != nil {
ok := object.Key("DatasetArn")
ok.String(*v.DatasetArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateStreamProcessorInput(v *UpdateStreamProcessorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataSharingPreferenceForUpdate != nil {
ok := object.Key("DataSharingPreferenceForUpdate")
if err := awsAwsjson11_serializeDocumentStreamProcessorDataSharingPreference(v.DataSharingPreferenceForUpdate, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.ParametersToDelete != nil {
ok := object.Key("ParametersToDelete")
if err := awsAwsjson11_serializeDocumentStreamProcessorParametersToDelete(v.ParametersToDelete, ok); err != nil {
return err
}
}
if v.RegionsOfInterestForUpdate != nil {
ok := object.Key("RegionsOfInterestForUpdate")
if err := awsAwsjson11_serializeDocumentRegionsOfInterest(v.RegionsOfInterestForUpdate, ok); err != nil {
return err
}
}
if v.SettingsForUpdate != nil {
ok := object.Key("SettingsForUpdate")
if err := awsAwsjson11_serializeDocumentStreamProcessorSettingsForUpdate(v.SettingsForUpdate, ok); err != nil {
return err
}
}
return nil
}
| 7,236 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/rekognition/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssociateFaces struct {
}
func (*validateOpAssociateFaces) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateFaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateFacesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateFacesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCompareFaces struct {
}
func (*validateOpCompareFaces) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCompareFaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CompareFacesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCompareFacesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCopyProjectVersion struct {
}
func (*validateOpCopyProjectVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCopyProjectVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CopyProjectVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCopyProjectVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCollection struct {
}
func (*validateOpCreateCollection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCollectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCollectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDataset struct {
}
func (*validateOpCreateDataset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDatasetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateFaceLivenessSession struct {
}
func (*validateOpCreateFaceLivenessSession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateFaceLivenessSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateFaceLivenessSessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateFaceLivenessSessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateProject struct {
}
func (*validateOpCreateProject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateProjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateProjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateProjectVersion struct {
}
func (*validateOpCreateProjectVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateProjectVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateProjectVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateProjectVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateStreamProcessor struct {
}
func (*validateOpCreateStreamProcessor) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateStreamProcessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateStreamProcessorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateStreamProcessorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateUser struct {
}
func (*validateOpCreateUser) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateUserInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateUserInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCollection struct {
}
func (*validateOpDeleteCollection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCollectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCollectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDataset struct {
}
func (*validateOpDeleteDataset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDatasetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFaces struct {
}
func (*validateOpDeleteFaces) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFacesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFacesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteProject struct {
}
func (*validateOpDeleteProject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteProjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteProjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteProjectPolicy struct {
}
func (*validateOpDeleteProjectPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteProjectPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteProjectPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteProjectPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteProjectVersion struct {
}
func (*validateOpDeleteProjectVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteProjectVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteProjectVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteProjectVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteStreamProcessor struct {
}
func (*validateOpDeleteStreamProcessor) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteStreamProcessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteStreamProcessorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteStreamProcessorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteUser struct {
}
func (*validateOpDeleteUser) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteUserInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteUserInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeCollection struct {
}
func (*validateOpDescribeCollection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeCollectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeCollectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeDataset struct {
}
func (*validateOpDescribeDataset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeDatasetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeProjectVersions struct {
}
func (*validateOpDescribeProjectVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeProjectVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeProjectVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeProjectVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeStreamProcessor struct {
}
func (*validateOpDescribeStreamProcessor) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeStreamProcessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeStreamProcessorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeStreamProcessorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetectCustomLabels struct {
}
func (*validateOpDetectCustomLabels) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetectCustomLabels) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetectCustomLabelsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetectCustomLabelsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetectFaces struct {
}
func (*validateOpDetectFaces) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetectFaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetectFacesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetectFacesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetectLabels struct {
}
func (*validateOpDetectLabels) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetectLabels) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetectLabelsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetectLabelsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetectModerationLabels struct {
}
func (*validateOpDetectModerationLabels) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetectModerationLabels) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetectModerationLabelsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetectModerationLabelsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetectProtectiveEquipment struct {
}
func (*validateOpDetectProtectiveEquipment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetectProtectiveEquipment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetectProtectiveEquipmentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetectProtectiveEquipmentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetectText struct {
}
func (*validateOpDetectText) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetectText) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetectTextInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetectTextInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateFaces struct {
}
func (*validateOpDisassociateFaces) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateFaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateFacesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateFacesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDistributeDatasetEntries struct {
}
func (*validateOpDistributeDatasetEntries) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDistributeDatasetEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DistributeDatasetEntriesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDistributeDatasetEntriesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCelebrityInfo struct {
}
func (*validateOpGetCelebrityInfo) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCelebrityInfo) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCelebrityInfoInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCelebrityInfoInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCelebrityRecognition struct {
}
func (*validateOpGetCelebrityRecognition) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCelebrityRecognition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCelebrityRecognitionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCelebrityRecognitionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContentModeration struct {
}
func (*validateOpGetContentModeration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContentModeration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContentModerationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContentModerationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFaceDetection struct {
}
func (*validateOpGetFaceDetection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFaceDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFaceDetectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFaceDetectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFaceLivenessSessionResults struct {
}
func (*validateOpGetFaceLivenessSessionResults) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFaceLivenessSessionResults) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFaceLivenessSessionResultsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFaceLivenessSessionResultsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFaceSearch struct {
}
func (*validateOpGetFaceSearch) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFaceSearch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFaceSearchInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFaceSearchInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLabelDetection struct {
}
func (*validateOpGetLabelDetection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLabelDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLabelDetectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLabelDetectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetPersonTracking struct {
}
func (*validateOpGetPersonTracking) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetPersonTracking) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetPersonTrackingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetPersonTrackingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSegmentDetection struct {
}
func (*validateOpGetSegmentDetection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSegmentDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSegmentDetectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSegmentDetectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetTextDetection struct {
}
func (*validateOpGetTextDetection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetTextDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetTextDetectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetTextDetectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpIndexFaces struct {
}
func (*validateOpIndexFaces) ID() string {
return "OperationInputValidation"
}
func (m *validateOpIndexFaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*IndexFacesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpIndexFacesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListDatasetEntries struct {
}
func (*validateOpListDatasetEntries) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListDatasetEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListDatasetEntriesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListDatasetEntriesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListDatasetLabels struct {
}
func (*validateOpListDatasetLabels) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListDatasetLabels) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListDatasetLabelsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListDatasetLabelsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListFaces struct {
}
func (*validateOpListFaces) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListFaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListFacesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListFacesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListProjectPolicies struct {
}
func (*validateOpListProjectPolicies) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListProjectPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListProjectPoliciesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListProjectPoliciesInput(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 validateOpListUsers struct {
}
func (*validateOpListUsers) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListUsers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListUsersInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListUsersInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutProjectPolicy struct {
}
func (*validateOpPutProjectPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutProjectPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutProjectPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutProjectPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRecognizeCelebrities struct {
}
func (*validateOpRecognizeCelebrities) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRecognizeCelebrities) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RecognizeCelebritiesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRecognizeCelebritiesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchFacesByImage struct {
}
func (*validateOpSearchFacesByImage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchFacesByImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchFacesByImageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchFacesByImageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchFaces struct {
}
func (*validateOpSearchFaces) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchFaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchFacesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchFacesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchUsersByImage struct {
}
func (*validateOpSearchUsersByImage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchUsersByImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchUsersByImageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchUsersByImageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchUsers struct {
}
func (*validateOpSearchUsers) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchUsers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchUsersInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchUsersInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartCelebrityRecognition struct {
}
func (*validateOpStartCelebrityRecognition) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartCelebrityRecognition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartCelebrityRecognitionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartCelebrityRecognitionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartContentModeration struct {
}
func (*validateOpStartContentModeration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartContentModeration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartContentModerationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartContentModerationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartFaceDetection struct {
}
func (*validateOpStartFaceDetection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartFaceDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartFaceDetectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartFaceDetectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartFaceSearch struct {
}
func (*validateOpStartFaceSearch) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartFaceSearch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartFaceSearchInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartFaceSearchInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartLabelDetection struct {
}
func (*validateOpStartLabelDetection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartLabelDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartLabelDetectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartLabelDetectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartPersonTracking struct {
}
func (*validateOpStartPersonTracking) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartPersonTracking) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartPersonTrackingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartPersonTrackingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartProjectVersion struct {
}
func (*validateOpStartProjectVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartProjectVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartProjectVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartProjectVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartSegmentDetection struct {
}
func (*validateOpStartSegmentDetection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartSegmentDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartSegmentDetectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartSegmentDetectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartStreamProcessor struct {
}
func (*validateOpStartStreamProcessor) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartStreamProcessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartStreamProcessorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartStreamProcessorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartTextDetection struct {
}
func (*validateOpStartTextDetection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartTextDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartTextDetectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartTextDetectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopProjectVersion struct {
}
func (*validateOpStopProjectVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopProjectVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopProjectVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopProjectVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopStreamProcessor struct {
}
func (*validateOpStopStreamProcessor) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopStreamProcessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopStreamProcessorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopStreamProcessorInput(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 validateOpUpdateDatasetEntries struct {
}
func (*validateOpUpdateDatasetEntries) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDatasetEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDatasetEntriesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDatasetEntriesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateStreamProcessor struct {
}
func (*validateOpUpdateStreamProcessor) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateStreamProcessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateStreamProcessorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateStreamProcessorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssociateFacesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateFaces{}, middleware.After)
}
func addOpCompareFacesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCompareFaces{}, middleware.After)
}
func addOpCopyProjectVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCopyProjectVersion{}, middleware.After)
}
func addOpCreateCollectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCollection{}, middleware.After)
}
func addOpCreateDatasetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDataset{}, middleware.After)
}
func addOpCreateFaceLivenessSessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateFaceLivenessSession{}, middleware.After)
}
func addOpCreateProjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateProject{}, middleware.After)
}
func addOpCreateProjectVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateProjectVersion{}, middleware.After)
}
func addOpCreateStreamProcessorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateStreamProcessor{}, middleware.After)
}
func addOpCreateUserValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateUser{}, middleware.After)
}
func addOpDeleteCollectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCollection{}, middleware.After)
}
func addOpDeleteDatasetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDataset{}, middleware.After)
}
func addOpDeleteFacesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFaces{}, middleware.After)
}
func addOpDeleteProjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteProject{}, middleware.After)
}
func addOpDeleteProjectPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteProjectPolicy{}, middleware.After)
}
func addOpDeleteProjectVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteProjectVersion{}, middleware.After)
}
func addOpDeleteStreamProcessorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteStreamProcessor{}, middleware.After)
}
func addOpDeleteUserValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteUser{}, middleware.After)
}
func addOpDescribeCollectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeCollection{}, middleware.After)
}
func addOpDescribeDatasetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeDataset{}, middleware.After)
}
func addOpDescribeProjectVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeProjectVersions{}, middleware.After)
}
func addOpDescribeStreamProcessorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeStreamProcessor{}, middleware.After)
}
func addOpDetectCustomLabelsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetectCustomLabels{}, middleware.After)
}
func addOpDetectFacesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetectFaces{}, middleware.After)
}
func addOpDetectLabelsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetectLabels{}, middleware.After)
}
func addOpDetectModerationLabelsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetectModerationLabels{}, middleware.After)
}
func addOpDetectProtectiveEquipmentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetectProtectiveEquipment{}, middleware.After)
}
func addOpDetectTextValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetectText{}, middleware.After)
}
func addOpDisassociateFacesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateFaces{}, middleware.After)
}
func addOpDistributeDatasetEntriesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDistributeDatasetEntries{}, middleware.After)
}
func addOpGetCelebrityInfoValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCelebrityInfo{}, middleware.After)
}
func addOpGetCelebrityRecognitionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCelebrityRecognition{}, middleware.After)
}
func addOpGetContentModerationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContentModeration{}, middleware.After)
}
func addOpGetFaceDetectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFaceDetection{}, middleware.After)
}
func addOpGetFaceLivenessSessionResultsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFaceLivenessSessionResults{}, middleware.After)
}
func addOpGetFaceSearchValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFaceSearch{}, middleware.After)
}
func addOpGetLabelDetectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLabelDetection{}, middleware.After)
}
func addOpGetPersonTrackingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetPersonTracking{}, middleware.After)
}
func addOpGetSegmentDetectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSegmentDetection{}, middleware.After)
}
func addOpGetTextDetectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetTextDetection{}, middleware.After)
}
func addOpIndexFacesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpIndexFaces{}, middleware.After)
}
func addOpListDatasetEntriesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListDatasetEntries{}, middleware.After)
}
func addOpListDatasetLabelsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListDatasetLabels{}, middleware.After)
}
func addOpListFacesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListFaces{}, middleware.After)
}
func addOpListProjectPoliciesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListProjectPolicies{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpListUsersValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListUsers{}, middleware.After)
}
func addOpPutProjectPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutProjectPolicy{}, middleware.After)
}
func addOpRecognizeCelebritiesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRecognizeCelebrities{}, middleware.After)
}
func addOpSearchFacesByImageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchFacesByImage{}, middleware.After)
}
func addOpSearchFacesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchFaces{}, middleware.After)
}
func addOpSearchUsersByImageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchUsersByImage{}, middleware.After)
}
func addOpSearchUsersValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchUsers{}, middleware.After)
}
func addOpStartCelebrityRecognitionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartCelebrityRecognition{}, middleware.After)
}
func addOpStartContentModerationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartContentModeration{}, middleware.After)
}
func addOpStartFaceDetectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartFaceDetection{}, middleware.After)
}
func addOpStartFaceSearchValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartFaceSearch{}, middleware.After)
}
func addOpStartLabelDetectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartLabelDetection{}, middleware.After)
}
func addOpStartPersonTrackingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartPersonTracking{}, middleware.After)
}
func addOpStartProjectVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartProjectVersion{}, middleware.After)
}
func addOpStartSegmentDetectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartSegmentDetection{}, middleware.After)
}
func addOpStartStreamProcessorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartStreamProcessor{}, middleware.After)
}
func addOpStartTextDetectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartTextDetection{}, middleware.After)
}
func addOpStopProjectVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopProjectVersion{}, middleware.After)
}
func addOpStopStreamProcessorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopStreamProcessor{}, 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 addOpUpdateDatasetEntriesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDatasetEntries{}, middleware.After)
}
func addOpUpdateStreamProcessorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateStreamProcessor{}, middleware.After)
}
func validateConnectedHomeSettings(v *types.ConnectedHomeSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConnectedHomeSettings"}
if v.Labels == nil {
invalidParams.Add(smithy.NewErrParamRequired("Labels"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateFaceLivenessSessionRequestSettings(v *types.CreateFaceLivenessSessionRequestSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateFaceLivenessSessionRequestSettings"}
if v.OutputConfig != nil {
if err := validateLivenessOutputConfig(v.OutputConfig); err != nil {
invalidParams.AddNested("OutputConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDatasetChanges(v *types.DatasetChanges) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DatasetChanges"}
if v.GroundTruth == nil {
invalidParams.Add(smithy.NewErrParamRequired("GroundTruth"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDistributeDataset(v *types.DistributeDataset) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DistributeDataset"}
if v.Arn == nil {
invalidParams.Add(smithy.NewErrParamRequired("Arn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDistributeDatasetMetadataList(v []types.DistributeDataset) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DistributeDatasetMetadataList"}
for i := range v {
if err := validateDistributeDataset(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHumanLoopConfig(v *types.HumanLoopConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HumanLoopConfig"}
if v.HumanLoopName == nil {
invalidParams.Add(smithy.NewErrParamRequired("HumanLoopName"))
}
if v.FlowDefinitionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("FlowDefinitionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLivenessOutputConfig(v *types.LivenessOutputConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LivenessOutputConfig"}
if v.S3Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateNotificationChannel(v *types.NotificationChannel) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "NotificationChannel"}
if v.SNSTopicArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SNSTopicArn"))
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProtectiveEquipmentSummarizationAttributes(v *types.ProtectiveEquipmentSummarizationAttributes) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProtectiveEquipmentSummarizationAttributes"}
if v.MinConfidence == nil {
invalidParams.Add(smithy.NewErrParamRequired("MinConfidence"))
}
if v.RequiredEquipmentTypes == nil {
invalidParams.Add(smithy.NewErrParamRequired("RequiredEquipmentTypes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStreamProcessorDataSharingPreference(v *types.StreamProcessorDataSharingPreference) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StreamProcessorDataSharingPreference"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStreamProcessorNotificationChannel(v *types.StreamProcessorNotificationChannel) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StreamProcessorNotificationChannel"}
if v.SNSTopicArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SNSTopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStreamProcessorSettings(v *types.StreamProcessorSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StreamProcessorSettings"}
if v.ConnectedHome != nil {
if err := validateConnectedHomeSettings(v.ConnectedHome); err != nil {
invalidParams.AddNested("ConnectedHome", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateFacesInput(v *AssociateFacesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateFacesInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if v.FaceIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("FaceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCompareFacesInput(v *CompareFacesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CompareFacesInput"}
if v.SourceImage == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceImage"))
}
if v.TargetImage == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetImage"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCopyProjectVersionInput(v *CopyProjectVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CopyProjectVersionInput"}
if v.SourceProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceProjectArn"))
}
if v.SourceProjectVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceProjectVersionArn"))
}
if v.DestinationProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationProjectArn"))
}
if v.VersionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VersionName"))
}
if v.OutputConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutputConfig"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCollectionInput(v *CreateCollectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCollectionInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDatasetInput(v *CreateDatasetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDatasetInput"}
if len(v.DatasetType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DatasetType"))
}
if v.ProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateFaceLivenessSessionInput(v *CreateFaceLivenessSessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateFaceLivenessSessionInput"}
if v.Settings != nil {
if err := validateCreateFaceLivenessSessionRequestSettings(v.Settings); err != nil {
invalidParams.AddNested("Settings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateProjectInput(v *CreateProjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateProjectInput"}
if v.ProjectName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateProjectVersionInput(v *CreateProjectVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateProjectVersionInput"}
if v.ProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectArn"))
}
if v.VersionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VersionName"))
}
if v.OutputConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutputConfig"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateStreamProcessorInput(v *CreateStreamProcessorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateStreamProcessorInput"}
if v.Input == nil {
invalidParams.Add(smithy.NewErrParamRequired("Input"))
}
if v.Output == nil {
invalidParams.Add(smithy.NewErrParamRequired("Output"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Settings == nil {
invalidParams.Add(smithy.NewErrParamRequired("Settings"))
} else if v.Settings != nil {
if err := validateStreamProcessorSettings(v.Settings); err != nil {
invalidParams.AddNested("Settings", err.(smithy.InvalidParamsError))
}
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.NotificationChannel != nil {
if err := validateStreamProcessorNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if v.DataSharingPreference != nil {
if err := validateStreamProcessorDataSharingPreference(v.DataSharingPreference); err != nil {
invalidParams.AddNested("DataSharingPreference", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateUserInput(v *CreateUserInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateUserInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCollectionInput(v *DeleteCollectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCollectionInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDatasetInput(v *DeleteDatasetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDatasetInput"}
if v.DatasetArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFacesInput(v *DeleteFacesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFacesInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.FaceIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("FaceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteProjectInput(v *DeleteProjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteProjectInput"}
if v.ProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteProjectPolicyInput(v *DeleteProjectPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteProjectPolicyInput"}
if v.ProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectArn"))
}
if v.PolicyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteProjectVersionInput(v *DeleteProjectVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteProjectVersionInput"}
if v.ProjectVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteStreamProcessorInput(v *DeleteStreamProcessorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteStreamProcessorInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteUserInput(v *DeleteUserInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteUserInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeCollectionInput(v *DescribeCollectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeCollectionInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeDatasetInput(v *DescribeDatasetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeDatasetInput"}
if v.DatasetArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeProjectVersionsInput(v *DescribeProjectVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeProjectVersionsInput"}
if v.ProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeStreamProcessorInput(v *DescribeStreamProcessorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeStreamProcessorInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetectCustomLabelsInput(v *DetectCustomLabelsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetectCustomLabelsInput"}
if v.ProjectVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectVersionArn"))
}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetectFacesInput(v *DetectFacesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetectFacesInput"}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetectLabelsInput(v *DetectLabelsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetectLabelsInput"}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetectModerationLabelsInput(v *DetectModerationLabelsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetectModerationLabelsInput"}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if v.HumanLoopConfig != nil {
if err := validateHumanLoopConfig(v.HumanLoopConfig); err != nil {
invalidParams.AddNested("HumanLoopConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetectProtectiveEquipmentInput(v *DetectProtectiveEquipmentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetectProtectiveEquipmentInput"}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if v.SummarizationAttributes != nil {
if err := validateProtectiveEquipmentSummarizationAttributes(v.SummarizationAttributes); err != nil {
invalidParams.AddNested("SummarizationAttributes", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetectTextInput(v *DetectTextInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetectTextInput"}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateFacesInput(v *DisassociateFacesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateFacesInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if v.FaceIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("FaceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDistributeDatasetEntriesInput(v *DistributeDatasetEntriesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DistributeDatasetEntriesInput"}
if v.Datasets == nil {
invalidParams.Add(smithy.NewErrParamRequired("Datasets"))
} else if v.Datasets != nil {
if err := validateDistributeDatasetMetadataList(v.Datasets); err != nil {
invalidParams.AddNested("Datasets", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCelebrityInfoInput(v *GetCelebrityInfoInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCelebrityInfoInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCelebrityRecognitionInput(v *GetCelebrityRecognitionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCelebrityRecognitionInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContentModerationInput(v *GetContentModerationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContentModerationInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFaceDetectionInput(v *GetFaceDetectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFaceDetectionInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFaceLivenessSessionResultsInput(v *GetFaceLivenessSessionResultsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFaceLivenessSessionResultsInput"}
if v.SessionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFaceSearchInput(v *GetFaceSearchInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFaceSearchInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLabelDetectionInput(v *GetLabelDetectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLabelDetectionInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetPersonTrackingInput(v *GetPersonTrackingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetPersonTrackingInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSegmentDetectionInput(v *GetSegmentDetectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSegmentDetectionInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetTextDetectionInput(v *GetTextDetectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetTextDetectionInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpIndexFacesInput(v *IndexFacesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IndexFacesInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListDatasetEntriesInput(v *ListDatasetEntriesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListDatasetEntriesInput"}
if v.DatasetArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListDatasetLabelsInput(v *ListDatasetLabelsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListDatasetLabelsInput"}
if v.DatasetArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListFacesInput(v *ListFacesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListFacesInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListProjectPoliciesInput(v *ListProjectPoliciesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListProjectPoliciesInput"}
if v.ProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectArn"))
}
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 validateOpListUsersInput(v *ListUsersInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListUsersInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutProjectPolicyInput(v *PutProjectPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutProjectPolicyInput"}
if v.ProjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectArn"))
}
if v.PolicyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyName"))
}
if v.PolicyDocument == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyDocument"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRecognizeCelebritiesInput(v *RecognizeCelebritiesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RecognizeCelebritiesInput"}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchFacesByImageInput(v *SearchFacesByImageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchFacesByImageInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchFacesInput(v *SearchFacesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchFacesInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.FaceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("FaceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchUsersByImageInput(v *SearchUsersByImageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchUsersByImageInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchUsersInput(v *SearchUsersInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchUsersInput"}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartCelebrityRecognitionInput(v *StartCelebrityRecognitionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartCelebrityRecognitionInput"}
if v.Video == nil {
invalidParams.Add(smithy.NewErrParamRequired("Video"))
}
if v.NotificationChannel != nil {
if err := validateNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartContentModerationInput(v *StartContentModerationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartContentModerationInput"}
if v.Video == nil {
invalidParams.Add(smithy.NewErrParamRequired("Video"))
}
if v.NotificationChannel != nil {
if err := validateNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartFaceDetectionInput(v *StartFaceDetectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartFaceDetectionInput"}
if v.Video == nil {
invalidParams.Add(smithy.NewErrParamRequired("Video"))
}
if v.NotificationChannel != nil {
if err := validateNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartFaceSearchInput(v *StartFaceSearchInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartFaceSearchInput"}
if v.Video == nil {
invalidParams.Add(smithy.NewErrParamRequired("Video"))
}
if v.CollectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionId"))
}
if v.NotificationChannel != nil {
if err := validateNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartLabelDetectionInput(v *StartLabelDetectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartLabelDetectionInput"}
if v.Video == nil {
invalidParams.Add(smithy.NewErrParamRequired("Video"))
}
if v.NotificationChannel != nil {
if err := validateNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartPersonTrackingInput(v *StartPersonTrackingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartPersonTrackingInput"}
if v.Video == nil {
invalidParams.Add(smithy.NewErrParamRequired("Video"))
}
if v.NotificationChannel != nil {
if err := validateNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartProjectVersionInput(v *StartProjectVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartProjectVersionInput"}
if v.ProjectVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectVersionArn"))
}
if v.MinInferenceUnits == nil {
invalidParams.Add(smithy.NewErrParamRequired("MinInferenceUnits"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartSegmentDetectionInput(v *StartSegmentDetectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartSegmentDetectionInput"}
if v.Video == nil {
invalidParams.Add(smithy.NewErrParamRequired("Video"))
}
if v.NotificationChannel != nil {
if err := validateNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if v.SegmentTypes == nil {
invalidParams.Add(smithy.NewErrParamRequired("SegmentTypes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartStreamProcessorInput(v *StartStreamProcessorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartStreamProcessorInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartTextDetectionInput(v *StartTextDetectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartTextDetectionInput"}
if v.Video == nil {
invalidParams.Add(smithy.NewErrParamRequired("Video"))
}
if v.NotificationChannel != nil {
if err := validateNotificationChannel(v.NotificationChannel); err != nil {
invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopProjectVersionInput(v *StopProjectVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopProjectVersionInput"}
if v.ProjectVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopStreamProcessorInput(v *StopStreamProcessorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopStreamProcessorInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
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 validateOpUpdateDatasetEntriesInput(v *UpdateDatasetEntriesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDatasetEntriesInput"}
if v.DatasetArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetArn"))
}
if v.Changes == nil {
invalidParams.Add(smithy.NewErrParamRequired("Changes"))
} else if v.Changes != nil {
if err := validateDatasetChanges(v.Changes); err != nil {
invalidParams.AddNested("Changes", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateStreamProcessorInput(v *UpdateStreamProcessorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateStreamProcessorInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.DataSharingPreferenceForUpdate != nil {
if err := validateStreamProcessorDataSharingPreference(v.DataSharingPreferenceForUpdate); err != nil {
invalidParams.AddNested("DataSharingPreferenceForUpdate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 3,073 |
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 Rekognition 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: "rekognition.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "rekognition-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "rekognition.{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-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.ca-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ca-central-1-fips",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "rekognition-fips.ca-central-1",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition-fips.us-east-1",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition-fips.us-east-2",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition-fips.us-west-1",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition-fips.us-west-2",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.ca-central-1",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-east-1",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-east-2",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-west-1",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-west-2",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-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: "rekognition-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-1-fips",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2-fips",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1-fips",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.us-west-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2-fips",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "rekognition.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "rekognition-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "rekognition.{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: "rekognition-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "rekognition.{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: "rekognition-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "rekognition.{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: "rekognition-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "rekognition.{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: "rekognition-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "rekognition.{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: "rekognition.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "rekognition-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "rekognition.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "rekognition-fips.us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-gov-west-1",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "rekognition.us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "rekognition-fips.us-gov-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1-fips",
}: endpoints.Endpoint{
Hostname: "rekognition-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
},
},
}
| 595 |
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 Attribute string
// Enum values for Attribute
const (
AttributeDefault Attribute = "DEFAULT"
AttributeAll Attribute = "ALL"
AttributeAgeRange Attribute = "AGE_RANGE"
AttributeBeard Attribute = "BEARD"
AttributeEmotions Attribute = "EMOTIONS"
AttributeEyeDirection Attribute = "EYE_DIRECTION"
AttributeEyeglasses Attribute = "EYEGLASSES"
AttributeEyesOpen Attribute = "EYES_OPEN"
AttributeGender Attribute = "GENDER"
AttributeMouthOpen Attribute = "MOUTH_OPEN"
AttributeMustache Attribute = "MUSTACHE"
AttributeFaceOccluded Attribute = "FACE_OCCLUDED"
AttributeSmile Attribute = "SMILE"
AttributeSunglasses Attribute = "SUNGLASSES"
)
// Values returns all known values for Attribute. 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 (Attribute) Values() []Attribute {
return []Attribute{
"DEFAULT",
"ALL",
"AGE_RANGE",
"BEARD",
"EMOTIONS",
"EYE_DIRECTION",
"EYEGLASSES",
"EYES_OPEN",
"GENDER",
"MOUTH_OPEN",
"MUSTACHE",
"FACE_OCCLUDED",
"SMILE",
"SUNGLASSES",
}
}
type BodyPart string
// Enum values for BodyPart
const (
BodyPartFace BodyPart = "FACE"
BodyPartHead BodyPart = "HEAD"
BodyPartLeftHand BodyPart = "LEFT_HAND"
BodyPartRightHand BodyPart = "RIGHT_HAND"
)
// Values returns all known values for BodyPart. 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 (BodyPart) Values() []BodyPart {
return []BodyPart{
"FACE",
"HEAD",
"LEFT_HAND",
"RIGHT_HAND",
}
}
type CelebrityRecognitionSortBy string
// Enum values for CelebrityRecognitionSortBy
const (
CelebrityRecognitionSortById CelebrityRecognitionSortBy = "ID"
CelebrityRecognitionSortByTimestamp CelebrityRecognitionSortBy = "TIMESTAMP"
)
// Values returns all known values for CelebrityRecognitionSortBy. 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 (CelebrityRecognitionSortBy) Values() []CelebrityRecognitionSortBy {
return []CelebrityRecognitionSortBy{
"ID",
"TIMESTAMP",
}
}
type ContentClassifier string
// Enum values for ContentClassifier
const (
ContentClassifierFreeOfPersonallyIdentifiableInformation ContentClassifier = "FreeOfPersonallyIdentifiableInformation"
ContentClassifierFreeOfAdultContent ContentClassifier = "FreeOfAdultContent"
)
// Values returns all known values for ContentClassifier. 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 (ContentClassifier) Values() []ContentClassifier {
return []ContentClassifier{
"FreeOfPersonallyIdentifiableInformation",
"FreeOfAdultContent",
}
}
type ContentModerationAggregateBy string
// Enum values for ContentModerationAggregateBy
const (
ContentModerationAggregateByTimestamps ContentModerationAggregateBy = "TIMESTAMPS"
ContentModerationAggregateBySegments ContentModerationAggregateBy = "SEGMENTS"
)
// Values returns all known values for ContentModerationAggregateBy. 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 (ContentModerationAggregateBy) Values() []ContentModerationAggregateBy {
return []ContentModerationAggregateBy{
"TIMESTAMPS",
"SEGMENTS",
}
}
type ContentModerationSortBy string
// Enum values for ContentModerationSortBy
const (
ContentModerationSortByName ContentModerationSortBy = "NAME"
ContentModerationSortByTimestamp ContentModerationSortBy = "TIMESTAMP"
)
// Values returns all known values for ContentModerationSortBy. 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 (ContentModerationSortBy) Values() []ContentModerationSortBy {
return []ContentModerationSortBy{
"NAME",
"TIMESTAMP",
}
}
type DatasetStatus string
// Enum values for DatasetStatus
const (
DatasetStatusCreateInProgress DatasetStatus = "CREATE_IN_PROGRESS"
DatasetStatusCreateComplete DatasetStatus = "CREATE_COMPLETE"
DatasetStatusCreateFailed DatasetStatus = "CREATE_FAILED"
DatasetStatusUpdateInProgress DatasetStatus = "UPDATE_IN_PROGRESS"
DatasetStatusUpdateComplete DatasetStatus = "UPDATE_COMPLETE"
DatasetStatusUpdateFailed DatasetStatus = "UPDATE_FAILED"
DatasetStatusDeleteInProgress DatasetStatus = "DELETE_IN_PROGRESS"
)
// Values returns all known values for DatasetStatus. 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 (DatasetStatus) Values() []DatasetStatus {
return []DatasetStatus{
"CREATE_IN_PROGRESS",
"CREATE_COMPLETE",
"CREATE_FAILED",
"UPDATE_IN_PROGRESS",
"UPDATE_COMPLETE",
"UPDATE_FAILED",
"DELETE_IN_PROGRESS",
}
}
type DatasetStatusMessageCode string
// Enum values for DatasetStatusMessageCode
const (
DatasetStatusMessageCodeSuccess DatasetStatusMessageCode = "SUCCESS"
DatasetStatusMessageCodeServiceError DatasetStatusMessageCode = "SERVICE_ERROR"
DatasetStatusMessageCodeClientError DatasetStatusMessageCode = "CLIENT_ERROR"
)
// Values returns all known values for DatasetStatusMessageCode. 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 (DatasetStatusMessageCode) Values() []DatasetStatusMessageCode {
return []DatasetStatusMessageCode{
"SUCCESS",
"SERVICE_ERROR",
"CLIENT_ERROR",
}
}
type DatasetType string
// Enum values for DatasetType
const (
DatasetTypeTrain DatasetType = "TRAIN"
DatasetTypeTest DatasetType = "TEST"
)
// Values returns all known values for DatasetType. 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 (DatasetType) Values() []DatasetType {
return []DatasetType{
"TRAIN",
"TEST",
}
}
type DetectLabelsFeatureName string
// Enum values for DetectLabelsFeatureName
const (
DetectLabelsFeatureNameGeneralLabels DetectLabelsFeatureName = "GENERAL_LABELS"
DetectLabelsFeatureNameImageProperties DetectLabelsFeatureName = "IMAGE_PROPERTIES"
)
// Values returns all known values for DetectLabelsFeatureName. 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 (DetectLabelsFeatureName) Values() []DetectLabelsFeatureName {
return []DetectLabelsFeatureName{
"GENERAL_LABELS",
"IMAGE_PROPERTIES",
}
}
type EmotionName string
// Enum values for EmotionName
const (
EmotionNameHappy EmotionName = "HAPPY"
EmotionNameSad EmotionName = "SAD"
EmotionNameAngry EmotionName = "ANGRY"
EmotionNameConfused EmotionName = "CONFUSED"
EmotionNameDisgusted EmotionName = "DISGUSTED"
EmotionNameSurprised EmotionName = "SURPRISED"
EmotionNameCalm EmotionName = "CALM"
EmotionNameUnknown EmotionName = "UNKNOWN"
EmotionNameFear EmotionName = "FEAR"
)
// Values returns all known values for EmotionName. 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 (EmotionName) Values() []EmotionName {
return []EmotionName{
"HAPPY",
"SAD",
"ANGRY",
"CONFUSED",
"DISGUSTED",
"SURPRISED",
"CALM",
"UNKNOWN",
"FEAR",
}
}
type FaceAttributes string
// Enum values for FaceAttributes
const (
FaceAttributesDefault FaceAttributes = "DEFAULT"
FaceAttributesAll FaceAttributes = "ALL"
)
// Values returns all known values for FaceAttributes. 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 (FaceAttributes) Values() []FaceAttributes {
return []FaceAttributes{
"DEFAULT",
"ALL",
}
}
type FaceSearchSortBy string
// Enum values for FaceSearchSortBy
const (
FaceSearchSortByIndex FaceSearchSortBy = "INDEX"
FaceSearchSortByTimestamp FaceSearchSortBy = "TIMESTAMP"
)
// Values returns all known values for FaceSearchSortBy. 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 (FaceSearchSortBy) Values() []FaceSearchSortBy {
return []FaceSearchSortBy{
"INDEX",
"TIMESTAMP",
}
}
type GenderType string
// Enum values for GenderType
const (
GenderTypeMale GenderType = "Male"
GenderTypeFemale GenderType = "Female"
)
// Values returns all known values for GenderType. 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 (GenderType) Values() []GenderType {
return []GenderType{
"Male",
"Female",
}
}
type KnownGenderType string
// Enum values for KnownGenderType
const (
KnownGenderTypeMale KnownGenderType = "Male"
KnownGenderTypeFemale KnownGenderType = "Female"
KnownGenderTypeNonbinary KnownGenderType = "Nonbinary"
KnownGenderTypeUnlisted KnownGenderType = "Unlisted"
)
// Values returns all known values for KnownGenderType. 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 (KnownGenderType) Values() []KnownGenderType {
return []KnownGenderType{
"Male",
"Female",
"Nonbinary",
"Unlisted",
}
}
type LabelDetectionAggregateBy string
// Enum values for LabelDetectionAggregateBy
const (
LabelDetectionAggregateByTimestamps LabelDetectionAggregateBy = "TIMESTAMPS"
LabelDetectionAggregateBySegments LabelDetectionAggregateBy = "SEGMENTS"
)
// Values returns all known values for LabelDetectionAggregateBy. 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 (LabelDetectionAggregateBy) Values() []LabelDetectionAggregateBy {
return []LabelDetectionAggregateBy{
"TIMESTAMPS",
"SEGMENTS",
}
}
type LabelDetectionFeatureName string
// Enum values for LabelDetectionFeatureName
const (
LabelDetectionFeatureNameGeneralLabels LabelDetectionFeatureName = "GENERAL_LABELS"
)
// Values returns all known values for LabelDetectionFeatureName. 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 (LabelDetectionFeatureName) Values() []LabelDetectionFeatureName {
return []LabelDetectionFeatureName{
"GENERAL_LABELS",
}
}
type LabelDetectionSortBy string
// Enum values for LabelDetectionSortBy
const (
LabelDetectionSortByName LabelDetectionSortBy = "NAME"
LabelDetectionSortByTimestamp LabelDetectionSortBy = "TIMESTAMP"
)
// Values returns all known values for LabelDetectionSortBy. 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 (LabelDetectionSortBy) Values() []LabelDetectionSortBy {
return []LabelDetectionSortBy{
"NAME",
"TIMESTAMP",
}
}
type LandmarkType string
// Enum values for LandmarkType
const (
LandmarkTypeEyeLeft LandmarkType = "eyeLeft"
LandmarkTypeEyeRight LandmarkType = "eyeRight"
LandmarkTypeNose LandmarkType = "nose"
LandmarkTypeMouthLeft LandmarkType = "mouthLeft"
LandmarkTypeMouthRight LandmarkType = "mouthRight"
LandmarkTypeLeftEyeBrowLeft LandmarkType = "leftEyeBrowLeft"
LandmarkTypeLeftEyeBrowRight LandmarkType = "leftEyeBrowRight"
LandmarkTypeLeftEyeBrowUp LandmarkType = "leftEyeBrowUp"
LandmarkTypeRightEyeBrowLeft LandmarkType = "rightEyeBrowLeft"
LandmarkTypeRightEyeBrowRight LandmarkType = "rightEyeBrowRight"
LandmarkTypeRightEyeBrowUp LandmarkType = "rightEyeBrowUp"
LandmarkTypeLeftEyeLeft LandmarkType = "leftEyeLeft"
LandmarkTypeLeftEyeRight LandmarkType = "leftEyeRight"
LandmarkTypeLeftEyeUp LandmarkType = "leftEyeUp"
LandmarkTypeLeftEyeDown LandmarkType = "leftEyeDown"
LandmarkTypeRightEyeLeft LandmarkType = "rightEyeLeft"
LandmarkTypeRightEyeRight LandmarkType = "rightEyeRight"
LandmarkTypeRightEyeUp LandmarkType = "rightEyeUp"
LandmarkTypeRightEyeDown LandmarkType = "rightEyeDown"
LandmarkTypeNoseLeft LandmarkType = "noseLeft"
LandmarkTypeNoseRight LandmarkType = "noseRight"
LandmarkTypeMouthUp LandmarkType = "mouthUp"
LandmarkTypeMouthDown LandmarkType = "mouthDown"
LandmarkTypeLeftPupil LandmarkType = "leftPupil"
LandmarkTypeRightPupil LandmarkType = "rightPupil"
LandmarkTypeUpperJawlineLeft LandmarkType = "upperJawlineLeft"
LandmarkTypeMidJawlineLeft LandmarkType = "midJawlineLeft"
LandmarkTypeChinBottom LandmarkType = "chinBottom"
LandmarkTypeMidJawlineRight LandmarkType = "midJawlineRight"
LandmarkTypeUpperJawlineRight LandmarkType = "upperJawlineRight"
)
// Values returns all known values for LandmarkType. 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 (LandmarkType) Values() []LandmarkType {
return []LandmarkType{
"eyeLeft",
"eyeRight",
"nose",
"mouthLeft",
"mouthRight",
"leftEyeBrowLeft",
"leftEyeBrowRight",
"leftEyeBrowUp",
"rightEyeBrowLeft",
"rightEyeBrowRight",
"rightEyeBrowUp",
"leftEyeLeft",
"leftEyeRight",
"leftEyeUp",
"leftEyeDown",
"rightEyeLeft",
"rightEyeRight",
"rightEyeUp",
"rightEyeDown",
"noseLeft",
"noseRight",
"mouthUp",
"mouthDown",
"leftPupil",
"rightPupil",
"upperJawlineLeft",
"midJawlineLeft",
"chinBottom",
"midJawlineRight",
"upperJawlineRight",
}
}
type LivenessSessionStatus string
// Enum values for LivenessSessionStatus
const (
LivenessSessionStatusCreated LivenessSessionStatus = "CREATED"
LivenessSessionStatusInProgress LivenessSessionStatus = "IN_PROGRESS"
LivenessSessionStatusSucceeded LivenessSessionStatus = "SUCCEEDED"
LivenessSessionStatusFailed LivenessSessionStatus = "FAILED"
LivenessSessionStatusExpired LivenessSessionStatus = "EXPIRED"
)
// Values returns all known values for LivenessSessionStatus. 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 (LivenessSessionStatus) Values() []LivenessSessionStatus {
return []LivenessSessionStatus{
"CREATED",
"IN_PROGRESS",
"SUCCEEDED",
"FAILED",
"EXPIRED",
}
}
type OrientationCorrection string
// Enum values for OrientationCorrection
const (
OrientationCorrectionRotate0 OrientationCorrection = "ROTATE_0"
OrientationCorrectionRotate90 OrientationCorrection = "ROTATE_90"
OrientationCorrectionRotate180 OrientationCorrection = "ROTATE_180"
OrientationCorrectionRotate270 OrientationCorrection = "ROTATE_270"
)
// Values returns all known values for OrientationCorrection. 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 (OrientationCorrection) Values() []OrientationCorrection {
return []OrientationCorrection{
"ROTATE_0",
"ROTATE_90",
"ROTATE_180",
"ROTATE_270",
}
}
type PersonTrackingSortBy string
// Enum values for PersonTrackingSortBy
const (
PersonTrackingSortByIndex PersonTrackingSortBy = "INDEX"
PersonTrackingSortByTimestamp PersonTrackingSortBy = "TIMESTAMP"
)
// Values returns all known values for PersonTrackingSortBy. 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 (PersonTrackingSortBy) Values() []PersonTrackingSortBy {
return []PersonTrackingSortBy{
"INDEX",
"TIMESTAMP",
}
}
type ProjectStatus string
// Enum values for ProjectStatus
const (
ProjectStatusCreating ProjectStatus = "CREATING"
ProjectStatusCreated ProjectStatus = "CREATED"
ProjectStatusDeleting ProjectStatus = "DELETING"
)
// Values returns all known values for ProjectStatus. 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 (ProjectStatus) Values() []ProjectStatus {
return []ProjectStatus{
"CREATING",
"CREATED",
"DELETING",
}
}
type ProjectVersionStatus string
// Enum values for ProjectVersionStatus
const (
ProjectVersionStatusTrainingInProgress ProjectVersionStatus = "TRAINING_IN_PROGRESS"
ProjectVersionStatusTrainingCompleted ProjectVersionStatus = "TRAINING_COMPLETED"
ProjectVersionStatusTrainingFailed ProjectVersionStatus = "TRAINING_FAILED"
ProjectVersionStatusStarting ProjectVersionStatus = "STARTING"
ProjectVersionStatusRunning ProjectVersionStatus = "RUNNING"
ProjectVersionStatusFailed ProjectVersionStatus = "FAILED"
ProjectVersionStatusStopping ProjectVersionStatus = "STOPPING"
ProjectVersionStatusStopped ProjectVersionStatus = "STOPPED"
ProjectVersionStatusDeleting ProjectVersionStatus = "DELETING"
ProjectVersionStatusCopyingInProgress ProjectVersionStatus = "COPYING_IN_PROGRESS"
ProjectVersionStatusCopyingCompleted ProjectVersionStatus = "COPYING_COMPLETED"
ProjectVersionStatusCopyingFailed ProjectVersionStatus = "COPYING_FAILED"
)
// Values returns all known values for ProjectVersionStatus. 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 (ProjectVersionStatus) Values() []ProjectVersionStatus {
return []ProjectVersionStatus{
"TRAINING_IN_PROGRESS",
"TRAINING_COMPLETED",
"TRAINING_FAILED",
"STARTING",
"RUNNING",
"FAILED",
"STOPPING",
"STOPPED",
"DELETING",
"COPYING_IN_PROGRESS",
"COPYING_COMPLETED",
"COPYING_FAILED",
}
}
type ProtectiveEquipmentType string
// Enum values for ProtectiveEquipmentType
const (
ProtectiveEquipmentTypeFaceCover ProtectiveEquipmentType = "FACE_COVER"
ProtectiveEquipmentTypeHandCover ProtectiveEquipmentType = "HAND_COVER"
ProtectiveEquipmentTypeHeadCover ProtectiveEquipmentType = "HEAD_COVER"
)
// Values returns all known values for ProtectiveEquipmentType. 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 (ProtectiveEquipmentType) Values() []ProtectiveEquipmentType {
return []ProtectiveEquipmentType{
"FACE_COVER",
"HAND_COVER",
"HEAD_COVER",
}
}
type QualityFilter string
// Enum values for QualityFilter
const (
QualityFilterNone QualityFilter = "NONE"
QualityFilterAuto QualityFilter = "AUTO"
QualityFilterLow QualityFilter = "LOW"
QualityFilterMedium QualityFilter = "MEDIUM"
QualityFilterHigh QualityFilter = "HIGH"
)
// Values returns all known values for QualityFilter. 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 (QualityFilter) Values() []QualityFilter {
return []QualityFilter{
"NONE",
"AUTO",
"LOW",
"MEDIUM",
"HIGH",
}
}
type Reason string
// Enum values for Reason
const (
ReasonExceedsMaxFaces Reason = "EXCEEDS_MAX_FACES"
ReasonExtremePose Reason = "EXTREME_POSE"
ReasonLowBrightness Reason = "LOW_BRIGHTNESS"
ReasonLowSharpness Reason = "LOW_SHARPNESS"
ReasonLowConfidence Reason = "LOW_CONFIDENCE"
ReasonSmallBoundingBox Reason = "SMALL_BOUNDING_BOX"
ReasonLowFaceQuality Reason = "LOW_FACE_QUALITY"
)
// Values returns all known values for Reason. 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 (Reason) Values() []Reason {
return []Reason{
"EXCEEDS_MAX_FACES",
"EXTREME_POSE",
"LOW_BRIGHTNESS",
"LOW_SHARPNESS",
"LOW_CONFIDENCE",
"SMALL_BOUNDING_BOX",
"LOW_FACE_QUALITY",
}
}
type SegmentType string
// Enum values for SegmentType
const (
SegmentTypeTechnicalCue SegmentType = "TECHNICAL_CUE"
SegmentTypeShot SegmentType = "SHOT"
)
// Values returns all known values for SegmentType. 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 (SegmentType) Values() []SegmentType {
return []SegmentType{
"TECHNICAL_CUE",
"SHOT",
}
}
type StreamProcessorParameterToDelete string
// Enum values for StreamProcessorParameterToDelete
const (
StreamProcessorParameterToDeleteConnectedHomeMinConfidence StreamProcessorParameterToDelete = "ConnectedHomeMinConfidence"
StreamProcessorParameterToDeleteRegionsOfInterest StreamProcessorParameterToDelete = "RegionsOfInterest"
)
// Values returns all known values for StreamProcessorParameterToDelete. 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 (StreamProcessorParameterToDelete) Values() []StreamProcessorParameterToDelete {
return []StreamProcessorParameterToDelete{
"ConnectedHomeMinConfidence",
"RegionsOfInterest",
}
}
type StreamProcessorStatus string
// Enum values for StreamProcessorStatus
const (
StreamProcessorStatusStopped StreamProcessorStatus = "STOPPED"
StreamProcessorStatusStarting StreamProcessorStatus = "STARTING"
StreamProcessorStatusRunning StreamProcessorStatus = "RUNNING"
StreamProcessorStatusFailed StreamProcessorStatus = "FAILED"
StreamProcessorStatusStopping StreamProcessorStatus = "STOPPING"
StreamProcessorStatusUpdating StreamProcessorStatus = "UPDATING"
)
// Values returns all known values for StreamProcessorStatus. 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 (StreamProcessorStatus) Values() []StreamProcessorStatus {
return []StreamProcessorStatus{
"STOPPED",
"STARTING",
"RUNNING",
"FAILED",
"STOPPING",
"UPDATING",
}
}
type TechnicalCueType string
// Enum values for TechnicalCueType
const (
TechnicalCueTypeColorBars TechnicalCueType = "ColorBars"
TechnicalCueTypeEndCredits TechnicalCueType = "EndCredits"
TechnicalCueTypeBlackFrames TechnicalCueType = "BlackFrames"
TechnicalCueTypeOpeningCredits TechnicalCueType = "OpeningCredits"
TechnicalCueTypeStudioLogo TechnicalCueType = "StudioLogo"
TechnicalCueTypeSlate TechnicalCueType = "Slate"
TechnicalCueTypeContent TechnicalCueType = "Content"
)
// Values returns all known values for TechnicalCueType. 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 (TechnicalCueType) Values() []TechnicalCueType {
return []TechnicalCueType{
"ColorBars",
"EndCredits",
"BlackFrames",
"OpeningCredits",
"StudioLogo",
"Slate",
"Content",
}
}
type TextTypes string
// Enum values for TextTypes
const (
TextTypesLine TextTypes = "LINE"
TextTypesWord TextTypes = "WORD"
)
// Values returns all known values for TextTypes. 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 (TextTypes) Values() []TextTypes {
return []TextTypes{
"LINE",
"WORD",
}
}
type UnsearchedFaceReason string
// Enum values for UnsearchedFaceReason
const (
UnsearchedFaceReasonFaceNotLargest UnsearchedFaceReason = "FACE_NOT_LARGEST"
UnsearchedFaceReasonExceedsMaxFaces UnsearchedFaceReason = "EXCEEDS_MAX_FACES"
UnsearchedFaceReasonExtremePose UnsearchedFaceReason = "EXTREME_POSE"
UnsearchedFaceReasonLowBrightness UnsearchedFaceReason = "LOW_BRIGHTNESS"
UnsearchedFaceReasonLowSharpness UnsearchedFaceReason = "LOW_SHARPNESS"
UnsearchedFaceReasonLowConfidence UnsearchedFaceReason = "LOW_CONFIDENCE"
UnsearchedFaceReasonSmallBoundingBox UnsearchedFaceReason = "SMALL_BOUNDING_BOX"
UnsearchedFaceReasonLowFaceQuality UnsearchedFaceReason = "LOW_FACE_QUALITY"
)
// Values returns all known values for UnsearchedFaceReason. 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 (UnsearchedFaceReason) Values() []UnsearchedFaceReason {
return []UnsearchedFaceReason{
"FACE_NOT_LARGEST",
"EXCEEDS_MAX_FACES",
"EXTREME_POSE",
"LOW_BRIGHTNESS",
"LOW_SHARPNESS",
"LOW_CONFIDENCE",
"SMALL_BOUNDING_BOX",
"LOW_FACE_QUALITY",
}
}
type UnsuccessfulFaceAssociationReason string
// Enum values for UnsuccessfulFaceAssociationReason
const (
UnsuccessfulFaceAssociationReasonFaceNotFound UnsuccessfulFaceAssociationReason = "FACE_NOT_FOUND"
UnsuccessfulFaceAssociationReasonAssociatedToADifferentUser UnsuccessfulFaceAssociationReason = "ASSOCIATED_TO_A_DIFFERENT_USER"
UnsuccessfulFaceAssociationReasonLowMatchConfidence UnsuccessfulFaceAssociationReason = "LOW_MATCH_CONFIDENCE"
)
// Values returns all known values for UnsuccessfulFaceAssociationReason. 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 (UnsuccessfulFaceAssociationReason) Values() []UnsuccessfulFaceAssociationReason {
return []UnsuccessfulFaceAssociationReason{
"FACE_NOT_FOUND",
"ASSOCIATED_TO_A_DIFFERENT_USER",
"LOW_MATCH_CONFIDENCE",
}
}
type UnsuccessfulFaceDeletionReason string
// Enum values for UnsuccessfulFaceDeletionReason
const (
UnsuccessfulFaceDeletionReasonAssociatedToAnExistingUser UnsuccessfulFaceDeletionReason = "ASSOCIATED_TO_AN_EXISTING_USER"
UnsuccessfulFaceDeletionReasonFaceNotFound UnsuccessfulFaceDeletionReason = "FACE_NOT_FOUND"
)
// Values returns all known values for UnsuccessfulFaceDeletionReason. 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 (UnsuccessfulFaceDeletionReason) Values() []UnsuccessfulFaceDeletionReason {
return []UnsuccessfulFaceDeletionReason{
"ASSOCIATED_TO_AN_EXISTING_USER",
"FACE_NOT_FOUND",
}
}
type UnsuccessfulFaceDisassociationReason string
// Enum values for UnsuccessfulFaceDisassociationReason
const (
UnsuccessfulFaceDisassociationReasonFaceNotFound UnsuccessfulFaceDisassociationReason = "FACE_NOT_FOUND"
UnsuccessfulFaceDisassociationReasonAssociatedToADifferentUser UnsuccessfulFaceDisassociationReason = "ASSOCIATED_TO_A_DIFFERENT_USER"
)
// Values returns all known values for UnsuccessfulFaceDisassociationReason. 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 (UnsuccessfulFaceDisassociationReason) Values() []UnsuccessfulFaceDisassociationReason {
return []UnsuccessfulFaceDisassociationReason{
"FACE_NOT_FOUND",
"ASSOCIATED_TO_A_DIFFERENT_USER",
}
}
type UserStatus string
// Enum values for UserStatus
const (
UserStatusActive UserStatus = "ACTIVE"
UserStatusUpdating UserStatus = "UPDATING"
UserStatusCreating UserStatus = "CREATING"
UserStatusCreated UserStatus = "CREATED"
)
// Values returns all known values for UserStatus. 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 (UserStatus) Values() []UserStatus {
return []UserStatus{
"ACTIVE",
"UPDATING",
"CREATING",
"CREATED",
}
}
type VideoColorRange string
// Enum values for VideoColorRange
const (
VideoColorRangeFull VideoColorRange = "FULL"
VideoColorRangeLimited VideoColorRange = "LIMITED"
)
// Values returns all known values for VideoColorRange. 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 (VideoColorRange) Values() []VideoColorRange {
return []VideoColorRange{
"FULL",
"LIMITED",
}
}
type VideoJobStatus string
// Enum values for VideoJobStatus
const (
VideoJobStatusInProgress VideoJobStatus = "IN_PROGRESS"
VideoJobStatusSucceeded VideoJobStatus = "SUCCEEDED"
VideoJobStatusFailed VideoJobStatus = "FAILED"
)
// Values returns all known values for VideoJobStatus. 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 (VideoJobStatus) Values() []VideoJobStatus {
return []VideoJobStatus{
"IN_PROGRESS",
"SUCCEEDED",
"FAILED",
}
}
| 911 |
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 are not authorized to perform the action.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// A User with the same Id already exists within the collection, or the update or
// deletion of the User caused an inconsistent state. **
type ConflictException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The number of in-progress human reviews you have has exceeded the number
// allowed.
type HumanLoopQuotaExceededException struct {
Message *string
ErrorCodeOverride *string
ResourceType *string
QuotaCode *string
ServiceCode *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *HumanLoopQuotaExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *HumanLoopQuotaExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *HumanLoopQuotaExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "HumanLoopQuotaExceededException"
}
return *e.ErrorCodeOverride
}
func (e *HumanLoopQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// A ClientRequestToken input parameter was reused with an operation, but at least
// one of the other input parameters is different from the previous call to the
// operation.
type IdempotentParameterMismatchException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *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
}
// The input image size exceeds the allowed limit. If you are calling
// DetectProtectiveEquipment, the image size or resolution exceeds the allowed
// limit. For more information, see Guidelines and quotas in Amazon Rekognition in
// the Amazon Rekognition Developer Guide.
type ImageTooLargeException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *ImageTooLargeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ImageTooLargeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ImageTooLargeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ImageTooLargeException"
}
return *e.ErrorCodeOverride
}
func (e *ImageTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Amazon Rekognition experienced a service issue. Try your call again.
type InternalServerError struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *InternalServerError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerError) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerError"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The provided image format is not supported.
type InvalidImageFormatException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *InvalidImageFormatException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidImageFormatException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidImageFormatException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidImageFormatException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidImageFormatException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Pagination token in the request is not valid.
type InvalidPaginationTokenException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *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 }
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
type InvalidParameterException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *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 supplied revision id for the project policy is invalid.
type InvalidPolicyRevisionIdException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *InvalidPolicyRevisionIdException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidPolicyRevisionIdException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidPolicyRevisionIdException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidPolicyRevisionIdException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidPolicyRevisionIdException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Amazon Rekognition is unable to access the S3 object specified in the request.
type InvalidS3ObjectException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *InvalidS3ObjectException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidS3ObjectException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidS3ObjectException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidS3ObjectException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidS3ObjectException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// An Amazon Rekognition service limit was exceeded. For example, if you start too
// many Amazon Rekognition Video jobs concurrently, calls to start operations (
// StartLabelDetection , for example) will raise a LimitExceededException
// exception (HTTP status code: 400) until the number of concurrently running jobs
// is below the Amazon Rekognition service limit.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
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 format of the project policy document that you supplied to PutProjectPolicy
// is incorrect.
type MalformedPolicyDocumentException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *MalformedPolicyDocumentException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *MalformedPolicyDocumentException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *MalformedPolicyDocumentException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "MalformedPolicyDocumentException"
}
return *e.ErrorCodeOverride
}
func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
type ProvisionedThroughputExceededException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *ProvisionedThroughputExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ProvisionedThroughputExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ProvisionedThroughputExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ProvisionedThroughputExceededException"
}
return *e.ErrorCodeOverride
}
func (e *ProvisionedThroughputExceededException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// A resource with the specified ID already exists.
type ResourceAlreadyExistsException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *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 }
// The specified resource is already being used.
type ResourceInUseException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *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 }
// The resource specified in the request cannot be found.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *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 }
// The requested resource isn't ready. For example, this exception occurs when you
// call DetectCustomLabels with a model version that isn't deployed.
type ResourceNotReadyException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *ResourceNotReadyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotReadyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotReadyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotReadyException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotReadyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The size of the collection exceeds the allowed limit. For more information, see
// Guidelines and quotas in Amazon Rekognition in the Amazon Rekognition Developer
// Guide.
type ServiceQuotaExceededException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *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 }
// Occurs when a given sessionId is not found.
type SessionNotFoundException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *SessionNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *SessionNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *SessionNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "SessionNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *SessionNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Amazon Rekognition is temporarily unable to process the request. Try your call
// again.
type ThrottlingException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *ThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The file size or duration of the supplied media is too large. The maximum file
// size is 10GB. The maximum duration is 6 hours.
type VideoTooLargeException struct {
Message *string
ErrorCodeOverride *string
Code *string
Logref *string
noSmithyDocumentSerde
}
func (e *VideoTooLargeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *VideoTooLargeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *VideoTooLargeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "VideoTooLargeException"
}
return *e.ErrorCodeOverride
}
func (e *VideoTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 673 |
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"
)
// Structure containing the estimated age range, in years, for a face. Amazon
// Rekognition estimates an age range for faces detected in the input image.
// Estimated age ranges can overlap. A face of a 5-year-old might have an estimated
// range of 4-6, while the face of a 6-year-old might have an estimated range of
// 4-8.
type AgeRange struct {
// The highest estimated age.
High *int32
// The lowest estimated age.
Low *int32
noSmithyDocumentSerde
}
// Assets are the images that you use to train and evaluate a model version.
// Assets can also contain validation information that you use to debug a failed
// model training.
type Asset struct {
// The S3 bucket that contains an Amazon Sagemaker Ground Truth format manifest
// file.
GroundTruthManifest *GroundTruthManifest
noSmithyDocumentSerde
}
// Provides face metadata for the faces that are associated to a specific UserID.
type AssociatedFace struct {
// Unique identifier assigned to the face.
FaceId *string
noSmithyDocumentSerde
}
// Metadata information about an audio stream. An array of AudioMetadata objects
// for the audio streams found in a stored video is returned by GetSegmentDetection
// .
type AudioMetadata struct {
// The audio codec used to encode or decode the audio stream.
Codec *string
// The duration of the audio stream in milliseconds.
DurationMillis *int64
// The number of audio channels in the segment.
NumberOfChannels *int64
// The sample rate for the audio stream.
SampleRate *int64
noSmithyDocumentSerde
}
// An image that is picked from the Face Liveness video and returned for audit
// trail purposes, returned as Base64-encoded bytes.
type AuditImage struct {
// Identifies the bounding box around the label, face, text, object of interest,
// or personal protective equipment. The left (x-coordinate) and top
// (y-coordinate) are coordinates representing the top and left sides of the
// bounding box. Note that the upper-left corner of the image is the origin (0,0).
// The top and left values returned are ratios of the overall image size. For
// example, if the input image is 700x200 pixels, and the top-left coordinate of
// the bounding box is 350x50 pixels, the API returns a left value of 0.5
// (350/700) and a top value of 0.25 (50/200). The width and height values
// represent the dimensions of the bounding box as a ratio of the overall image
// dimension. For example, if the input image is 700x200 pixels, and the bounding
// box width is 70 pixels, the width returned is 0.1. The bounding box coordinates
// can have negative values. For example, if Amazon Rekognition is able to detect a
// face that is at the image edge and is only partially visible, the service can
// return coordinates that are outside the image bounds and, depending on the image
// edge, you might get negative values or values greater than 1 for the left or top
// values.
BoundingBox *BoundingBox
// The Base64-encoded bytes representing an image selected from the Face Liveness
// video and returned for audit purposes.
Bytes []byte
// Provides the S3 bucket name and object name. The region for the S3 bucket
// containing the S3 object must match the region you use for Amazon Rekognition
// operations. For Amazon Rekognition to process an S3 object, the user must have
// permission to access the S3 object. For more information, see How Amazon
// Rekognition works with IAM in the Amazon Rekognition Developer Guide.
S3Object *S3Object
noSmithyDocumentSerde
}
// Indicates whether or not the face has a beard, and the confidence level in the
// determination.
type Beard struct {
// Level of confidence in the determination.
Confidence *float32
// Boolean value that indicates whether the face has beard or not.
Value bool
noSmithyDocumentSerde
}
// A filter that allows you to control the black frame detection by specifying the
// black levels and pixel coverage of black pixels in a frame. As videos can come
// from multiple sources, formats, and time periods, they may contain different
// standards and varying noise levels for black frames that need to be accounted
// for. For more information, see StartSegmentDetection .
type BlackFrame struct {
// A threshold used to determine the maximum luminance value for a pixel to be
// considered black. In a full color range video, luminance values range from
// 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum
// black pixel value is computed as follows: max_black_pixel_value =
// minimum_luminance + MaxPixelThreshold *luminance_range. For example, for a full
// range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + 0.1 *
// (255-0) = 25.5. The default value of MaxPixelThreshold is 0.2, which maps to a
// max_black_pixel_value of 51 for a full range video. You can lower this threshold
// to be more strict on black levels.
MaxPixelThreshold *float32
// The minimum percentage of pixels in a frame that need to have a luminance below
// the max_black_pixel_value for a frame to be considered a black frame. Luminance
// is calculated using the BT.709 matrix. The default value is 99, which means at
// least 99% of all pixels in the frame are black pixels as per the
// MaxPixelThreshold set. You can reduce this value to allow more noise on the
// black frame.
MinCoveragePercentage *float32
noSmithyDocumentSerde
}
// Identifies the bounding box around the label, face, text, object of interest,
// or personal protective equipment. The left (x-coordinate) and top
// (y-coordinate) are coordinates representing the top and left sides of the
// bounding box. Note that the upper-left corner of the image is the origin (0,0).
// The top and left values returned are ratios of the overall image size. For
// example, if the input image is 700x200 pixels, and the top-left coordinate of
// the bounding box is 350x50 pixels, the API returns a left value of 0.5
// (350/700) and a top value of 0.25 (50/200). The width and height values
// represent the dimensions of the bounding box as a ratio of the overall image
// dimension. For example, if the input image is 700x200 pixels, and the bounding
// box width is 70 pixels, the width returned is 0.1. The bounding box coordinates
// can have negative values. For example, if Amazon Rekognition is able to detect a
// face that is at the image edge and is only partially visible, the service can
// return coordinates that are outside the image bounds and, depending on the image
// edge, you might get negative values or values greater than 1 for the left or top
// values.
type BoundingBox struct {
// Height of the bounding box as a ratio of the overall image height.
Height *float32
// Left coordinate of the bounding box as a ratio of overall image width.
Left *float32
// Top coordinate of the bounding box as a ratio of overall image height.
Top *float32
// Width of the bounding box as a ratio of the overall image width.
Width *float32
noSmithyDocumentSerde
}
// Provides information about a celebrity recognized by the RecognizeCelebrities
// operation.
type Celebrity struct {
// Provides information about the celebrity's face, such as its location on the
// image.
Face *ComparedFace
// A unique identifier for the celebrity.
Id *string
// The known gender identity for the celebrity that matches the provided ID. The
// known gender identity can be Male, Female, Nonbinary, or Unlisted.
KnownGender *KnownGender
// The confidence, in percentage, that Amazon Rekognition has that the recognized
// face is the celebrity.
MatchConfidence *float32
// The name of the celebrity.
Name *string
// An array of URLs pointing to additional information about the celebrity. If
// there is no additional information about the celebrity, this list is empty.
Urls []string
noSmithyDocumentSerde
}
// Information about a recognized celebrity.
type CelebrityDetail struct {
// Bounding box around the body of a celebrity.
BoundingBox *BoundingBox
// The confidence, in percentage, that Amazon Rekognition has that the recognized
// face is the celebrity.
Confidence *float32
// Face details for the recognized celebrity.
Face *FaceDetail
// The unique identifier for the celebrity.
Id *string
// Retrieves the known gender for the celebrity.
KnownGender *KnownGender
// The name of the celebrity.
Name *string
// An array of URLs pointing to additional celebrity information.
Urls []string
noSmithyDocumentSerde
}
// Information about a detected celebrity and the time the celebrity was detected
// in a stored video. For more information, see GetCelebrityRecognition in the
// Amazon Rekognition Developer Guide.
type CelebrityRecognition struct {
// Information about a recognized celebrity.
Celebrity *CelebrityDetail
// The time, in milliseconds from the start of the video, that the celebrity was
// recognized. Note that Timestamp is not guaranteed to be accurate to the
// individual frame where the celebrity first appears.
Timestamp int64
noSmithyDocumentSerde
}
// Provides face metadata for target image faces that are analyzed by CompareFaces
// and RecognizeCelebrities .
type ComparedFace struct {
// Bounding box of the face.
BoundingBox *BoundingBox
// Level of confidence that what the bounding box contains is a face.
Confidence *float32
// The emotions that appear to be expressed on the face, and the confidence level
// in the determination. Valid values include "Happy", "Sad", "Angry", "Confused",
// "Disgusted", "Surprised", "Calm", "Unknown", and "Fear".
Emotions []Emotion
// An array of facial landmarks.
Landmarks []Landmark
// Indicates the pose of the face as determined by its pitch, roll, and yaw.
Pose *Pose
// Identifies face image brightness and sharpness.
Quality *ImageQuality
// Indicates whether or not the face is smiling, and the confidence level in the
// determination.
Smile *Smile
noSmithyDocumentSerde
}
// Type that describes the face Amazon Rekognition chose to compare with the faces
// in the target. This contains a bounding box for the selected face and confidence
// level that the bounding box contains a face. Note that Amazon Rekognition
// selects the largest face in the source image for this comparison.
type ComparedSourceImageFace struct {
// Bounding box of the face.
BoundingBox *BoundingBox
// Confidence level that the selected bounding box contains a face.
Confidence *float32
noSmithyDocumentSerde
}
// Provides information about a face in a target image that matches the source
// image face analyzed by CompareFaces . The Face property contains the bounding
// box of the face in the target image. The Similarity property is the confidence
// that the source image face matches the face in the bounding box.
type CompareFacesMatch struct {
// Provides face metadata (bounding box and confidence that the bounding box
// actually contains a face).
Face *ComparedFace
// Level of confidence that the faces match.
Similarity *float32
noSmithyDocumentSerde
}
// Label detection settings to use on a streaming video. Defining the settings is
// required in the request parameter for CreateStreamProcessor . Including this
// setting in the CreateStreamProcessor request enables you to use the stream
// processor for label detection. You can then select what you want the stream
// processor to detect, such as people or pets. When the stream processor has
// started, one notification is sent for each object class specified. For example,
// if packages and pets are selected, one SNS notification is published the first
// time a package is detected and one SNS notification is published the first time
// a pet is detected, as well as an end-of-session summary.
type ConnectedHomeSettings struct {
// Specifies what you want to detect in the video, such as people, packages, or
// pets. The current valid labels you can include in this list are: "PERSON",
// "PET", "PACKAGE", and "ALL".
//
// This member is required.
Labels []string
// The minimum confidence required to label an object in the video.
MinConfidence *float32
noSmithyDocumentSerde
}
// The label detection settings you want to use in your stream processor. This
// includes the labels you want the stream processor to detect and the minimum
// confidence level allowed to label objects.
type ConnectedHomeSettingsForUpdate struct {
// Specifies what you want to detect in the video, such as people, packages, or
// pets. The current valid labels you can include in this list are: "PERSON",
// "PET", "PACKAGE", and "ALL".
Labels []string
// The minimum confidence required to label an object in the video.
MinConfidence *float32
noSmithyDocumentSerde
}
// Information about an inappropriate, unwanted, or offensive content label
// detection in a stored video.
type ContentModerationDetection struct {
// The time duration of a segment in milliseconds, I.e. time elapsed from
// StartTimestampMillis to EndTimestampMillis.
DurationMillis *int64
// The time in milliseconds defining the end of the timeline segment containing a
// continuously detected moderation label.
EndTimestampMillis *int64
// The content moderation label detected by in the stored video.
ModerationLabel *ModerationLabel
// The time in milliseconds defining the start of the timeline segment containing
// a continuously detected moderation label.
StartTimestampMillis *int64
// Time, in milliseconds from the beginning of the video, that the content
// moderation label was detected. Note that Timestamp is not guaranteed to be
// accurate to the individual frame where the moderated content first appears.
Timestamp int64
noSmithyDocumentSerde
}
// Information about an item of Personal Protective Equipment covering a
// corresponding body part. For more information, see DetectProtectiveEquipment .
type CoversBodyPart struct {
// The confidence that Amazon Rekognition has in the value of Value .
Confidence *float32
// True if the PPE covers the corresponding body part, otherwise false.
Value bool
noSmithyDocumentSerde
}
// A session settings object. It contains settings for the operation to be
// performed. It accepts arguments for OutputConfig and AuditImagesLimit.
type CreateFaceLivenessSessionRequestSettings struct {
// Number of audit images to be returned back. Takes an integer between 0-4. Any
// integer less than 0 will return 0, any integer above 4 will return 4 images in
// the response. By default, it is set to 0. The limit is best effort and is based
// on the actual duration of the selfie-video.
AuditImagesLimit *int32
// Can specify the location of an Amazon S3 bucket, where reference and audit
// images will be stored. Note that the Amazon S3 bucket must be located in the
// caller's AWS account and in the same region as the Face Liveness end-point.
// Additionally, the Amazon S3 object keys are auto-generated by the Face Liveness
// system. Requires that the caller has the s3:PutObject permission on the Amazon
// S3 bucket.
OutputConfig *LivenessOutputConfig
noSmithyDocumentSerde
}
// A custom label detected in an image by a call to DetectCustomLabels .
type CustomLabel struct {
// The confidence that the model has in the detection of the custom label. The
// range is 0-100. A higher value indicates a higher confidence.
Confidence *float32
// The location of the detected object on the image that corresponds to the custom
// label. Includes an axis aligned coarse bounding box surrounding the object and a
// finer grain polygon for more accurate spatial information.
Geometry *Geometry
// The name of the custom label.
Name *string
noSmithyDocumentSerde
}
// Describes updates or additions to a dataset. A Single update or addition is an
// entry (JSON Line) that provides information about a single image. To update an
// existing entry, you match the source-ref field of the update entry with the
// source-ref filed of the entry that you want to update. If the source-ref field
// doesn't match an existing entry, the entry is added to dataset as a new entry.
type DatasetChanges struct {
// A Base64-encoded binary data object containing one or JSON lines that either
// update the dataset or are additions to the dataset. You change a dataset by
// calling UpdateDatasetEntries . If you are using an AWS SDK to call
// UpdateDatasetEntries , you don't need to encode Changes as the SDK encodes the
// data for you. For example JSON lines, see Image-Level labels in manifest files
// and and Object localization in manifest files in the Amazon Rekognition Custom
// Labels Developer Guide.
//
// This member is required.
GroundTruth []byte
noSmithyDocumentSerde
}
// A description for a dataset. For more information, see DescribeDataset . The
// status fields Status , StatusMessage , and StatusMessageCode reflect the last
// operation on the dataset.
type DatasetDescription struct {
// The Unix timestamp for the time and date that the dataset was created.
CreationTimestamp *time.Time
// The status message code for the dataset.
DatasetStats *DatasetStats
// The Unix timestamp for the date and time that the dataset was last updated.
LastUpdatedTimestamp *time.Time
// The status of the dataset.
Status DatasetStatus
// The status message for the dataset.
StatusMessage *string
// The status message code for the dataset operation. If a service error occurs,
// try the API call again later. If a client error occurs, check the input
// parameters to the dataset API call that failed.
StatusMessageCode DatasetStatusMessageCode
noSmithyDocumentSerde
}
// Describes a dataset label. For more information, see ListDatasetLabels .
type DatasetLabelDescription struct {
// The name of the label.
LabelName *string
// Statistics about the label.
LabelStats *DatasetLabelStats
noSmithyDocumentSerde
}
// Statistics about a label used in a dataset. For more information, see
// DatasetLabelDescription .
type DatasetLabelStats struct {
// The total number of images that have the label assigned to a bounding box.
BoundingBoxCount *int32
// The total number of images that use the label.
EntryCount *int32
noSmithyDocumentSerde
}
// Summary information for an Amazon Rekognition Custom Labels dataset. For more
// information, see ProjectDescription .
type DatasetMetadata struct {
// The Unix timestamp for the date and time that the dataset was created.
CreationTimestamp *time.Time
// The Amazon Resource Name (ARN) for the dataset.
DatasetArn *string
// The type of the dataset.
DatasetType DatasetType
// The status for the dataset.
Status DatasetStatus
// The status message for the dataset.
StatusMessage *string
// The status message code for the dataset operation. If a service error occurs,
// try the API call again later. If a client error occurs, check the input
// parameters to the dataset API call that failed.
StatusMessageCode DatasetStatusMessageCode
noSmithyDocumentSerde
}
// The source that Amazon Rekognition Custom Labels uses to create a dataset. To
// use an Amazon Sagemaker format manifest file, specify the S3 bucket location in
// the GroundTruthManifest field. The S3 bucket must be in your AWS account. To
// create a copy of an existing dataset, specify the Amazon Resource Name (ARN) of
// an existing dataset in DatasetArn . You need to specify a value for DatasetArn
// or GroundTruthManifest , but not both. if you supply both values, or if you
// don't specify any values, an InvalidParameterException exception occurs. For
// more information, see CreateDataset .
type DatasetSource struct {
// The ARN of an Amazon Rekognition Custom Labels dataset that you want to copy.
DatasetArn *string
// The S3 bucket that contains an Amazon Sagemaker Ground Truth format manifest
// file.
GroundTruthManifest *GroundTruthManifest
noSmithyDocumentSerde
}
// Provides statistics about a dataset. For more information, see DescribeDataset .
type DatasetStats struct {
// The total number of entries that contain at least one error.
ErrorEntries *int32
// The total number of images in the dataset that have labels.
LabeledEntries *int32
// The total number of images in the dataset.
TotalEntries *int32
// The total number of labels declared in the dataset.
TotalLabels *int32
noSmithyDocumentSerde
}
// A set of parameters that allow you to filter out certain results from your
// returned results.
type DetectionFilter struct {
// Sets the minimum height of the word bounding box. Words with bounding box
// heights lesser than this value will be excluded from the result. Value is
// relative to the video frame height.
MinBoundingBoxHeight *float32
// Sets the minimum width of the word bounding box. Words with bounding boxes
// widths lesser than this value will be excluded from the result. Value is
// relative to the video frame width.
MinBoundingBoxWidth *float32
// Sets the confidence of word detection. Words with detection confidence below
// this will be excluded from the result. Values should be between 0 and 100. The
// default MinConfidence is 80.
MinConfidence *float32
noSmithyDocumentSerde
}
// The background of the image with regard to image quality and dominant colors.
type DetectLabelsImageBackground struct {
// The dominant colors found in the background of an image, defined with RGB
// values, CSS color name, simplified color name, and PixelPercentage (the
// percentage of image pixels that have a particular color).
DominantColors []DominantColor
// The quality of the image background as defined by brightness and sharpness.
Quality *DetectLabelsImageQuality
noSmithyDocumentSerde
}
// The foreground of the image with regard to image quality and dominant colors.
type DetectLabelsImageForeground struct {
// The dominant colors found in the foreground of an image, defined with RGB
// values, CSS color name, simplified color name, and PixelPercentage (the
// percentage of image pixels that have a particular color).
DominantColors []DominantColor
// The quality of the image foreground as defined by brightness and sharpness.
Quality *DetectLabelsImageQuality
noSmithyDocumentSerde
}
// Information about the quality and dominant colors of an input image. Quality
// and color information is returned for the entire image, foreground, and
// background.
type DetectLabelsImageProperties struct {
// Information about the properties of an image’s background, including the
// background’s quality and dominant colors, including the quality and dominant
// colors of the image.
Background *DetectLabelsImageBackground
// Information about the dominant colors found in an image, described with RGB
// values, CSS color name, simplified color name, and PixelPercentage (the
// percentage of image pixels that have a particular color).
DominantColors []DominantColor
// Information about the properties of an image’s foreground, including the
// foreground’s quality and dominant colors, including the quality and dominant
// colors of the image.
Foreground *DetectLabelsImageForeground
// Information about the quality of the image foreground as defined by brightness,
// sharpness, and contrast. The higher the value the greater the brightness,
// sharpness, and contrast respectively.
Quality *DetectLabelsImageQuality
noSmithyDocumentSerde
}
// Settings for the IMAGE_PROPERTIES feature type.
type DetectLabelsImagePropertiesSettings struct {
// The maximum number of dominant colors to return when detecting labels in an
// image. The default value is 10.
MaxDominantColors int32
noSmithyDocumentSerde
}
// The quality of an image provided for label detection, with regard to
// brightness, sharpness, and contrast.
type DetectLabelsImageQuality struct {
// The brightness of an image provided for label detection.
Brightness *float32
// The contrast of an image provided for label detection.
Contrast *float32
// The sharpness of an image provided for label detection.
Sharpness *float32
noSmithyDocumentSerde
}
// Settings for the DetectLabels request. Settings can include filters for both
// GENERAL_LABELS and IMAGE_PROPERTIES. GENERAL_LABELS filters can be inclusive or
// exclusive and applied to individual labels or label categories. IMAGE_PROPERTIES
// filters allow specification of a maximum number of dominant colors.
type DetectLabelsSettings struct {
// Contains the specified filters for GENERAL_LABELS.
GeneralLabels *GeneralLabelsSettings
// Contains the chosen number of maximum dominant colors in an image.
ImageProperties *DetectLabelsImagePropertiesSettings
noSmithyDocumentSerde
}
// A set of optional parameters that you can use to set the criteria that the text
// must meet to be included in your response. WordFilter looks at a word’s height,
// width, and minimum confidence. RegionOfInterest lets you set a specific region
// of the image to look for text in.
type DetectTextFilters struct {
// A Filter focusing on a certain area of the image. Uses a BoundingBox object to
// set the region of the image.
RegionsOfInterest []RegionOfInterest
// A set of parameters that allow you to filter out certain results from your
// returned results.
WordFilter *DetectionFilter
noSmithyDocumentSerde
}
// Provides face metadata for the faces that are disassociated from a specific
// UserID.
type DisassociatedFace struct {
// Unique identifier assigned to the face.
FaceId *string
noSmithyDocumentSerde
}
// A training dataset or a test dataset used in a dataset distribution operation.
// For more information, see DistributeDatasetEntries .
type DistributeDataset struct {
// The Amazon Resource Name (ARN) of the dataset that you want to use.
//
// This member is required.
Arn *string
noSmithyDocumentSerde
}
// A description of the dominant colors in an image.
type DominantColor struct {
// The Blue RGB value for a dominant color.
Blue *int32
// The CSS color name of a dominant color.
CSSColor *string
// The Green RGB value for a dominant color.
Green *int32
// The Hex code equivalent of the RGB values for a dominant color.
HexCode *string
// The percentage of image pixels that have a given dominant color.
PixelPercent *float32
// The Red RGB value for a dominant color.
Red *int32
// One of 12 simplified color names applied to a dominant color.
SimplifiedColor *string
noSmithyDocumentSerde
}
// The emotions that appear to be expressed on the face, and the confidence level
// in the determination. The API is only making a determination of the physical
// appearance of a person's face. It is not a determination of the person’s
// internal emotional state and should not be used in such a way. For example, a
// person pretending to have a sad face might not be sad emotionally.
type Emotion struct {
// Level of confidence in the determination.
Confidence *float32
// Type of emotion detected.
Type EmotionName
noSmithyDocumentSerde
}
// Information about an item of Personal Protective Equipment (PPE) detected by
// DetectProtectiveEquipment . For more information, see DetectProtectiveEquipment .
type EquipmentDetection struct {
// A bounding box surrounding the item of detected PPE.
BoundingBox *BoundingBox
// The confidence that Amazon Rekognition has that the bounding box ( BoundingBox )
// contains an item of PPE.
Confidence *float32
// Information about the body part covered by the detected PPE.
CoversBodyPart *CoversBodyPart
// The type of detected PPE.
Type ProtectiveEquipmentType
noSmithyDocumentSerde
}
// The evaluation results for the training of a model.
type EvaluationResult struct {
// The F1 score for the evaluation of all labels. The F1 score metric evaluates
// the overall precision and recall performance of the model as a single value. A
// higher value indicates better precision and recall performance. A lower score
// indicates that precision, recall, or both are performing poorly.
F1Score *float32
// The S3 bucket that contains the training summary.
Summary *Summary
noSmithyDocumentSerde
}
// Indicates the direction the eyes are gazing in (independent of the head pose)
// as determined by its pitch and yaw.
type EyeDirection struct {
// The confidence that the service has in its predicted eye direction.
Confidence *float32
// Value representing eye direction on the pitch axis.
Pitch *float32
// Value representing eye direction on the yaw axis.
Yaw *float32
noSmithyDocumentSerde
}
// Indicates whether or not the face is wearing eye glasses, and the confidence
// level in the determination.
type Eyeglasses struct {
// Level of confidence in the determination.
Confidence *float32
// Boolean value that indicates whether the face is wearing eye glasses or not.
Value bool
noSmithyDocumentSerde
}
// Indicates whether or not the eyes on the face are open, and the confidence
// level in the determination.
type EyeOpen struct {
// Level of confidence in the determination.
Confidence *float32
// Boolean value that indicates whether the eyes on the face are open.
Value bool
noSmithyDocumentSerde
}
// Describes the face properties such as the bounding box, face ID, image ID of
// the input image, and external image ID that you assigned.
type Face struct {
// Bounding box of the face.
BoundingBox *BoundingBox
// Confidence level that the bounding box contains a face (and not a different
// object such as a tree).
Confidence *float32
// Identifier that you assign to all the faces in the input image.
ExternalImageId *string
// Unique identifier that Amazon Rekognition assigns to the face.
FaceId *string
// Unique identifier that Amazon Rekognition assigns to the input image.
ImageId *string
// The version of the face detect and storage model that was used when indexing
// the face vector.
IndexFacesModelVersion *string
// Unique identifier assigned to the user.
UserId *string
noSmithyDocumentSerde
}
// Structure containing attributes of the face that the algorithm detected. A
// FaceDetail object contains either the default facial attributes or all facial
// attributes. The default attributes are BoundingBox , Confidence , Landmarks ,
// Pose , and Quality . GetFaceDetection is the only Amazon Rekognition Video
// stored video operation that can return a FaceDetail object with all attributes.
// To specify which attributes to return, use the FaceAttributes input parameter
// for StartFaceDetection . The following Amazon Rekognition Video operations
// return only the default attributes. The corresponding Start operations don't
// have a FaceAttributes input parameter:
// - GetCelebrityRecognition
// - GetPersonTracking
// - GetFaceSearch
//
// The Amazon Rekognition Image DetectFaces and IndexFaces operations can return
// all facial attributes. To specify which attributes to return, use the Attributes
// input parameter for DetectFaces . For IndexFaces , use the DetectAttributes
// input parameter.
type FaceDetail struct {
// The estimated age range, in years, for the face. Low represents the lowest
// estimated age and High represents the highest estimated age.
AgeRange *AgeRange
// Indicates whether or not the face has a beard, and the confidence level in the
// determination.
Beard *Beard
// Bounding box of the face. Default attribute.
BoundingBox *BoundingBox
// Confidence level that the bounding box contains a face (and not a different
// object such as a tree). Default attribute.
Confidence *float32
// The emotions that appear to be expressed on the face, and the confidence level
// in the determination. The API is only making a determination of the physical
// appearance of a person's face. It is not a determination of the person’s
// internal emotional state and should not be used in such a way. For example, a
// person pretending to have a sad face might not be sad emotionally.
Emotions []Emotion
// Indicates the direction the eyes are gazing in, as defined by pitch and yaw.
EyeDirection *EyeDirection
// Indicates whether or not the face is wearing eye glasses, and the confidence
// level in the determination.
Eyeglasses *Eyeglasses
// Indicates whether or not the eyes on the face are open, and the confidence
// level in the determination.
EyesOpen *EyeOpen
// FaceOccluded should return "true" with a high confidence score if a detected
// face’s eyes, nose, and mouth are partially captured or if they are covered by
// masks, dark sunglasses, cell phones, hands, or other objects. FaceOccluded
// should return "false" with a high confidence score if common occurrences that do
// not impact face verification are detected, such as eye glasses, lightly tinted
// sunglasses, strands of hair, and others.
FaceOccluded *FaceOccluded
// The predicted gender of a detected face.
Gender *Gender
// Indicates the location of landmarks on the face. Default attribute.
Landmarks []Landmark
// Indicates whether or not the mouth on the face is open, and the confidence
// level in the determination.
MouthOpen *MouthOpen
// Indicates whether or not the face has a mustache, and the confidence level in
// the determination.
Mustache *Mustache
// Indicates the pose of the face as determined by its pitch, roll, and yaw.
// Default attribute.
Pose *Pose
// Identifies image brightness and sharpness. Default attribute.
Quality *ImageQuality
// Indicates whether or not the face is smiling, and the confidence level in the
// determination.
Smile *Smile
// Indicates whether or not the face is wearing sunglasses, and the confidence
// level in the determination.
Sunglasses *Sunglasses
noSmithyDocumentSerde
}
// Information about a face detected in a video analysis request and the time the
// face was detected in the video.
type FaceDetection struct {
// The face properties for the detected face.
Face *FaceDetail
// Time, in milliseconds from the start of the video, that the face was detected.
// Note that Timestamp is not guaranteed to be accurate to the individual frame
// where the face first appears.
Timestamp int64
noSmithyDocumentSerde
}
// Provides face metadata. In addition, it also provides the confidence in the
// match of this face with the input face.
type FaceMatch struct {
// Describes the face properties such as the bounding box, face ID, image ID of
// the source image, and external image ID that you assigned.
Face *Face
// Confidence in the match of this face with the input face.
Similarity *float32
noSmithyDocumentSerde
}
// FaceOccluded should return "true" with a high confidence score if a detected
// face’s eyes, nose, and mouth are partially captured or if they are covered by
// masks, dark sunglasses, cell phones, hands, or other objects. FaceOccluded
// should return "false" with a high confidence score if common occurrences that do
// not impact face verification are detected, such as eye glasses, lightly tinted
// sunglasses, strands of hair, and others. You can use FaceOccluded to determine
// if an obstruction on a face negatively impacts using the image for face
// matching.
type FaceOccluded struct {
// The confidence that the service has detected the presence of a face occlusion.
Confidence *float32
// True if a detected face’s eyes, nose, and mouth are partially captured or if
// they are covered by masks, dark sunglasses, cell phones, hands, or other
// objects. False if common occurrences that do not impact face verification are
// detected, such as eye glasses, lightly tinted sunglasses, strands of hair, and
// others.
Value bool
noSmithyDocumentSerde
}
// Object containing both the face metadata (stored in the backend database), and
// facial attributes that are detected but aren't stored in the database.
type FaceRecord struct {
// Describes the face properties such as the bounding box, face ID, image ID of
// the input image, and external image ID that you assigned.
Face *Face
// Structure containing attributes of the face that the algorithm detected.
FaceDetail *FaceDetail
noSmithyDocumentSerde
}
// Input face recognition parameters for an Amazon Rekognition stream processor.
// Includes the collection to use for face recognition and the face attributes to
// detect. Defining the settings is required in the request parameter for
// CreateStreamProcessor .
type FaceSearchSettings struct {
// The ID of a collection that contains faces that you want to search for.
CollectionId *string
// Minimum face match confidence score that must be met to return a result for a
// recognized face. The default is 80. 0 is the lowest confidence. 100 is the
// highest confidence. Values between 0 and 100 are accepted, and values lower than
// 80 are set to 80.
FaceMatchThreshold *float32
noSmithyDocumentSerde
}
// The predicted gender of a detected face. Amazon Rekognition makes gender binary
// (male/female) predictions based on the physical appearance of a face in a
// particular image. This kind of prediction is not designed to categorize a
// person’s gender identity, and you shouldn't use Amazon Rekognition to make such
// a determination. For example, a male actor wearing a long-haired wig and
// earrings for a role might be predicted as female. Using Amazon Rekognition to
// make gender binary predictions is best suited for use cases where aggregate
// gender distribution statistics need to be analyzed without identifying specific
// users. For example, the percentage of female users compared to male users on a
// social media platform. We don't recommend using gender binary predictions to
// make decisions that impact an individual's rights, privacy, or access to
// services.
type Gender struct {
// Level of confidence in the prediction.
Confidence *float32
// The predicted gender of the face.
Value GenderType
noSmithyDocumentSerde
}
// Contains filters for the object labels returned by DetectLabels. Filters can be
// inclusive, exclusive, or a combination of both and can be applied to individual
// labels or entire label categories. To see a list of label categories, see
// Detecting Labels (https://docs.aws.amazon.com/rekognition/latest/dg/labels.html)
// .
type GeneralLabelsSettings struct {
// The label categories that should be excluded from the return from DetectLabels.
LabelCategoryExclusionFilters []string
// The label categories that should be included in the return from DetectLabels.
LabelCategoryInclusionFilters []string
// The labels that should be excluded from the return from DetectLabels.
LabelExclusionFilters []string
// The labels that should be included in the return from DetectLabels.
LabelInclusionFilters []string
noSmithyDocumentSerde
}
// Information about where an object ( DetectCustomLabels ) or text ( DetectText )
// is located on an image.
type Geometry struct {
// An axis-aligned coarse representation of the detected item's location on the
// image.
BoundingBox *BoundingBox
// Within the bounding box, a fine-grained polygon around the detected item.
Polygon []Point
noSmithyDocumentSerde
}
// Contains metadata about a content moderation request, including the SortBy and
// AggregateBy options.
type GetContentModerationRequestMetadata struct {
// The aggregation method chosen for a GetContentModeration request.
AggregateBy ContentModerationAggregateBy
// The sorting method chosen for a GetContentModeration request.
SortBy ContentModerationSortBy
noSmithyDocumentSerde
}
// Contains metadata about a label detection request, including the SortBy and
// AggregateBy options.
type GetLabelDetectionRequestMetadata struct {
// The aggregation method chosen for a GetLabelDetection request.
AggregateBy LabelDetectionAggregateBy
// The sorting method chosen for a GetLabelDetection request.
SortBy LabelDetectionSortBy
noSmithyDocumentSerde
}
// The S3 bucket that contains an Amazon Sagemaker Ground Truth format manifest
// file.
type GroundTruthManifest struct {
// Provides the S3 bucket name and object name. The region for the S3 bucket
// containing the S3 object must match the region you use for Amazon Rekognition
// operations. For Amazon Rekognition to process an S3 object, the user must have
// permission to access the S3 object. For more information, see How Amazon
// Rekognition works with IAM in the Amazon Rekognition Developer Guide.
S3Object *S3Object
noSmithyDocumentSerde
}
// Shows the results of the human in the loop evaluation. If there is no
// HumanLoopArn, the input did not trigger human review.
type HumanLoopActivationOutput struct {
// Shows the result of condition evaluations, including those conditions which
// activated a human review.
//
// This value conforms to the media type: application/json
HumanLoopActivationConditionsEvaluationResults *string
// Shows if and why human review was needed.
HumanLoopActivationReasons []string
// The Amazon Resource Name (ARN) of the HumanLoop created.
HumanLoopArn *string
noSmithyDocumentSerde
}
// Sets up the flow definition the image will be sent to if one of the conditions
// is met. You can also set certain attributes of the image before review.
type HumanLoopConfig struct {
// The Amazon Resource Name (ARN) of the flow definition. You can create a flow
// definition by using the Amazon Sagemaker CreateFlowDefinition (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateFlowDefinition.html)
// Operation.
//
// This member is required.
FlowDefinitionArn *string
// The name of the human review used for this image. This should be kept unique
// within a region.
//
// This member is required.
HumanLoopName *string
// Sets attributes of the input data.
DataAttributes *HumanLoopDataAttributes
noSmithyDocumentSerde
}
// Allows you to set attributes of the image. Currently, you can declare an image
// as free of personally identifiable information.
type HumanLoopDataAttributes struct {
// Sets whether the input image is free of personally identifiable information.
ContentClassifiers []ContentClassifier
noSmithyDocumentSerde
}
// Provides the input image either as bytes or an S3 object. You pass image bytes
// to an Amazon Rekognition API operation by using the Bytes property. For
// example, you would use the Bytes property to pass an image loaded from a local
// file system. Image bytes passed by using the Bytes property must be
// base64-encoded. Your code may not need to encode image bytes if you are using an
// AWS SDK to call Amazon Rekognition API operations. For more information, see
// Analyzing an Image Loaded from a Local File System in the Amazon Rekognition
// Developer Guide. You pass images stored in an S3 bucket to an Amazon Rekognition
// API operation by using the S3Object property. Images stored in an S3 bucket do
// not need to be base64-encoded. The region for the S3 bucket containing the S3
// object must match the region you use for Amazon Rekognition operations. If you
// use the AWS CLI to call Amazon Rekognition operations, passing image bytes using
// the Bytes property is not supported. You must first upload the image to an
// Amazon S3 bucket and then call the operation using the S3Object property. For
// Amazon Rekognition to process an S3 object, the user must have permission to
// access the S3 object. For more information, see How Amazon Rekognition works
// with IAM in the Amazon Rekognition Developer Guide.
type Image struct {
// Blob of image bytes up to 5 MBs. Note that the maximum image size you can pass
// to DetectCustomLabels is 4MB.
Bytes []byte
// Identifies an S3 object as the image source.
S3Object *S3Object
noSmithyDocumentSerde
}
// Identifies face image brightness and sharpness.
type ImageQuality struct {
// Value representing brightness of the face. The service returns a value between
// 0 and 100 (inclusive). A higher value indicates a brighter face image.
Brightness *float32
// Value representing sharpness of the face. The service returns a value between 0
// and 100 (inclusive). A higher value indicates a sharper face image.
Sharpness *float32
noSmithyDocumentSerde
}
// An instance of a label returned by Amazon Rekognition Image ( DetectLabels ) or
// by Amazon Rekognition Video ( GetLabelDetection ).
type Instance struct {
// The position of the label instance on the image.
BoundingBox *BoundingBox
// The confidence that Amazon Rekognition has in the accuracy of the bounding box.
Confidence *float32
// The dominant colors found in an individual instance of a label.
DominantColors []DominantColor
noSmithyDocumentSerde
}
// The Kinesis data stream Amazon Rekognition to which the analysis results of a
// Amazon Rekognition stream processor are streamed. For more information, see
// CreateStreamProcessor in the Amazon Rekognition Developer Guide.
type KinesisDataStream struct {
// ARN of the output Amazon Kinesis Data Streams stream.
Arn *string
noSmithyDocumentSerde
}
// Kinesis video stream stream that provides the source streaming video for a
// Amazon Rekognition Video stream processor. For more information, see
// CreateStreamProcessor in the Amazon Rekognition Developer Guide.
type KinesisVideoStream struct {
// ARN of the Kinesis video stream stream that streams the source video.
Arn *string
noSmithyDocumentSerde
}
// Specifies the starting point in a Kinesis stream to start processing. You can
// use the producer timestamp or the fragment number. One of either producer
// timestamp or fragment number is required. If you use the producer timestamp, you
// must put the time in milliseconds. For more information about fragment numbers,
// see Fragment (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_reader_Fragment.html)
// .
type KinesisVideoStreamStartSelector struct {
// The unique identifier of the fragment. This value monotonically increases based
// on the ingestion order.
FragmentNumber *string
// The timestamp from the producer corresponding to the fragment, in milliseconds,
// expressed in unix time format.
ProducerTimestamp *int64
noSmithyDocumentSerde
}
// The known gender identity for the celebrity that matches the provided ID. The
// known gender identity can be Male, Female, Nonbinary, or Unlisted.
type KnownGender struct {
// A string value of the KnownGender info about the Celebrity.
Type KnownGenderType
noSmithyDocumentSerde
}
// Structure containing details about the detected label, including the name,
// detected instances, parent labels, and level of confidence.
type Label struct {
// A list of potential aliases for a given label.
Aliases []LabelAlias
// A list of the categories associated with a given label.
Categories []LabelCategory
// Level of confidence.
Confidence *float32
// If Label represents an object, Instances contains the bounding boxes for each
// instance of the detected object. Bounding boxes are returned for common object
// labels such as people, cars, furniture, apparel or pets.
Instances []Instance
// The name (label) of the object or scene.
Name *string
// The parent labels for a label. The response includes all ancestor labels.
Parents []Parent
noSmithyDocumentSerde
}
// A potential alias of for a given label.
type LabelAlias struct {
// The name of an alias for a given label.
Name *string
noSmithyDocumentSerde
}
// The category that applies to a given label.
type LabelCategory struct {
// The name of a category that applies to a given label.
Name *string
noSmithyDocumentSerde
}
// Information about a label detected in a video analysis request and the time the
// label was detected in the video.
type LabelDetection struct {
// The time duration of a segment in milliseconds, I.e. time elapsed from
// StartTimestampMillis to EndTimestampMillis.
DurationMillis *int64
// The time in milliseconds defining the end of the timeline segment containing a
// continuously detected label.
EndTimestampMillis *int64
// Details about the detected label.
Label *Label
// The time in milliseconds defining the start of the timeline segment containing
// a continuously detected label.
StartTimestampMillis *int64
// Time, in milliseconds from the start of the video, that the label was detected.
// Note that Timestamp is not guaranteed to be accurate to the individual frame
// where the label first appears.
Timestamp int64
noSmithyDocumentSerde
}
// Contains the specified filters that should be applied to a list of returned
// GENERAL_LABELS.
type LabelDetectionSettings struct {
// Contains filters for the object labels returned by DetectLabels. Filters can be
// inclusive, exclusive, or a combination of both and can be applied to individual
// labels or entire label categories. To see a list of label categories, see
// Detecting Labels (https://docs.aws.amazon.com/rekognition/latest/dg/labels.html)
// .
GeneralLabels *GeneralLabelsSettings
noSmithyDocumentSerde
}
// Indicates the location of the landmark on the face.
type Landmark struct {
// Type of landmark.
Type LandmarkType
// The x-coordinate of the landmark expressed as a ratio of the width of the
// image. The x-coordinate is measured from the left-side of the image. For
// example, if the image is 700 pixels wide and the x-coordinate of the landmark is
// at 350 pixels, this value is 0.5.
X *float32
// The y-coordinate of the landmark expressed as a ratio of the height of the
// image. The y-coordinate is measured from the top of the image. For example, if
// the image height is 200 pixels and the y-coordinate of the landmark is at 50
// pixels, this value is 0.25.
Y *float32
noSmithyDocumentSerde
}
// Contains settings that specify the location of an Amazon S3 bucket used to
// store the output of a Face Liveness session. Note that the S3 bucket must be
// located in the caller's AWS account and in the same region as the Face Liveness
// end-point. Additionally, the Amazon S3 object keys are auto-generated by the
// Face Liveness system.
type LivenessOutputConfig struct {
// The path to an AWS Amazon S3 bucket used to store Face Liveness session results.
//
// This member is required.
S3Bucket *string
// The prefix prepended to the output files for the Face Liveness session results.
S3KeyPrefix *string
noSmithyDocumentSerde
}
// Contains metadata for a UserID matched with a given face.
type MatchedUser struct {
// A provided ID for the UserID. Unique within the collection.
UserId *string
// The status of the user matched to a provided FaceID.
UserStatus UserStatus
noSmithyDocumentSerde
}
// Provides information about a single type of inappropriate, unwanted, or
// offensive content found in an image or video. Each type of moderated content has
// a label within a hierarchical taxonomy. For more information, see Content
// moderation in the Amazon Rekognition Developer Guide.
type ModerationLabel struct {
// Specifies the confidence that Amazon Rekognition has that the label has been
// correctly identified. If you don't specify the MinConfidence parameter in the
// call to DetectModerationLabels , the operation returns labels with a confidence
// value greater than or equal to 50 percent.
Confidence *float32
// The label name for the type of unsafe content detected in the image.
Name *string
// The name for the parent label. Labels at the top level of the hierarchy have
// the parent label "" .
ParentName *string
noSmithyDocumentSerde
}
// Indicates whether or not the mouth on the face is open, and the confidence
// level in the determination.
type MouthOpen struct {
// Level of confidence in the determination.
Confidence *float32
// Boolean value that indicates whether the mouth on the face is open or not.
Value bool
noSmithyDocumentSerde
}
// Indicates whether or not the face has a mustache, and the confidence level in
// the determination.
type Mustache struct {
// Level of confidence in the determination.
Confidence *float32
// Boolean value that indicates whether the face has mustache or not.
Value bool
noSmithyDocumentSerde
}
// The Amazon Simple Notification Service topic to which Amazon Rekognition
// publishes the completion status of a video analysis operation. For more
// information, see Calling Amazon Rekognition Video operations (https://docs.aws.amazon.com/rekognition/latest/dg/api-video.html)
// . Note that the Amazon SNS topic must have a topic name that begins with
// AmazonRekognition if you are using the AmazonRekognitionServiceRole permissions
// policy to access the topic. For more information, see Giving access to multiple
// Amazon SNS topics (https://docs.aws.amazon.com/rekognition/latest/dg/api-video-roles.html#api-video-roles-all-topics)
// .
type NotificationChannel struct {
// The ARN of an IAM role that gives Amazon Rekognition publishing permissions to
// the Amazon SNS topic.
//
// This member is required.
RoleArn *string
// The Amazon SNS topic to which Amazon Rekognition posts the completion status.
//
// This member is required.
SNSTopicArn *string
noSmithyDocumentSerde
}
// The S3 bucket and folder location where training output is placed.
type OutputConfig struct {
// The S3 bucket where training output is placed.
S3Bucket *string
// The prefix applied to the training output files.
S3KeyPrefix *string
noSmithyDocumentSerde
}
// A parent label for a label. A label can have 0, 1, or more parents.
type Parent struct {
// The name of the parent label.
Name *string
noSmithyDocumentSerde
}
// Details about a person detected in a video analysis request.
type PersonDetail struct {
// Bounding box around the detected person.
BoundingBox *BoundingBox
// Face details for the detected person.
Face *FaceDetail
// Identifier for the person detected person within a video. Use to keep track of
// the person throughout the video. The identifier is not stored by Amazon
// Rekognition.
Index int64
noSmithyDocumentSerde
}
// Details and path tracking information for a single time a person's path is
// tracked in a video. Amazon Rekognition operations that track people's paths
// return an array of PersonDetection objects with elements for each time a
// person's path is tracked in a video. For more information, see GetPersonTracking
// in the Amazon Rekognition Developer Guide.
type PersonDetection struct {
// Details about a person whose path was tracked in a video.
Person *PersonDetail
// The time, in milliseconds from the start of the video, that the person's path
// was tracked. Note that Timestamp is not guaranteed to be accurate to the
// individual frame where the person's path first appears.
Timestamp int64
noSmithyDocumentSerde
}
// Information about a person whose face matches a face(s) in an Amazon
// Rekognition collection. Includes information about the faces in the Amazon
// Rekognition collection ( FaceMatch ), information about the person ( PersonDetail
// ), and the time stamp for when the person was detected in a video. An array of
// PersonMatch objects is returned by GetFaceSearch .
type PersonMatch struct {
// Information about the faces in the input collection that match the face of a
// person in the video.
FaceMatches []FaceMatch
// Information about the matched person.
Person *PersonDetail
// The time, in milliseconds from the beginning of the video, that the person was
// matched in the video.
Timestamp int64
noSmithyDocumentSerde
}
// The X and Y coordinates of a point on an image or video frame. The X and Y
// values are ratios of the overall image size or video resolution. For example, if
// an input image is 700x200 and the values are X=0.5 and Y=0.25, then the point is
// at the (350,50) pixel coordinate on the image. An array of Point objects makes
// up a Polygon . A Polygon is returned by DetectText and by DetectCustomLabels
// Polygon represents a fine-grained polygon around a detected item. For more
// information, see Geometry in the Amazon Rekognition Developer Guide.
type Point struct {
// The value of the X coordinate for a point on a Polygon .
X *float32
// The value of the Y coordinate for a point on a Polygon .
Y *float32
noSmithyDocumentSerde
}
// Indicates the pose of the face as determined by its pitch, roll, and yaw.
type Pose struct {
// Value representing the face rotation on the pitch axis.
Pitch *float32
// Value representing the face rotation on the roll axis.
Roll *float32
// Value representing the face rotation on the yaw axis.
Yaw *float32
noSmithyDocumentSerde
}
// A description of an Amazon Rekognition Custom Labels project. For more
// information, see DescribeProjects .
type ProjectDescription struct {
// The Unix timestamp for the date and time that the project was created.
CreationTimestamp *time.Time
// Information about the training and test datasets in the project.
Datasets []DatasetMetadata
// The Amazon Resource Name (ARN) of the project.
ProjectArn *string
// The current status of the project.
Status ProjectStatus
noSmithyDocumentSerde
}
// Describes a project policy in the response from ListProjectPolicies .
type ProjectPolicy struct {
// The Unix datetime for the creation of the project policy.
CreationTimestamp *time.Time
// The Unix datetime for when the project policy was last updated.
LastUpdatedTimestamp *time.Time
// The JSON document for the project policy.
PolicyDocument *string
// The name of the project policy.
PolicyName *string
// The revision ID of the project policy.
PolicyRevisionId *string
// The Amazon Resource Name (ARN) of the project to which the project policy is
// attached.
ProjectArn *string
noSmithyDocumentSerde
}
// A description of a version of an Amazon Rekognition Custom Labels model.
type ProjectVersionDescription struct {
// The duration, in seconds, that you were billed for a successful training of the
// model version. This value is only returned if the model version has been
// successfully trained.
BillableTrainingTimeInSeconds *int64
// The Unix datetime for the date and time that training started.
CreationTimestamp *time.Time
// The training results. EvaluationResult is only returned if training is
// successful.
EvaluationResult *EvaluationResult
// The identifer for the AWS Key Management Service key (AWS KMS key) that was
// used to encrypt the model during training.
KmsKeyId *string
// The location of the summary manifest. The summary manifest provides aggregate
// data validation results for the training and test datasets.
ManifestSummary *GroundTruthManifest
// The maximum number of inference units Amazon Rekognition Custom Labels uses to
// auto-scale the model. For more information, see StartProjectVersion .
MaxInferenceUnits *int32
// The minimum number of inference units used by the model. For more information,
// see StartProjectVersion .
MinInferenceUnits *int32
// The location where training results are saved.
OutputConfig *OutputConfig
// The Amazon Resource Name (ARN) of the model version.
ProjectVersionArn *string
// If the model version was copied from a different project,
// SourceProjectVersionArn contains the ARN of the source model version.
SourceProjectVersionArn *string
// The current status of the model version.
Status ProjectVersionStatus
// A descriptive message for an error or warning that occurred.
StatusMessage *string
// Contains information about the testing results.
TestingDataResult *TestingDataResult
// Contains information about the training results.
TrainingDataResult *TrainingDataResult
// The Unix date and time that training of the model ended.
TrainingEndTimestamp *time.Time
noSmithyDocumentSerde
}
// Information about a body part detected by DetectProtectiveEquipment that
// contains PPE. An array of ProtectiveEquipmentBodyPart objects is returned for
// each person detected by DetectProtectiveEquipment .
type ProtectiveEquipmentBodyPart struct {
// The confidence that Amazon Rekognition has in the detection accuracy of the
// detected body part.
Confidence *float32
// An array of Personal Protective Equipment items detected around a body part.
EquipmentDetections []EquipmentDetection
// The detected body part.
Name BodyPart
noSmithyDocumentSerde
}
// A person detected by a call to DetectProtectiveEquipment . The API returns all
// persons detected in the input image in an array of ProtectiveEquipmentPerson
// objects.
type ProtectiveEquipmentPerson struct {
// An array of body parts detected on a person's body (including body parts
// without PPE).
BodyParts []ProtectiveEquipmentBodyPart
// A bounding box around the detected person.
BoundingBox *BoundingBox
// The confidence that Amazon Rekognition has that the bounding box contains a
// person.
Confidence *float32
// The identifier for the detected person. The identifier is only unique for a
// single call to DetectProtectiveEquipment .
Id *int32
noSmithyDocumentSerde
}
// Specifies summary attributes to return from a call to DetectProtectiveEquipment
// . You can specify which types of PPE to summarize. You can also specify a
// minimum confidence value for detections. Summary information is returned in the
// Summary ( ProtectiveEquipmentSummary ) field of the response from
// DetectProtectiveEquipment . The summary includes which persons in an image were
// detected wearing the requested types of person protective equipment (PPE), which
// persons were detected as not wearing PPE, and the persons in which a
// determination could not be made. For more information, see
// ProtectiveEquipmentSummary .
type ProtectiveEquipmentSummarizationAttributes struct {
// The minimum confidence level for which you want summary information. The
// confidence level applies to person detection, body part detection, equipment
// detection, and body part coverage. Amazon Rekognition doesn't return summary
// information with a confidence than this specified value. There isn't a default
// value. Specify a MinConfidence value that is between 50-100% as
// DetectProtectiveEquipment returns predictions only where the detection
// confidence is between 50% - 100%. If you specify a value that is less than 50%,
// the results are the same specifying a value of 50%.
//
// This member is required.
MinConfidence *float32
// An array of personal protective equipment types for which you want summary
// information. If a person is detected wearing a required requipment type, the
// person's ID is added to the PersonsWithRequiredEquipment array field returned
// in ProtectiveEquipmentSummary by DetectProtectiveEquipment .
//
// This member is required.
RequiredEquipmentTypes []ProtectiveEquipmentType
noSmithyDocumentSerde
}
// Summary information for required items of personal protective equipment (PPE)
// detected on persons by a call to DetectProtectiveEquipment . You specify the
// required type of PPE in the SummarizationAttributes (
// ProtectiveEquipmentSummarizationAttributes ) input parameter. The summary
// includes which persons were detected wearing the required personal protective
// equipment ( PersonsWithRequiredEquipment ), which persons were detected as not
// wearing the required PPE ( PersonsWithoutRequiredEquipment ), and the persons in
// which a determination could not be made ( PersonsIndeterminate ). To get a total
// for each category, use the size of the field array. For example, to find out how
// many people were detected as wearing the specified PPE, use the size of the
// PersonsWithRequiredEquipment array. If you want to find out more about a person,
// such as the location ( BoundingBox ) of the person on the image, use the person
// ID in each array element. Each person ID matches the ID field of a
// ProtectiveEquipmentPerson object returned in the Persons array by
// DetectProtectiveEquipment .
type ProtectiveEquipmentSummary struct {
// An array of IDs for persons where it was not possible to determine if they are
// wearing personal protective equipment.
PersonsIndeterminate []int32
// An array of IDs for persons who are wearing detected personal protective
// equipment.
PersonsWithRequiredEquipment []int32
// An array of IDs for persons who are not wearing all of the types of PPE
// specified in the RequiredEquipmentTypes field of the detected personal
// protective equipment.
PersonsWithoutRequiredEquipment []int32
noSmithyDocumentSerde
}
// Specifies a location within the frame that Rekognition checks for objects of
// interest such as text, labels, or faces. It uses a BoundingBox or Polygon to
// set a region of the screen. A word, face, or label is included in the region if
// it is more than half in that region. If there is more than one region, the word,
// face, or label is compared with all regions of the screen. Any object of
// interest that is more than half in a region is kept in the results.
type RegionOfInterest struct {
// The box representing a region of interest on screen.
BoundingBox *BoundingBox
// Specifies a shape made up of up to 10 Point objects to define a region of
// interest.
Polygon []Point
noSmithyDocumentSerde
}
// The Amazon S3 bucket location to which Amazon Rekognition publishes the
// detailed inference results of a video analysis operation. These results include
// the name of the stream processor resource, the session ID of the stream
// processing session, and labeled timestamps and bounding boxes for detected
// labels.
type S3Destination struct {
// The name of the Amazon S3 bucket you want to associate with the streaming video
// project. You must be the owner of the Amazon S3 bucket.
Bucket *string
// The prefix value of the location within the bucket that you want the
// information to be published to. For more information, see Using prefixes (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html)
// .
KeyPrefix *string
noSmithyDocumentSerde
}
// Provides the S3 bucket name and object name. The region for the S3 bucket
// containing the S3 object must match the region you use for Amazon Rekognition
// operations. For Amazon Rekognition to process an S3 object, the user must have
// permission to access the S3 object. For more information, see How Amazon
// Rekognition works with IAM in the Amazon Rekognition Developer Guide.
type S3Object struct {
// Name of the S3 bucket.
Bucket *string
// S3 object key name.
Name *string
// If the bucket is versioning enabled, you can specify the object version.
Version *string
noSmithyDocumentSerde
}
// Provides face metadata such as FaceId, BoundingBox, Confidence of the input
// face used for search.
type SearchedFace struct {
// Unique identifier assigned to the face.
FaceId *string
noSmithyDocumentSerde
}
// Contains data regarding the input face used for a search.
type SearchedFaceDetails struct {
// Structure containing attributes of the face that the algorithm detected. A
// FaceDetail object contains either the default facial attributes or all facial
// attributes. The default attributes are BoundingBox , Confidence , Landmarks ,
// Pose , and Quality . GetFaceDetection is the only Amazon Rekognition Video
// stored video operation that can return a FaceDetail object with all attributes.
// To specify which attributes to return, use the FaceAttributes input parameter
// for StartFaceDetection . The following Amazon Rekognition Video operations
// return only the default attributes. The corresponding Start operations don't
// have a FaceAttributes input parameter:
// - GetCelebrityRecognition
// - GetPersonTracking
// - GetFaceSearch
// The Amazon Rekognition Image DetectFaces and IndexFaces operations can return
// all facial attributes. To specify which attributes to return, use the Attributes
// input parameter for DetectFaces . For IndexFaces , use the DetectAttributes
// input parameter.
FaceDetail *FaceDetail
noSmithyDocumentSerde
}
// Contains metadata about a User searched for within a collection.
type SearchedUser struct {
// A provided ID for the UserID. Unique within the collection.
UserId *string
noSmithyDocumentSerde
}
// A technical cue or shot detection segment detected in a video. An array of
// SegmentDetection objects containing all segments detected in a stored video is
// returned by GetSegmentDetection .
type SegmentDetection struct {
// The duration of a video segment, expressed in frames.
DurationFrames *int64
// The duration of the detected segment in milliseconds.
DurationMillis *int64
// The duration of the timecode for the detected segment in SMPTE format.
DurationSMPTE *string
// The frame number at the end of a video segment, using a frame index that starts
// with 0.
EndFrameNumber *int64
// The frame-accurate SMPTE timecode, from the start of a video, for the end of a
// detected segment. EndTimecode is in HH:MM:SS:fr format (and ;fr for drop
// frame-rates).
EndTimecodeSMPTE *string
// The end time of the detected segment, in milliseconds, from the start of the
// video. This value is rounded down.
EndTimestampMillis int64
// If the segment is a shot detection, contains information about the shot
// detection.
ShotSegment *ShotSegment
// The frame number of the start of a video segment, using a frame index that
// starts with 0.
StartFrameNumber *int64
// The frame-accurate SMPTE timecode, from the start of a video, for the start of
// a detected segment. StartTimecode is in HH:MM:SS:fr format (and ;fr for drop
// frame-rates).
StartTimecodeSMPTE *string
// The start time of the detected segment in milliseconds from the start of the
// video. This value is rounded down. For example, if the actual timestamp is
// 100.6667 milliseconds, Amazon Rekognition Video returns a value of 100 millis.
StartTimestampMillis int64
// If the segment is a technical cue, contains information about the technical cue.
TechnicalCueSegment *TechnicalCueSegment
// The type of the segment. Valid values are TECHNICAL_CUE and SHOT .
Type SegmentType
noSmithyDocumentSerde
}
// Information about the type of a segment requested in a call to
// StartSegmentDetection . An array of SegmentTypeInfo objects is returned by the
// response from GetSegmentDetection .
type SegmentTypeInfo struct {
// The version of the model used to detect segments.
ModelVersion *string
// The type of a segment (technical cue or shot detection).
Type SegmentType
noSmithyDocumentSerde
}
// Information about a shot detection segment detected in a video. For more
// information, see SegmentDetection .
type ShotSegment struct {
// The confidence that Amazon Rekognition Video has in the accuracy of the
// detected segment.
Confidence *float32
// An Identifier for a shot detection segment detected in a video.
Index *int64
noSmithyDocumentSerde
}
// Indicates whether or not the face is smiling, and the confidence level in the
// determination.
type Smile struct {
// Level of confidence in the determination.
Confidence *float32
// Boolean value that indicates whether the face is smiling or not.
Value bool
noSmithyDocumentSerde
}
// Filters applied to the technical cue or shot detection segments. For more
// information, see StartSegmentDetection .
type StartSegmentDetectionFilters struct {
// Filters that are specific to shot detections.
ShotFilter *StartShotDetectionFilter
// Filters that are specific to technical cues.
TechnicalCueFilter *StartTechnicalCueDetectionFilter
noSmithyDocumentSerde
}
// Filters for the shot detection segments returned by GetSegmentDetection . For
// more information, see StartSegmentDetectionFilters .
type StartShotDetectionFilter struct {
// Specifies the minimum confidence that Amazon Rekognition Video must have in
// order to return a detected segment. Confidence represents how certain Amazon
// Rekognition is that a segment is correctly identified. 0 is the lowest
// confidence. 100 is the highest confidence. Amazon Rekognition Video doesn't
// return any segments with a confidence level lower than this specified value. If
// you don't specify MinSegmentConfidence , the GetSegmentDetection returns
// segments with confidence values greater than or equal to 50 percent.
MinSegmentConfidence *float32
noSmithyDocumentSerde
}
// Filters for the technical segments returned by GetSegmentDetection . For more
// information, see StartSegmentDetectionFilters .
type StartTechnicalCueDetectionFilter struct {
// A filter that allows you to control the black frame detection by specifying the
// black levels and pixel coverage of black pixels in a frame. Videos can come from
// multiple sources, formats, and time periods, with different standards and
// varying noise levels for black frames that need to be accounted for.
BlackFrame *BlackFrame
// Specifies the minimum confidence that Amazon Rekognition Video must have in
// order to return a detected segment. Confidence represents how certain Amazon
// Rekognition is that a segment is correctly identified. 0 is the lowest
// confidence. 100 is the highest confidence. Amazon Rekognition Video doesn't
// return any segments with a confidence level lower than this specified value. If
// you don't specify MinSegmentConfidence , GetSegmentDetection returns segments
// with confidence values greater than or equal to 50 percent.
MinSegmentConfidence *float32
noSmithyDocumentSerde
}
// Set of optional parameters that let you set the criteria text must meet to be
// included in your response. WordFilter looks at a word's height, width and
// minimum confidence. RegionOfInterest lets you set a specific region of the
// screen to look for text in.
type StartTextDetectionFilters struct {
// Filter focusing on a certain area of the frame. Uses a BoundingBox object to
// set the region of the screen.
RegionsOfInterest []RegionOfInterest
// Filters focusing on qualities of the text, such as confidence or size.
WordFilter *DetectionFilter
noSmithyDocumentSerde
}
// This is a required parameter for label detection stream processors and should
// not be used to start a face search stream processor.
type StreamProcessingStartSelector struct {
// Specifies the starting point in the stream to start processing. This can be
// done with a producer timestamp or a fragment number in a Kinesis stream.
KVSStreamStartSelector *KinesisVideoStreamStartSelector
noSmithyDocumentSerde
}
// Specifies when to stop processing the stream. You can specify a maximum amount
// of time to process the video.
type StreamProcessingStopSelector struct {
// Specifies the maximum amount of time in seconds that you want the stream to be
// processed. The largest amount of time is 2 minutes. The default is 10 seconds.
MaxDurationInSeconds *int64
noSmithyDocumentSerde
}
// An object that recognizes faces or labels in a streaming video. An Amazon
// Rekognition stream processor is created by a call to CreateStreamProcessor . The
// request parameters for CreateStreamProcessor describe the Kinesis video stream
// source for the streaming video, face recognition parameters, and where to stream
// the analysis resullts.
type StreamProcessor struct {
// Name of the Amazon Rekognition stream processor.
Name *string
// Current status of the Amazon Rekognition stream processor.
Status StreamProcessorStatus
noSmithyDocumentSerde
}
// Allows you to opt in or opt out to share data with Rekognition to improve model
// performance. You can choose this option at the account level or on a per-stream
// basis. Note that if you opt out at the account level this setting is ignored on
// individual streams.
type StreamProcessorDataSharingPreference struct {
// If this option is set to true, you choose to share data with Rekognition to
// improve model performance.
//
// This member is required.
OptIn bool
noSmithyDocumentSerde
}
// Information about the source streaming video.
type StreamProcessorInput struct {
// The Kinesis video stream input stream for the source streaming video.
KinesisVideoStream *KinesisVideoStream
noSmithyDocumentSerde
}
// The Amazon Simple Notification Service topic to which Amazon Rekognition
// publishes the object detection results and completion status of a video analysis
// operation. Amazon Rekognition publishes a notification the first time an object
// of interest or a person is detected in the video stream. For example, if Amazon
// Rekognition detects a person at second 2, a pet at second 4, and a person again
// at second 5, Amazon Rekognition sends 2 object class detected notifications, one
// for a person at second 2 and one for a pet at second 4. Amazon Rekognition also
// publishes an an end-of-session notification with a summary when the stream
// processing session is complete.
type StreamProcessorNotificationChannel struct {
// The Amazon Resource Number (ARN) of the Amazon Amazon Simple Notification
// Service topic to which Amazon Rekognition posts the completion status.
//
// This member is required.
SNSTopicArn *string
noSmithyDocumentSerde
}
// Information about the Amazon Kinesis Data Streams stream to which a Amazon
// Rekognition Video stream processor streams the results of a video analysis. For
// more information, see CreateStreamProcessor in the Amazon Rekognition Developer
// Guide.
type StreamProcessorOutput struct {
// The Amazon Kinesis Data Streams stream to which the Amazon Rekognition stream
// processor streams the analysis results.
KinesisDataStream *KinesisDataStream
// The Amazon S3 bucket location to which Amazon Rekognition publishes the
// detailed inference results of a video analysis operation.
S3Destination *S3Destination
noSmithyDocumentSerde
}
// Input parameters used in a streaming video analyzed by a Amazon Rekognition
// stream processor. You can use FaceSearch to recognize faces in a streaming
// video, or you can use ConnectedHome to detect labels.
type StreamProcessorSettings struct {
// Label detection settings to use on a streaming video. Defining the settings is
// required in the request parameter for CreateStreamProcessor . Including this
// setting in the CreateStreamProcessor request enables you to use the stream
// processor for label detection. You can then select what you want the stream
// processor to detect, such as people or pets. When the stream processor has
// started, one notification is sent for each object class specified. For example,
// if packages and pets are selected, one SNS notification is published the first
// time a package is detected and one SNS notification is published the first time
// a pet is detected, as well as an end-of-session summary.
ConnectedHome *ConnectedHomeSettings
// Face search settings to use on a streaming video.
FaceSearch *FaceSearchSettings
noSmithyDocumentSerde
}
// The stream processor settings that you want to update. ConnectedHome settings
// can be updated to detect different labels with a different minimum confidence.
type StreamProcessorSettingsForUpdate struct {
// The label detection settings you want to use for your stream processor.
ConnectedHomeForUpdate *ConnectedHomeSettingsForUpdate
noSmithyDocumentSerde
}
// The S3 bucket that contains the training summary. The training summary includes
// aggregated evaluation metrics for the entire testing dataset and metrics for
// each individual label. You get the training summary S3 bucket location by
// calling DescribeProjectVersions .
type Summary struct {
// Provides the S3 bucket name and object name. The region for the S3 bucket
// containing the S3 object must match the region you use for Amazon Rekognition
// operations. For Amazon Rekognition to process an S3 object, the user must have
// permission to access the S3 object. For more information, see How Amazon
// Rekognition works with IAM in the Amazon Rekognition Developer Guide.
S3Object *S3Object
noSmithyDocumentSerde
}
// Indicates whether or not the face is wearing sunglasses, and the confidence
// level in the determination.
type Sunglasses struct {
// Level of confidence in the determination.
Confidence *float32
// Boolean value that indicates whether the face is wearing sunglasses or not.
Value bool
noSmithyDocumentSerde
}
// Information about a technical cue segment. For more information, see
// SegmentDetection .
type TechnicalCueSegment struct {
// The confidence that Amazon Rekognition Video has in the accuracy of the
// detected segment.
Confidence *float32
// The type of the technical cue.
Type TechnicalCueType
noSmithyDocumentSerde
}
// The dataset used for testing. Optionally, if AutoCreate is set, Amazon
// Rekognition Custom Labels uses the training dataset to create a test dataset
// with a temporary split of the training dataset.
type TestingData struct {
// The assets used for testing.
Assets []Asset
// If specified, Amazon Rekognition Custom Labels temporarily splits the training
// dataset (80%) to create a test dataset (20%) for the training job. After
// training completes, the test dataset is not stored and the training dataset
// reverts to its previous size.
AutoCreate bool
noSmithyDocumentSerde
}
// Sagemaker Groundtruth format manifest files for the input, output and
// validation datasets that are used and created during testing.
type TestingDataResult struct {
// The testing dataset that was supplied for training.
Input *TestingData
// The subset of the dataset that was actually tested. Some images (assets) might
// not be tested due to file formatting and other issues.
Output *TestingData
// The location of the data validation manifest. The data validation manifest is
// created for the test dataset during model training.
Validation *ValidationData
noSmithyDocumentSerde
}
// Information about a word or line of text detected by DetectText . The
// DetectedText field contains the text that Amazon Rekognition detected in the
// image. Every word and line has an identifier ( Id ). Each word belongs to a line
// and has a parent identifier ( ParentId ) that identifies the line of text in
// which the word appears. The word Id is also an index for the word within a line
// of words. For more information, see Detecting text in the Amazon Rekognition
// Developer Guide.
type TextDetection struct {
// The confidence that Amazon Rekognition has in the accuracy of the detected text
// and the accuracy of the geometry points around the detected text.
Confidence *float32
// The word or line of text recognized by Amazon Rekognition.
DetectedText *string
// The location of the detected text on the image. Includes an axis aligned coarse
// bounding box surrounding the text and a finer grain polygon for more accurate
// spatial information.
Geometry *Geometry
// The identifier for the detected text. The identifier is only unique for a
// single call to DetectText .
Id *int32
// The Parent identifier for the detected text identified by the value of ID . If
// the type of detected text is LINE , the value of ParentId is Null .
ParentId *int32
// The type of text that was detected.
Type TextTypes
noSmithyDocumentSerde
}
// Information about text detected in a video. Incudes the detected text, the time
// in milliseconds from the start of the video that the text was detected, and
// where it was detected on the screen.
type TextDetectionResult struct {
// Details about text detected in a video.
TextDetection *TextDetection
// The time, in milliseconds from the start of the video, that the text was
// detected. Note that Timestamp is not guaranteed to be accurate to the
// individual frame where the text first appears.
Timestamp int64
noSmithyDocumentSerde
}
// The dataset used for training.
type TrainingData struct {
// A Sagemaker GroundTruth manifest file that contains the training images
// (assets).
Assets []Asset
noSmithyDocumentSerde
}
// Sagemaker Groundtruth format manifest files for the input, output and
// validation datasets that are used and created during testing.
type TrainingDataResult struct {
// The training assets that you supplied for training.
Input *TrainingData
// The images (assets) that were actually trained by Amazon Rekognition Custom
// Labels.
Output *TrainingData
// The location of the data validation manifest. The data validation manifest is
// created for the training dataset during model training.
Validation *ValidationData
noSmithyDocumentSerde
}
// A face that IndexFaces detected, but didn't index. Use the Reasons response
// attribute to determine why a face wasn't indexed.
type UnindexedFace struct {
// The structure that contains attributes of a face that IndexFaces detected, but
// didn't index.
FaceDetail *FaceDetail
// An array of reasons that specify why a face wasn't indexed.
// - EXTREME_POSE - The face is at a pose that can't be detected. For example,
// the head is turned too far away from the camera.
// - EXCEEDS_MAX_FACES - The number of faces detected is already higher than
// that specified by the MaxFaces input parameter for IndexFaces .
// - LOW_BRIGHTNESS - The image is too dark.
// - LOW_SHARPNESS - The image is too blurry.
// - LOW_CONFIDENCE - The face was detected with a low confidence.
// - SMALL_BOUNDING_BOX - The bounding box around the face is too small.
Reasons []Reason
noSmithyDocumentSerde
}
// Face details inferred from the image but not used for search. The response
// attribute contains reasons for why a face wasn't used for Search.
type UnsearchedFace struct {
// Structure containing attributes of the face that the algorithm detected. A
// FaceDetail object contains either the default facial attributes or all facial
// attributes. The default attributes are BoundingBox , Confidence , Landmarks ,
// Pose , and Quality . GetFaceDetection is the only Amazon Rekognition Video
// stored video operation that can return a FaceDetail object with all attributes.
// To specify which attributes to return, use the FaceAttributes input parameter
// for StartFaceDetection . The following Amazon Rekognition Video operations
// return only the default attributes. The corresponding Start operations don't
// have a FaceAttributes input parameter:
// - GetCelebrityRecognition
// - GetPersonTracking
// - GetFaceSearch
// The Amazon Rekognition Image DetectFaces and IndexFaces operations can return
// all facial attributes. To specify which attributes to return, use the Attributes
// input parameter for DetectFaces . For IndexFaces , use the DetectAttributes
// input parameter.
FaceDetails *FaceDetail
// Reasons why a face wasn't used for Search.
Reasons []UnsearchedFaceReason
noSmithyDocumentSerde
}
// Contains metadata like FaceId, UserID, and Reasons, for a face that was
// unsuccessfully associated.
type UnsuccessfulFaceAssociation struct {
// Match confidence with the UserID, provides information regarding if a face
// association was unsuccessful because it didn't meet UserMatchThreshold.
Confidence *float32
// A unique identifier assigned to the face.
FaceId *string
// The reason why the association was unsuccessful.
Reasons []UnsuccessfulFaceAssociationReason
// A provided ID for the UserID. Unique within the collection.
UserId *string
noSmithyDocumentSerde
}
// Contains metadata like FaceId, UserID, and Reasons, for a face that was
// unsuccessfully deleted.
type UnsuccessfulFaceDeletion struct {
// A unique identifier assigned to the face.
FaceId *string
// The reason why the deletion was unsuccessful.
Reasons []UnsuccessfulFaceDeletionReason
// A provided ID for the UserID. Unique within the collection.
UserId *string
noSmithyDocumentSerde
}
// Contains metadata like FaceId, UserID, and Reasons, for a face that was
// unsuccessfully disassociated.
type UnsuccessfulFaceDisassociation struct {
// A unique identifier assigned to the face.
FaceId *string
// The reason why the deletion was unsuccessful.
Reasons []UnsuccessfulFaceDisassociationReason
// A provided ID for the UserID. Unique within the collection.
UserId *string
noSmithyDocumentSerde
}
// Metadata of the user stored in a collection.
type User struct {
// A provided ID for the User. Unique within the collection.
UserId *string
// Communicates if the UserID has been updated with latest set of faces to be
// associated with the UserID.
UserStatus UserStatus
noSmithyDocumentSerde
}
// Provides UserID metadata along with the confidence in the match of this UserID
// with the input face.
type UserMatch struct {
// Describes the UserID metadata.
Similarity *float32
// Confidence in the match of this UserID with the input face.
User *MatchedUser
noSmithyDocumentSerde
}
// Contains the Amazon S3 bucket location of the validation data for a model
// training job. The validation data includes error information for individual JSON
// Lines in the dataset. For more information, see Debugging a Failed Model
// Training in the Amazon Rekognition Custom Labels Developer Guide. You get the
// ValidationData object for the training dataset ( TrainingDataResult ) and the
// test dataset ( TestingDataResult ) by calling DescribeProjectVersions . The
// assets array contains a single Asset object. The GroundTruthManifest field of
// the Asset object contains the S3 bucket location of the validation data.
type ValidationData struct {
// The assets that comprise the validation data.
Assets []Asset
noSmithyDocumentSerde
}
// Video file stored in an Amazon S3 bucket. Amazon Rekognition video start
// operations such as StartLabelDetection use Video to specify a video for
// analysis. The supported file formats are .mp4, .mov and .avi.
type Video struct {
// The Amazon S3 bucket name and file name for the video.
S3Object *S3Object
noSmithyDocumentSerde
}
// Information about a video that Amazon Rekognition analyzed. Videometadata is
// returned in every page of paginated responses from a Amazon Rekognition video
// operation.
type VideoMetadata struct {
// Type of compression used in the analyzed video.
Codec *string
// A description of the range of luminance values in a video, either LIMITED (16
// to 235) or FULL (0 to 255).
ColorRange VideoColorRange
// Length of the video in milliseconds.
DurationMillis *int64
// Format of the analyzed video. Possible values are MP4, MOV and AVI.
Format *string
// Vertical pixel dimension of the video.
FrameHeight *int64
// Number of frames per second in the video.
FrameRate *float32
// Horizontal pixel dimension of the video.
FrameWidth *int64
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 2,581 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
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 = "resiliencehub"
const ServiceAPIVersion = "2020-04-30"
// Client provides the API client to make operations call for AWS Resilience Hub.
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, "resiliencehub", 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 resiliencehub
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 resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds the resource mapping for the draft application version. You can also
// update an existing resource mapping to a new physical resource.
func (c *Client) AddDraftAppVersionResourceMappings(ctx context.Context, params *AddDraftAppVersionResourceMappingsInput, optFns ...func(*Options)) (*AddDraftAppVersionResourceMappingsOutput, error) {
if params == nil {
params = &AddDraftAppVersionResourceMappingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddDraftAppVersionResourceMappings", params, optFns, c.addOperationAddDraftAppVersionResourceMappingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddDraftAppVersionResourceMappingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddDraftAppVersionResourceMappingsInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// Mappings used to map logical resources from the template to physical resources.
// You can use the mapping type CFN_STACK if the application template uses a
// logical stack name. Or you can map individual resources by using the mapping
// type RESOURCE . We recommend using the mapping type CFN_STACK if the
// application is backed by a CloudFormation stack.
//
// This member is required.
ResourceMappings []types.ResourceMapping
noSmithyDocumentSerde
}
type AddDraftAppVersionResourceMappingsOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// Mappings used to map logical resources from the template to physical resources.
// You can use the mapping type CFN_STACK if the application template uses a
// logical stack name. Or you can map individual resources by using the mapping
// type RESOURCE . We recommend using the mapping type CFN_STACK if the
// application is backed by a CloudFormation stack.
//
// This member is required.
ResourceMappings []types.ResourceMapping
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddDraftAppVersionResourceMappingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpAddDraftAppVersionResourceMappings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAddDraftAppVersionResourceMappings{}, 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 = addOpAddDraftAppVersionResourceMappingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddDraftAppVersionResourceMappings(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_opAddDraftAppVersionResourceMappings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "AddDraftAppVersionResourceMappings",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an Resilience Hub application. An Resilience Hub application is a
// collection of Amazon Web Services resources structured to prevent and recover
// Amazon Web Services application disruptions. To describe an Resilience Hub
// application, you provide an application name, resources from one or more
// CloudFormation stacks, Resource Groups, Terraform state files, AppRegistry
// applications, and an appropriate resiliency policy. For more information about
// the number of resources supported per application, see Service Quotas (https://docs.aws.amazon.com/general/latest/gr/resiliencehub.html#limits_resiliencehub)
// . After you create an Resilience Hub application, you publish it so that you can
// run a resiliency assessment on it. You can then use recommendations from the
// assessment to improve resiliency by running another assessment, comparing
// results, and then iterating the process until you achieve your goals for
// recovery time objective (RTO) and recovery point objective (RPO).
func (c *Client) CreateApp(ctx context.Context, params *CreateAppInput, optFns ...func(*Options)) (*CreateAppOutput, error) {
if params == nil {
params = &CreateAppInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateApp", params, optFns, c.addOperationCreateAppMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAppOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAppInput struct {
// The name for the application.
//
// This member is required.
Name *string
// Assessment execution schedule with 'Daily' or 'Disabled' values.
AssessmentSchedule types.AppAssessmentScheduleType
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
// The optional description for an app.
Description *string
// The Amazon Resource Name (ARN) of the resiliency policy. The format for this
// ARN is: arn: partition :resiliencehub: region : account :resiliency-policy/
// policy-id . For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
PolicyArn *string
// The tags assigned to the resource. A tag is a label that you assign to an
// Amazon Web Services resource. Each tag consists of a key/value pair.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateAppOutput struct {
// The created application returned as an object with details including compliance
// status, creation time, description, resiliency score, and more.
//
// This member is required.
App *types.App
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAppMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateApp{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateApp{}, 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_opCreateAppMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateAppValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApp(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_initializeOpCreateApp struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateApp) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateApp) 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.(*CreateAppInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAppInput ")
}
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_opCreateAppMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateApp{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateApp(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "CreateApp",
}
}
| 197 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new Application Component in the Resilience Hub application. This API
// updates the Resilience Hub application draft version. To use this Application
// Component for running assessments, you must publish the Resilience Hub
// application using the PublishAppVersion API.
func (c *Client) CreateAppVersionAppComponent(ctx context.Context, params *CreateAppVersionAppComponentInput, optFns ...func(*Options)) (*CreateAppVersionAppComponentOutput, error) {
if params == nil {
params = &CreateAppVersionAppComponentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAppVersionAppComponent", params, optFns, c.addOperationCreateAppVersionAppComponentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAppVersionAppComponentOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAppVersionAppComponentInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The name of the Application Component.
//
// This member is required.
Name *string
// The type of Application Component. For more information about the types of
// Application Component, see Grouping resources in an AppComponent (https://docs.aws.amazon.com/resilience-hub/latest/userguide/AppComponent.grouping.html)
// .
//
// This member is required.
Type *string
// Currently, there is no supported additional information for Application
// Components.
AdditionalInfo map[string][]string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
// The identifier of the Application Component.
Id *string
noSmithyDocumentSerde
}
type CreateAppVersionAppComponentOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// The list of Application Components that belong to this resource.
AppComponent *types.AppComponent
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAppVersionAppComponentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAppVersionAppComponent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAppVersionAppComponent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateAppVersionAppComponentMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateAppVersionAppComponentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAppVersionAppComponent(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_initializeOpCreateAppVersionAppComponent struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateAppVersionAppComponent) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateAppVersionAppComponentInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAppVersionAppComponentInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateAppVersionAppComponentMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAppVersionAppComponent{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateAppVersionAppComponent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "CreateAppVersionAppComponent",
}
}
| 205 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a resource to the Resilience Hub application and assigns it to the
// specified Application Components. If you specify a new Application Component,
// Resilience Hub will automatically create the Application Component.
// - This action has no effect outside Resilience Hub.
// - This API updates the Resilience Hub application draft version. To use this
// resource for running resiliency assessments, you must publish the Resilience Hub
// application using the PublishAppVersion API.
// - To update application version with new physicalResourceID , you must call
// ResolveAppVersionResources API.
func (c *Client) CreateAppVersionResource(ctx context.Context, params *CreateAppVersionResourceInput, optFns ...func(*Options)) (*CreateAppVersionResourceOutput, error) {
if params == nil {
params = &CreateAppVersionResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAppVersionResource", params, optFns, c.addOperationCreateAppVersionResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAppVersionResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAppVersionResourceInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The list of Application Components that this resource belongs to. If an
// Application Component is not part of the Resilience Hub application, it will be
// added.
//
// This member is required.
AppComponents []string
// The logical identifier of the resource.
//
// This member is required.
LogicalResourceId *types.LogicalResourceId
// The physical identifier of the resource.
//
// This member is required.
PhysicalResourceId *string
// The type of resource.
//
// This member is required.
ResourceType *string
// Currently, there is no supported additional information for resources.
AdditionalInfo map[string][]string
// The Amazon Web Services account that owns the physical resource.
AwsAccountId *string
// The Amazon Web Services region that owns the physical resource.
AwsRegion *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
// The name of the resource.
ResourceName *string
noSmithyDocumentSerde
}
type CreateAppVersionResourceOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// Defines a physical resource. A physical resource is a resource that exists in
// your account. It can be identified using an Amazon Resource Name (ARN) or a
// Resilience Hub-native identifier.
PhysicalResource *types.PhysicalResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAppVersionResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAppVersionResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAppVersionResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateAppVersionResourceMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateAppVersionResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAppVersionResource(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_initializeOpCreateAppVersionResource struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateAppVersionResource) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateAppVersionResourceInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAppVersionResourceInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateAppVersionResourceMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAppVersionResource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateAppVersionResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "CreateAppVersionResource",
}
}
| 227 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new recommendation template for the Resilience Hub application.
func (c *Client) CreateRecommendationTemplate(ctx context.Context, params *CreateRecommendationTemplateInput, optFns ...func(*Options)) (*CreateRecommendationTemplateOutput, error) {
if params == nil {
params = &CreateRecommendationTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateRecommendationTemplate", params, optFns, c.addOperationCreateRecommendationTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateRecommendationTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateRecommendationTemplateInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// The name for the recommendation template.
//
// This member is required.
Name *string
// The name of the Amazon S3 bucket that will contain the recommendation template.
BucketName *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
// The format for the recommendation template. CfnJson The template is
// CloudFormation JSON. CfnYaml The template is CloudFormation YAML.
Format types.TemplateFormat
// Identifiers for the recommendations used to create a recommendation template.
RecommendationIds []string
// An array of strings that specify the recommendation template type or types.
// Alarm The template is an AlarmRecommendation template. Sop The template is a
// SopRecommendation template. Test The template is a TestRecommendation template.
RecommendationTypes []types.RenderRecommendationType
// The tags assigned to the resource. A tag is a label that you assign to an
// Amazon Web Services resource. Each tag consists of a key/value pair.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateRecommendationTemplateOutput struct {
// The newly created recommendation template, returned as an object. This object
// includes the template's name, format, status, tags, Amazon S3 bucket location,
// and more.
RecommendationTemplate *types.RecommendationTemplate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateRecommendationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRecommendationTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRecommendationTemplate{}, 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_opCreateRecommendationTemplateMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateRecommendationTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRecommendationTemplate(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_initializeOpCreateRecommendationTemplate struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateRecommendationTemplate) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateRecommendationTemplate) 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.(*CreateRecommendationTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateRecommendationTemplateInput ")
}
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_opCreateRecommendationTemplateMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateRecommendationTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateRecommendationTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "CreateRecommendationTemplate",
}
}
| 196 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a resiliency policy for an application.
func (c *Client) CreateResiliencyPolicy(ctx context.Context, params *CreateResiliencyPolicyInput, optFns ...func(*Options)) (*CreateResiliencyPolicyOutput, error) {
if params == nil {
params = &CreateResiliencyPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateResiliencyPolicy", params, optFns, c.addOperationCreateResiliencyPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateResiliencyPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateResiliencyPolicyInput struct {
// The type of resiliency policy to be created, including the recovery time
// objective (RTO) and recovery point objective (RPO) in seconds.
//
// This member is required.
Policy map[string]types.FailurePolicy
// The name of the policy
//
// This member is required.
PolicyName *string
// The tier for this resiliency policy, ranging from the highest severity (
// MissionCritical ) to lowest ( NonCritical ).
//
// This member is required.
Tier types.ResiliencyPolicyTier
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
// Specifies a high-level geographical location constraint for where your
// resilience policy data can be stored.
DataLocationConstraint types.DataLocationConstraint
// The description for the policy.
PolicyDescription *string
// The tags assigned to the resource. A tag is a label that you assign to an
// Amazon Web Services resource. Each tag consists of a key/value pair.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateResiliencyPolicyOutput struct {
// The type of resiliency policy that was created, including the recovery time
// objective (RTO) and recovery point objective (RPO) in seconds.
//
// This member is required.
Policy *types.ResiliencyPolicy
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateResiliencyPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateResiliencyPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateResiliencyPolicy{}, 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_opCreateResiliencyPolicyMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateResiliencyPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResiliencyPolicy(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_initializeOpCreateResiliencyPolicy struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateResiliencyPolicy) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateResiliencyPolicy) 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.(*CreateResiliencyPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateResiliencyPolicyInput ")
}
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_opCreateResiliencyPolicyMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateResiliencyPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateResiliencyPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "CreateResiliencyPolicy",
}
}
| 193 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes an Resilience Hub application. This is a destructive action that can't
// be undone.
func (c *Client) DeleteApp(ctx context.Context, params *DeleteAppInput, optFns ...func(*Options)) (*DeleteAppOutput, error) {
if params == nil {
params = &DeleteAppInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApp", params, optFns, c.addOperationDeleteAppMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAppOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAppInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
// A boolean option to force the deletion of an Resilience Hub application.
ForceDelete *bool
noSmithyDocumentSerde
}
type DeleteAppOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAppMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteApp{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteApp{}, 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_opDeleteAppMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteAppValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApp(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_initializeOpDeleteApp struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteApp) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteApp) 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.(*DeleteAppInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAppInput ")
}
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_opDeleteAppMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteApp{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteApp(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DeleteApp",
}
}
| 178 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes an Resilience Hub application assessment. This is a destructive action
// that can't be undone.
func (c *Client) DeleteAppAssessment(ctx context.Context, params *DeleteAppAssessmentInput, optFns ...func(*Options)) (*DeleteAppAssessmentOutput, error) {
if params == nil {
params = &DeleteAppAssessmentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAppAssessment", params, optFns, c.addOperationDeleteAppAssessmentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAppAssessmentOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAppAssessmentInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
noSmithyDocumentSerde
}
type DeleteAppAssessmentOutput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// The current status of the assessment for the resiliency policy.
//
// This member is required.
AssessmentStatus types.AssessmentStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAppAssessmentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAppAssessment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAppAssessment{}, 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_opDeleteAppAssessmentMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteAppAssessmentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAppAssessment(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_initializeOpDeleteAppAssessment struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteAppAssessment) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteAppAssessment) 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.(*DeleteAppAssessmentInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAppAssessmentInput ")
}
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_opDeleteAppAssessmentMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteAppAssessment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteAppAssessment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DeleteAppAssessment",
}
}
| 181 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes an Application Component from the Resilience Hub application.
// - This API updates the Resilience Hub application draft version. To use this
// Application Component for running assessments, you must publish the Resilience
// Hub application using the PublishAppVersion API.
// - You will not be able to delete an Application Component if it has resources
// associated with it.
func (c *Client) DeleteAppVersionAppComponent(ctx context.Context, params *DeleteAppVersionAppComponentInput, optFns ...func(*Options)) (*DeleteAppVersionAppComponentOutput, error) {
if params == nil {
params = &DeleteAppVersionAppComponentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAppVersionAppComponent", params, optFns, c.addOperationDeleteAppVersionAppComponentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAppVersionAppComponentOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAppVersionAppComponentInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The identifier of the Application Component.
//
// This member is required.
Id *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
noSmithyDocumentSerde
}
type DeleteAppVersionAppComponentOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// The list of Application Components that belong to this resource.
AppComponent *types.AppComponent
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAppVersionAppComponentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAppVersionAppComponent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAppVersionAppComponent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDeleteAppVersionAppComponentMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteAppVersionAppComponentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAppVersionAppComponent(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_initializeOpDeleteAppVersionAppComponent struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteAppVersionAppComponent) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*DeleteAppVersionAppComponentInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAppVersionAppComponentInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opDeleteAppVersionAppComponentMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteAppVersionAppComponent{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteAppVersionAppComponent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DeleteAppVersionAppComponent",
}
}
| 193 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a resource from the Resilience Hub application.
// - You can only delete a manually added resource. To exclude non-manually
// added resources, use the UpdateAppVersionResource API.
// - This action has no effect outside Resilience Hub.
// - This API updates the Resilience Hub application draft version. To use this
// resource for running resiliency assessments, you must publish the Resilience Hub
// application using the PublishAppVersion API.
func (c *Client) DeleteAppVersionResource(ctx context.Context, params *DeleteAppVersionResourceInput, optFns ...func(*Options)) (*DeleteAppVersionResourceOutput, error) {
if params == nil {
params = &DeleteAppVersionResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAppVersionResource", params, optFns, c.addOperationDeleteAppVersionResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAppVersionResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAppVersionResourceInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Amazon Web Services account that owns the physical resource.
AwsAccountId *string
// The Amazon Web Services region that owns the physical resource.
AwsRegion *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
// The logical identifier of the resource.
LogicalResourceId *types.LogicalResourceId
// The physical identifier of the resource.
PhysicalResourceId *string
// The name of the resource.
ResourceName *string
noSmithyDocumentSerde
}
type DeleteAppVersionResourceOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// Defines a physical resource. A physical resource is a resource that exists in
// your account. It can be identified using an Amazon Resource Name (ARN) or a
// Resilience Hub-native identifier.
PhysicalResource *types.PhysicalResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAppVersionResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAppVersionResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAppVersionResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDeleteAppVersionResourceMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteAppVersionResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAppVersionResource(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_initializeOpDeleteAppVersionResource struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteAppVersionResource) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*DeleteAppVersionResourceInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAppVersionResourceInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opDeleteAppVersionResourceMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteAppVersionResource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteAppVersionResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DeleteAppVersionResource",
}
}
| 206 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a recommendation template. This is a destructive action that can't be
// undone.
func (c *Client) DeleteRecommendationTemplate(ctx context.Context, params *DeleteRecommendationTemplateInput, optFns ...func(*Options)) (*DeleteRecommendationTemplateOutput, error) {
if params == nil {
params = &DeleteRecommendationTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteRecommendationTemplate", params, optFns, c.addOperationDeleteRecommendationTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteRecommendationTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteRecommendationTemplateInput struct {
// The Amazon Resource Name (ARN) for a recommendation template.
//
// This member is required.
RecommendationTemplateArn *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
noSmithyDocumentSerde
}
type DeleteRecommendationTemplateOutput struct {
// The Amazon Resource Name (ARN) for a recommendation template.
//
// This member is required.
RecommendationTemplateArn *string
// The status of the action.
//
// This member is required.
Status types.RecommendationTemplateStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteRecommendationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRecommendationTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRecommendationTemplate{}, 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_opDeleteRecommendationTemplateMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteRecommendationTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRecommendationTemplate(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_initializeOpDeleteRecommendationTemplate struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteRecommendationTemplate) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteRecommendationTemplate) 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.(*DeleteRecommendationTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteRecommendationTemplateInput ")
}
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_opDeleteRecommendationTemplateMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteRecommendationTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteRecommendationTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DeleteRecommendationTemplate",
}
}
| 175 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a resiliency policy. This is a destructive action that can't be undone.
func (c *Client) DeleteResiliencyPolicy(ctx context.Context, params *DeleteResiliencyPolicyInput, optFns ...func(*Options)) (*DeleteResiliencyPolicyOutput, error) {
if params == nil {
params = &DeleteResiliencyPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteResiliencyPolicy", params, optFns, c.addOperationDeleteResiliencyPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteResiliencyPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteResiliencyPolicyInput struct {
// The Amazon Resource Name (ARN) of the resiliency policy. The format for this
// ARN is: arn: partition :resiliencehub: region : account :resiliency-policy/
// policy-id . For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
PolicyArn *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
noSmithyDocumentSerde
}
type DeleteResiliencyPolicyOutput struct {
// The Amazon Resource Name (ARN) of the resiliency policy. The format for this
// ARN is: arn: partition :resiliencehub: region : account :resiliency-policy/
// policy-id . For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
PolicyArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteResiliencyPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteResiliencyPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteResiliencyPolicy{}, 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_opDeleteResiliencyPolicyMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteResiliencyPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResiliencyPolicy(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_initializeOpDeleteResiliencyPolicy struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteResiliencyPolicy) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteResiliencyPolicy) 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.(*DeleteResiliencyPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteResiliencyPolicyInput ")
}
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_opDeleteResiliencyPolicyMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteResiliencyPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteResiliencyPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DeleteResiliencyPolicy",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes an Resilience Hub application.
func (c *Client) DescribeApp(ctx context.Context, params *DescribeAppInput, optFns ...func(*Options)) (*DescribeAppOutput, error) {
if params == nil {
params = &DescribeAppInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeApp", params, optFns, c.addOperationDescribeAppMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAppOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAppInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
noSmithyDocumentSerde
}
type DescribeAppOutput struct {
// The specified application, returned as an object with details including
// compliance status, creation time, description, resiliency score, and more.
//
// This member is required.
App *types.App
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAppMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeApp{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeApp{}, 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 = addOpDescribeAppValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeApp(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_opDescribeApp(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeApp",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes an assessment for an Resilience Hub application.
func (c *Client) DescribeAppAssessment(ctx context.Context, params *DescribeAppAssessmentInput, optFns ...func(*Options)) (*DescribeAppAssessmentOutput, error) {
if params == nil {
params = &DescribeAppAssessmentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAppAssessment", params, optFns, c.addOperationDescribeAppAssessmentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAppAssessmentOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAppAssessmentInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
noSmithyDocumentSerde
}
type DescribeAppAssessmentOutput struct {
// The assessment for an Resilience Hub application, returned as an object. This
// object includes Amazon Resource Names (ARNs), compliance information, compliance
// status, cost, messages, resiliency scores, and more.
//
// This member is required.
Assessment *types.AppAssessment
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAppAssessmentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppAssessment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppAssessment{}, 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 = addOpDescribeAppAssessmentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppAssessment(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_opDescribeAppAssessment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeAppAssessment",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the Resilience Hub application version.
func (c *Client) DescribeAppVersion(ctx context.Context, params *DescribeAppVersionInput, optFns ...func(*Options)) (*DescribeAppVersionOutput, error) {
if params == nil {
params = &DescribeAppVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAppVersion", params, optFns, c.addOperationDescribeAppVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAppVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAppVersionInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
noSmithyDocumentSerde
}
type DescribeAppVersionOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// Additional configuration parameters for an Resilience Hub application. If you
// want to implement additionalInfo through the Resilience Hub console rather than
// using an API call, see Configure the application configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter supports only failover region and account.
AdditionalInfo map[string][]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAppVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAppVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_opDescribeAppVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeAppVersion",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes an Application Component in the Resilience Hub application.
func (c *Client) DescribeAppVersionAppComponent(ctx context.Context, params *DescribeAppVersionAppComponentInput, optFns ...func(*Options)) (*DescribeAppVersionAppComponentOutput, error) {
if params == nil {
params = &DescribeAppVersionAppComponentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAppVersionAppComponent", params, optFns, c.addOperationDescribeAppVersionAppComponentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAppVersionAppComponentOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAppVersionAppComponentInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// The identifier of the Application Component.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DescribeAppVersionAppComponentOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// The list of Application Components that belong to this resource.
AppComponent *types.AppComponent
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAppVersionAppComponentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppVersionAppComponent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppVersionAppComponent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAppVersionAppComponentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppVersionAppComponent(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_opDescribeAppVersionAppComponent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeAppVersionAppComponent",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes a resource of the Resilience Hub application. This API accepts only
// one of the following parameters to descibe the resource:
// - resourceName
// - logicalResourceId
// - physicalResourceId (Along with physicalResourceId , you can also provide
// awsAccountId , and awsRegion )
func (c *Client) DescribeAppVersionResource(ctx context.Context, params *DescribeAppVersionResourceInput, optFns ...func(*Options)) (*DescribeAppVersionResourceOutput, error) {
if params == nil {
params = &DescribeAppVersionResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAppVersionResource", params, optFns, c.addOperationDescribeAppVersionResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAppVersionResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAppVersionResourceInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// The Amazon Web Services account that owns the physical resource.
AwsAccountId *string
// The Amazon Web Services region that owns the physical resource.
AwsRegion *string
// The logical identifier of the resource.
LogicalResourceId *types.LogicalResourceId
// The physical identifier of the resource.
PhysicalResourceId *string
// The name of the resource.
ResourceName *string
noSmithyDocumentSerde
}
type DescribeAppVersionResourceOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// Defines a physical resource. A physical resource is a resource that exists in
// your account. It can be identified using an Amazon Resource Name (ARN) or a
// Resilience Hub-native identifier.
PhysicalResource *types.PhysicalResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAppVersionResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppVersionResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppVersionResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAppVersionResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppVersionResource(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_opDescribeAppVersionResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeAppVersionResource",
}
}
| 168 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the resolution status for the specified resolution identifier for an
// application version. If resolutionId is not specified, the current resolution
// status is returned.
func (c *Client) DescribeAppVersionResourcesResolutionStatus(ctx context.Context, params *DescribeAppVersionResourcesResolutionStatusInput, optFns ...func(*Options)) (*DescribeAppVersionResourcesResolutionStatusOutput, error) {
if params == nil {
params = &DescribeAppVersionResourcesResolutionStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAppVersionResourcesResolutionStatus", params, optFns, c.addOperationDescribeAppVersionResourcesResolutionStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAppVersionResourcesResolutionStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAppVersionResourcesResolutionStatusInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The identifier for a specific resolution.
ResolutionId *string
noSmithyDocumentSerde
}
type DescribeAppVersionResourcesResolutionStatusOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The identifier for a specific resolution.
//
// This member is required.
ResolutionId *string
// The status of the action.
//
// This member is required.
Status types.ResourceResolutionStatusType
// The returned error message for the request.
ErrorMessage *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAppVersionResourcesResolutionStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus{}, 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 = addOpDescribeAppVersionResourcesResolutionStatusValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppVersionResourcesResolutionStatus(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_opDescribeAppVersionResourcesResolutionStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeAppVersionResourcesResolutionStatus",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes details about an Resilience Hub application.
func (c *Client) DescribeAppVersionTemplate(ctx context.Context, params *DescribeAppVersionTemplateInput, optFns ...func(*Options)) (*DescribeAppVersionTemplateOutput, error) {
if params == nil {
params = &DescribeAppVersionTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAppVersionTemplate", params, optFns, c.addOperationDescribeAppVersionTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAppVersionTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAppVersionTemplateInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
noSmithyDocumentSerde
}
type DescribeAppVersionTemplateOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// A JSON string that provides information about your application structure. To
// learn more about the appTemplateBody template, see the sample template provided
// in the Examples section. The appTemplateBody JSON string has the following
// structure:
// - resources The list of logical resources that must be included in the
// Resilience Hub application. Type: Array Don't add the resources that you want to
// exclude. Each resources array item includes the following fields:
// - logicalResourceId The logical identifier of the resource. Type: Object Each
// logicalResourceId object includes the following fields:
// - identifier The identifier of the resource. Type: String
// - logicalStackName The name of the CloudFormation stack this resource belongs
// to. Type: String
// - resourceGroupName The name of the resource group this resource belongs to.
// Type: String
// - terraformSourceName The name of the Terraform S3 state file this resource
// belongs to. Type: String
// - eksSourceName The name of the Amazon Elastic Kubernetes Service cluster and
// namespace this resource belongs to. This parameter accepts values in
// "eks-cluster/namespace" format. Type: String
// - type The type of resource. Type: string
// - name The name of the resource. Type: String
// - additionalInfo Additional configuration parameters for an Resilience Hub
// application. If you want to implement additionalInfo through the Resilience
// Hub console rather than using an API call, see Configure the application
// configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter accepts a key-value mapping (in a string format) of
// only one failover region and one associated account. Key: "failover-regions"
// Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"
// - appComponents The list of Application Components that this resource belongs
// to. If an Application Component is not part of the Resilience Hub application,
// it will be added. Type: Array Each appComponents array item includes the
// following fields:
// - name The name of the Application Component. Type: String
// - type The type of Application Component. For more information about the types
// of Application Component, see Grouping resources in an AppComponent (https://docs.aws.amazon.com/resilience-hub/latest/userguide/AppComponent.grouping.html)
// . Type: String
// - resourceNames The list of included resources that are assigned to the
// Application Component. Type: Array of strings
// - additionalInfo Additional configuration parameters for an Resilience Hub
// application. If you want to implement additionalInfo through the Resilience
// Hub console rather than using an API call, see Configure the application
// configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter accepts a key-value mapping (in a string format) of
// only one failover region and one associated account. Key: "failover-regions"
// Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"
// - excludedResources The list of logical resource identifiers to be excluded
// from the application. Type: Array Don't add the resources that you want to
// include. Each excludedResources array item includes the following fields:
// - logicalResourceIds The logical identifier of the resource. Type: Object You
// can configure only one of the following fields:
// - logicalStackName
// - resourceGroupName
// - terraformSourceName
// - eksSourceName Each logicalResourceIds object includes the following fields:
// - identifier The identifier of the resource. Type: String
// - logicalStackName The name of the CloudFormation stack this resource belongs
// to. Type: String
// - resourceGroupName The name of the resource group this resource belongs to.
// Type: String
// - terraformSourceName The name of the Terraform S3 state file this resource
// belongs to. Type: String
// - eksSourceName The name of the Amazon Elastic Kubernetes Service cluster and
// namespace this resource belongs to. This parameter accepts values in
// "eks-cluster/namespace" format. Type: String
// - version The Resilience Hub application version.
// - additionalInfo Additional configuration parameters for an Resilience Hub
// application. If you want to implement additionalInfo through the Resilience
// Hub console rather than using an API call, see Configure the application
// configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter accepts a key-value mapping (in a string format) of
// only one failover region and one associated account. Key: "failover-regions"
// Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"
//
// This member is required.
AppTemplateBody *string
// The version of the application.
//
// This member is required.
AppVersion *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAppVersionTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAppVersionTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAppVersionTemplate{}, 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 = addOpDescribeAppVersionTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAppVersionTemplate(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_opDescribeAppVersionTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeAppVersionTemplate",
}
}
| 218 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Describes the status of importing resources to an application version. If you
// get a 404 error with ResourceImportStatusNotFoundAppMetadataException , you must
// call importResourcesToDraftAppVersion after creating the application and before
// calling describeDraftAppVersionResourcesImportStatus to obtain the status.
func (c *Client) DescribeDraftAppVersionResourcesImportStatus(ctx context.Context, params *DescribeDraftAppVersionResourcesImportStatusInput, optFns ...func(*Options)) (*DescribeDraftAppVersionResourcesImportStatusOutput, error) {
if params == nil {
params = &DescribeDraftAppVersionResourcesImportStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeDraftAppVersionResourcesImportStatus", params, optFns, c.addOperationDescribeDraftAppVersionResourcesImportStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeDraftAppVersionResourcesImportStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeDraftAppVersionResourcesImportStatusInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
noSmithyDocumentSerde
}
type DescribeDraftAppVersionResourcesImportStatusOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The status of the action.
//
// This member is required.
Status types.ResourceImportStatusType
// The timestamp for when the status last changed.
//
// This member is required.
StatusChangeTime *time.Time
// The returned error message for the request.
ErrorMessage *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeDraftAppVersionResourcesImportStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus{}, 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 = addOpDescribeDraftAppVersionResourcesImportStatusValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDraftAppVersionResourcesImportStatus(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_opDescribeDraftAppVersionResourcesImportStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeDraftAppVersionResourcesImportStatus",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes a specified resiliency policy for an Resilience Hub application. The
// returned policy object includes creation time, data location constraints, the
// Amazon Resource Name (ARN) for the policy, tags, tier, and more.
func (c *Client) DescribeResiliencyPolicy(ctx context.Context, params *DescribeResiliencyPolicyInput, optFns ...func(*Options)) (*DescribeResiliencyPolicyOutput, error) {
if params == nil {
params = &DescribeResiliencyPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeResiliencyPolicy", params, optFns, c.addOperationDescribeResiliencyPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeResiliencyPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeResiliencyPolicyInput struct {
// The Amazon Resource Name (ARN) of the resiliency policy. The format for this
// ARN is: arn: partition :resiliencehub: region : account :resiliency-policy/
// policy-id . For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
PolicyArn *string
noSmithyDocumentSerde
}
type DescribeResiliencyPolicyOutput struct {
// Information about the specific resiliency policy, returned as an object. This
// object includes creation time, data location constraints, its name, description,
// tags, the recovery time objective (RTO) and recovery point objective (RPO) in
// seconds, and more.
//
// This member is required.
Policy *types.ResiliencyPolicy
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeResiliencyPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeResiliencyPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeResiliencyPolicy{}, 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 = addOpDescribeResiliencyPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeResiliencyPolicy(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_opDescribeResiliencyPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "DescribeResiliencyPolicy",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Imports resources to Resilience Hub application draft version from different
// input sources. For more information about the input sources supported by
// Resilience Hub, see Discover the structure and describe your Resilience Hub
// application (https://docs.aws.amazon.com/resilience-hub/latest/userguide/discover-structure.html)
// .
func (c *Client) ImportResourcesToDraftAppVersion(ctx context.Context, params *ImportResourcesToDraftAppVersionInput, optFns ...func(*Options)) (*ImportResourcesToDraftAppVersionOutput, error) {
if params == nil {
params = &ImportResourcesToDraftAppVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ImportResourcesToDraftAppVersion", params, optFns, c.addOperationImportResourcesToDraftAppVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ImportResourcesToDraftAppVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type ImportResourcesToDraftAppVersionInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The input sources of the Amazon Elastic Kubernetes Service resources you need
// to import.
EksSources []types.EksSource
// The import strategy you would like to set to import resources into Resilience
// Hub application.
ImportStrategy types.ResourceImportStrategyType
// The Amazon Resource Names (ARNs) for the resources.
SourceArns []string
// A list of terraform file s3 URLs you need to import.
TerraformSources []types.TerraformSource
noSmithyDocumentSerde
}
type ImportResourcesToDraftAppVersionOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The status of the action.
//
// This member is required.
Status types.ResourceImportStatusType
// The input sources of the Amazon Elastic Kubernetes Service resources you have
// imported.
EksSources []types.EksSource
// The Amazon Resource Names (ARNs) for the resources you have imported.
SourceArns []string
// A list of terraform file s3 URLs you have imported.
TerraformSources []types.TerraformSource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationImportResourcesToDraftAppVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpImportResourcesToDraftAppVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpImportResourcesToDraftAppVersion{}, 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 = addOpImportResourcesToDraftAppVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportResourcesToDraftAppVersion(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_opImportResourcesToDraftAppVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ImportResourcesToDraftAppVersion",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the alarm recommendations for an Resilience Hub application.
func (c *Client) ListAlarmRecommendations(ctx context.Context, params *ListAlarmRecommendationsInput, optFns ...func(*Options)) (*ListAlarmRecommendationsOutput, error) {
if params == nil {
params = &ListAlarmRecommendationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAlarmRecommendations", params, optFns, c.addOperationListAlarmRecommendationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAlarmRecommendationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAlarmRecommendationsInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAlarmRecommendationsOutput struct {
// The alarm recommendations for an Resilience Hub application, returned as an
// object. This object includes Application Component names, descriptions,
// information about whether a recommendation has already been implemented or not,
// prerequisites, and more.
//
// This member is required.
AlarmRecommendations []types.AlarmRecommendation
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAlarmRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAlarmRecommendations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAlarmRecommendations{}, 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 = addOpListAlarmRecommendationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAlarmRecommendations(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
}
// ListAlarmRecommendationsAPIClient is a client that implements the
// ListAlarmRecommendations operation.
type ListAlarmRecommendationsAPIClient interface {
ListAlarmRecommendations(context.Context, *ListAlarmRecommendationsInput, ...func(*Options)) (*ListAlarmRecommendationsOutput, error)
}
var _ ListAlarmRecommendationsAPIClient = (*Client)(nil)
// ListAlarmRecommendationsPaginatorOptions is the paginator options for
// ListAlarmRecommendations
type ListAlarmRecommendationsPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListAlarmRecommendationsPaginator is a paginator for ListAlarmRecommendations
type ListAlarmRecommendationsPaginator struct {
options ListAlarmRecommendationsPaginatorOptions
client ListAlarmRecommendationsAPIClient
params *ListAlarmRecommendationsInput
nextToken *string
firstPage bool
}
// NewListAlarmRecommendationsPaginator returns a new
// ListAlarmRecommendationsPaginator
func NewListAlarmRecommendationsPaginator(client ListAlarmRecommendationsAPIClient, params *ListAlarmRecommendationsInput, optFns ...func(*ListAlarmRecommendationsPaginatorOptions)) *ListAlarmRecommendationsPaginator {
if params == nil {
params = &ListAlarmRecommendationsInput{}
}
options := ListAlarmRecommendationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAlarmRecommendationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAlarmRecommendationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAlarmRecommendations page.
func (p *ListAlarmRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAlarmRecommendationsOutput, 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.ListAlarmRecommendations(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_opListAlarmRecommendations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAlarmRecommendations",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the assessments for an Resilience Hub application. You can use request
// parameters to refine the results for the response object.
func (c *Client) ListAppAssessments(ctx context.Context, params *ListAppAssessmentsInput, optFns ...func(*Options)) (*ListAppAssessmentsOutput, error) {
if params == nil {
params = &ListAppAssessmentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAppAssessments", params, optFns, c.addOperationListAppAssessmentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppAssessmentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppAssessmentsInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
AppArn *string
// The name for the assessment.
AssessmentName *string
// The current status of the assessment for the resiliency policy.
AssessmentStatus []types.AssessmentStatus
// The current status of compliance for the resiliency policy.
ComplianceStatus types.ComplianceStatus
// Specifies the entity that invoked a specific assessment, either a User or the
// System .
Invoker types.AssessmentInvoker
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
// The default is to sort by ascending startTime. To sort by descending startTime,
// set reverseOrder to true .
ReverseOrder *bool
noSmithyDocumentSerde
}
type ListAppAssessmentsOutput struct {
// The summaries for the specified assessments, returned as an object. This object
// includes application versions, associated Amazon Resource Numbers (ARNs), cost,
// messages, resiliency scores, and more.
//
// This member is required.
AssessmentSummaries []types.AppAssessmentSummary
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppAssessmentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppAssessments{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppAssessments{}, 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_opListAppAssessments(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
}
// ListAppAssessmentsAPIClient is a client that implements the ListAppAssessments
// operation.
type ListAppAssessmentsAPIClient interface {
ListAppAssessments(context.Context, *ListAppAssessmentsInput, ...func(*Options)) (*ListAppAssessmentsOutput, error)
}
var _ ListAppAssessmentsAPIClient = (*Client)(nil)
// ListAppAssessmentsPaginatorOptions is the paginator options for
// ListAppAssessments
type ListAppAssessmentsPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListAppAssessmentsPaginator is a paginator for ListAppAssessments
type ListAppAssessmentsPaginator struct {
options ListAppAssessmentsPaginatorOptions
client ListAppAssessmentsAPIClient
params *ListAppAssessmentsInput
nextToken *string
firstPage bool
}
// NewListAppAssessmentsPaginator returns a new ListAppAssessmentsPaginator
func NewListAppAssessmentsPaginator(client ListAppAssessmentsAPIClient, params *ListAppAssessmentsInput, optFns ...func(*ListAppAssessmentsPaginatorOptions)) *ListAppAssessmentsPaginator {
if params == nil {
params = &ListAppAssessmentsInput{}
}
options := ListAppAssessmentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppAssessmentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppAssessmentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAppAssessments page.
func (p *ListAppAssessmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppAssessmentsOutput, 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.ListAppAssessments(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_opListAppAssessments(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAppAssessments",
}
}
| 250 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the compliances for an Resilience Hub Application Component.
func (c *Client) ListAppComponentCompliances(ctx context.Context, params *ListAppComponentCompliancesInput, optFns ...func(*Options)) (*ListAppComponentCompliancesOutput, error) {
if params == nil {
params = &ListAppComponentCompliancesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAppComponentCompliances", params, optFns, c.addOperationListAppComponentCompliancesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppComponentCompliancesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppComponentCompliancesInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAppComponentCompliancesOutput struct {
// The compliances for an Resilience Hub Application Component, returned as an
// object. This object contains the names of the Application Components,
// compliances, costs, resiliency scores, outage scores, and more.
//
// This member is required.
ComponentCompliances []types.AppComponentCompliance
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppComponentCompliancesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppComponentCompliances{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppComponentCompliances{}, 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 = addOpListAppComponentCompliancesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppComponentCompliances(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
}
// ListAppComponentCompliancesAPIClient is a client that implements the
// ListAppComponentCompliances operation.
type ListAppComponentCompliancesAPIClient interface {
ListAppComponentCompliances(context.Context, *ListAppComponentCompliancesInput, ...func(*Options)) (*ListAppComponentCompliancesOutput, error)
}
var _ ListAppComponentCompliancesAPIClient = (*Client)(nil)
// ListAppComponentCompliancesPaginatorOptions is the paginator options for
// ListAppComponentCompliances
type ListAppComponentCompliancesPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListAppComponentCompliancesPaginator is a paginator for
// ListAppComponentCompliances
type ListAppComponentCompliancesPaginator struct {
options ListAppComponentCompliancesPaginatorOptions
client ListAppComponentCompliancesAPIClient
params *ListAppComponentCompliancesInput
nextToken *string
firstPage bool
}
// NewListAppComponentCompliancesPaginator returns a new
// ListAppComponentCompliancesPaginator
func NewListAppComponentCompliancesPaginator(client ListAppComponentCompliancesAPIClient, params *ListAppComponentCompliancesInput, optFns ...func(*ListAppComponentCompliancesPaginatorOptions)) *ListAppComponentCompliancesPaginator {
if params == nil {
params = &ListAppComponentCompliancesInput{}
}
options := ListAppComponentCompliancesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppComponentCompliancesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppComponentCompliancesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAppComponentCompliances page.
func (p *ListAppComponentCompliancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppComponentCompliancesOutput, 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.ListAppComponentCompliances(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_opListAppComponentCompliances(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAppComponentCompliances",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the recommendations for an Resilience Hub Application Component.
func (c *Client) ListAppComponentRecommendations(ctx context.Context, params *ListAppComponentRecommendationsInput, optFns ...func(*Options)) (*ListAppComponentRecommendationsOutput, error) {
if params == nil {
params = &ListAppComponentRecommendationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAppComponentRecommendations", params, optFns, c.addOperationListAppComponentRecommendationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppComponentRecommendationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppComponentRecommendationsInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAppComponentRecommendationsOutput struct {
// The recommendations for an Resilience Hub Application Component, returned as an
// object. This object contains the names of the Application Components,
// configuration recommendations, and recommendation statuses.
//
// This member is required.
ComponentRecommendations []types.ComponentRecommendation
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppComponentRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppComponentRecommendations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppComponentRecommendations{}, 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 = addOpListAppComponentRecommendationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppComponentRecommendations(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
}
// ListAppComponentRecommendationsAPIClient is a client that implements the
// ListAppComponentRecommendations operation.
type ListAppComponentRecommendationsAPIClient interface {
ListAppComponentRecommendations(context.Context, *ListAppComponentRecommendationsInput, ...func(*Options)) (*ListAppComponentRecommendationsOutput, error)
}
var _ ListAppComponentRecommendationsAPIClient = (*Client)(nil)
// ListAppComponentRecommendationsPaginatorOptions is the paginator options for
// ListAppComponentRecommendations
type ListAppComponentRecommendationsPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListAppComponentRecommendationsPaginator is a paginator for
// ListAppComponentRecommendations
type ListAppComponentRecommendationsPaginator struct {
options ListAppComponentRecommendationsPaginatorOptions
client ListAppComponentRecommendationsAPIClient
params *ListAppComponentRecommendationsInput
nextToken *string
firstPage bool
}
// NewListAppComponentRecommendationsPaginator returns a new
// ListAppComponentRecommendationsPaginator
func NewListAppComponentRecommendationsPaginator(client ListAppComponentRecommendationsAPIClient, params *ListAppComponentRecommendationsInput, optFns ...func(*ListAppComponentRecommendationsPaginatorOptions)) *ListAppComponentRecommendationsPaginator {
if params == nil {
params = &ListAppComponentRecommendationsInput{}
}
options := ListAppComponentRecommendationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppComponentRecommendationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppComponentRecommendationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAppComponentRecommendations page.
func (p *ListAppComponentRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppComponentRecommendationsOutput, 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.ListAppComponentRecommendations(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_opListAppComponentRecommendations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAppComponentRecommendations",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all the input sources of the Resilience Hub application. For more
// information about the input sources supported by Resilience Hub, see Discover
// the structure and describe your Resilience Hub application (https://docs.aws.amazon.com/resilience-hub/latest/userguide/discover-structure.html)
// .
func (c *Client) ListAppInputSources(ctx context.Context, params *ListAppInputSourcesInput, optFns ...func(*Options)) (*ListAppInputSourcesOutput, error) {
if params == nil {
params = &ListAppInputSourcesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAppInputSources", params, optFns, c.addOperationListAppInputSourcesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppInputSourcesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppInputSourcesInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// Maximum number of input sources to be displayed per Resilience Hub application.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAppInputSourcesOutput struct {
// The list of Resilience Hub application input sources.
//
// This member is required.
AppInputSources []types.AppInputSource
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppInputSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppInputSources{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppInputSources{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAppInputSourcesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppInputSources(options.Region), middleware.Before); err != nil {
return err
}
if err = 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
}
// ListAppInputSourcesAPIClient is a client that implements the
// ListAppInputSources operation.
type ListAppInputSourcesAPIClient interface {
ListAppInputSources(context.Context, *ListAppInputSourcesInput, ...func(*Options)) (*ListAppInputSourcesOutput, error)
}
var _ ListAppInputSourcesAPIClient = (*Client)(nil)
// ListAppInputSourcesPaginatorOptions is the paginator options for
// ListAppInputSources
type ListAppInputSourcesPaginatorOptions struct {
// Maximum number of input sources to be displayed per Resilience Hub application.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAppInputSourcesPaginator is a paginator for ListAppInputSources
type ListAppInputSourcesPaginator struct {
options ListAppInputSourcesPaginatorOptions
client ListAppInputSourcesAPIClient
params *ListAppInputSourcesInput
nextToken *string
firstPage bool
}
// NewListAppInputSourcesPaginator returns a new ListAppInputSourcesPaginator
func NewListAppInputSourcesPaginator(client ListAppInputSourcesAPIClient, params *ListAppInputSourcesInput, optFns ...func(*ListAppInputSourcesPaginatorOptions)) *ListAppInputSourcesPaginator {
if params == nil {
params = &ListAppInputSourcesInput{}
}
options := ListAppInputSourcesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppInputSourcesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppInputSourcesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAppInputSources page.
func (p *ListAppInputSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppInputSourcesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListAppInputSources(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListAppInputSources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAppInputSources",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists your Resilience Hub applications. You can filter applications using only
// one filter at a time or without using any filter. If you try to filter
// applications using multiple filters, you will get the following error: An error
// occurred (ValidationException) when calling the ListApps operation: Only one
// filter is supported for this operation.
func (c *Client) ListApps(ctx context.Context, params *ListAppsInput, optFns ...func(*Options)) (*ListAppsOutput, error) {
if params == nil {
params = &ListAppsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListApps", params, optFns, c.addOperationListAppsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppsInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
AppArn *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// The name for the one of the listed applications.
Name *string
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAppsOutput struct {
// Summaries for the Resilience Hub application.
//
// This member is required.
AppSummaries []types.AppSummary
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListApps{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApps{}, 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_opListApps(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
}
// ListAppsAPIClient is a client that implements the ListApps operation.
type ListAppsAPIClient interface {
ListApps(context.Context, *ListAppsInput, ...func(*Options)) (*ListAppsOutput, error)
}
var _ ListAppsAPIClient = (*Client)(nil)
// ListAppsPaginatorOptions is the paginator options for ListApps
type ListAppsPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListAppsPaginator is a paginator for ListApps
type ListAppsPaginator struct {
options ListAppsPaginatorOptions
client ListAppsAPIClient
params *ListAppsInput
nextToken *string
firstPage bool
}
// NewListAppsPaginator returns a new ListAppsPaginator
func NewListAppsPaginator(client ListAppsAPIClient, params *ListAppsInput, optFns ...func(*ListAppsPaginatorOptions)) *ListAppsPaginator {
if params == nil {
params = &ListAppsInput{}
}
options := ListAppsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListApps page.
func (p *ListAppsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppsOutput, 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.ListApps(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_opListApps(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListApps",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all the Application Components in the Resilience Hub application.
func (c *Client) ListAppVersionAppComponents(ctx context.Context, params *ListAppVersionAppComponentsInput, optFns ...func(*Options)) (*ListAppVersionAppComponentsOutput, error) {
if params == nil {
params = &ListAppVersionAppComponentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAppVersionAppComponents", params, optFns, c.addOperationListAppVersionAppComponentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppVersionAppComponentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppVersionAppComponentsInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the Application Component.
//
// This member is required.
AppVersion *string
// Maximum number of Application Components to be displayed per Resilience Hub
// application version.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAppVersionAppComponentsOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// Defines an Application Component.
AppComponents []types.AppComponent
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppVersionAppComponentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppVersionAppComponents{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppVersionAppComponents{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAppVersionAppComponentsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppVersionAppComponents(options.Region), middleware.Before); err != nil {
return err
}
if err = 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
}
// ListAppVersionAppComponentsAPIClient is a client that implements the
// ListAppVersionAppComponents operation.
type ListAppVersionAppComponentsAPIClient interface {
ListAppVersionAppComponents(context.Context, *ListAppVersionAppComponentsInput, ...func(*Options)) (*ListAppVersionAppComponentsOutput, error)
}
var _ ListAppVersionAppComponentsAPIClient = (*Client)(nil)
// ListAppVersionAppComponentsPaginatorOptions is the paginator options for
// ListAppVersionAppComponents
type ListAppVersionAppComponentsPaginatorOptions struct {
// Maximum number of Application Components to be displayed per Resilience Hub
// application version.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAppVersionAppComponentsPaginator is a paginator for
// ListAppVersionAppComponents
type ListAppVersionAppComponentsPaginator struct {
options ListAppVersionAppComponentsPaginatorOptions
client ListAppVersionAppComponentsAPIClient
params *ListAppVersionAppComponentsInput
nextToken *string
firstPage bool
}
// NewListAppVersionAppComponentsPaginator returns a new
// ListAppVersionAppComponentsPaginator
func NewListAppVersionAppComponentsPaginator(client ListAppVersionAppComponentsAPIClient, params *ListAppVersionAppComponentsInput, optFns ...func(*ListAppVersionAppComponentsPaginatorOptions)) *ListAppVersionAppComponentsPaginator {
if params == nil {
params = &ListAppVersionAppComponentsInput{}
}
options := ListAppVersionAppComponentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppVersionAppComponentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppVersionAppComponentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAppVersionAppComponents page.
func (p *ListAppVersionAppComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppVersionAppComponentsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListAppVersionAppComponents(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListAppVersionAppComponents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAppVersionAppComponents",
}
}
| 251 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists how the resources in an application version are mapped/sourced from.
// Mappings can be physical resource identifiers, CloudFormation stacks,
// resource-groups, or an application registry app.
func (c *Client) ListAppVersionResourceMappings(ctx context.Context, params *ListAppVersionResourceMappingsInput, optFns ...func(*Options)) (*ListAppVersionResourceMappingsOutput, error) {
if params == nil {
params = &ListAppVersionResourceMappingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAppVersionResourceMappings", params, optFns, c.addOperationListAppVersionResourceMappingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppVersionResourceMappingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppVersionResourceMappingsInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAppVersionResourceMappingsOutput struct {
// Mappings used to map logical resources from the template to physical resources.
// You can use the mapping type CFN_STACK if the application template uses a
// logical stack name. Or you can map individual resources by using the mapping
// type RESOURCE . We recommend using the mapping type CFN_STACK if the
// application is backed by a CloudFormation stack.
//
// This member is required.
ResourceMappings []types.ResourceMapping
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppVersionResourceMappingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppVersionResourceMappings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppVersionResourceMappings{}, 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 = addOpListAppVersionResourceMappingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppVersionResourceMappings(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
}
// ListAppVersionResourceMappingsAPIClient is a client that implements the
// ListAppVersionResourceMappings operation.
type ListAppVersionResourceMappingsAPIClient interface {
ListAppVersionResourceMappings(context.Context, *ListAppVersionResourceMappingsInput, ...func(*Options)) (*ListAppVersionResourceMappingsOutput, error)
}
var _ ListAppVersionResourceMappingsAPIClient = (*Client)(nil)
// ListAppVersionResourceMappingsPaginatorOptions is the paginator options for
// ListAppVersionResourceMappings
type ListAppVersionResourceMappingsPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListAppVersionResourceMappingsPaginator is a paginator for
// ListAppVersionResourceMappings
type ListAppVersionResourceMappingsPaginator struct {
options ListAppVersionResourceMappingsPaginatorOptions
client ListAppVersionResourceMappingsAPIClient
params *ListAppVersionResourceMappingsInput
nextToken *string
firstPage bool
}
// NewListAppVersionResourceMappingsPaginator returns a new
// ListAppVersionResourceMappingsPaginator
func NewListAppVersionResourceMappingsPaginator(client ListAppVersionResourceMappingsAPIClient, params *ListAppVersionResourceMappingsInput, optFns ...func(*ListAppVersionResourceMappingsPaginatorOptions)) *ListAppVersionResourceMappingsPaginator {
if params == nil {
params = &ListAppVersionResourceMappingsInput{}
}
options := ListAppVersionResourceMappingsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppVersionResourceMappingsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppVersionResourceMappingsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAppVersionResourceMappings page.
func (p *ListAppVersionResourceMappingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppVersionResourceMappingsOutput, 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.ListAppVersionResourceMappings(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_opListAppVersionResourceMappings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAppVersionResourceMappings",
}
}
| 248 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all the resources in an Resilience Hub application.
func (c *Client) ListAppVersionResources(ctx context.Context, params *ListAppVersionResourcesInput, optFns ...func(*Options)) (*ListAppVersionResourcesOutput, error) {
if params == nil {
params = &ListAppVersionResourcesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAppVersionResources", params, optFns, c.addOperationListAppVersionResourcesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppVersionResourcesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppVersionResourcesInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
// The identifier for a specific resolution.
ResolutionId *string
noSmithyDocumentSerde
}
type ListAppVersionResourcesOutput struct {
// The physical resources in the application version.
//
// This member is required.
PhysicalResources []types.PhysicalResource
// The ID for a specific resolution.
//
// This member is required.
ResolutionId *string
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppVersionResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppVersionResources{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppVersionResources{}, 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 = addOpListAppVersionResourcesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppVersionResources(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
}
// ListAppVersionResourcesAPIClient is a client that implements the
// ListAppVersionResources operation.
type ListAppVersionResourcesAPIClient interface {
ListAppVersionResources(context.Context, *ListAppVersionResourcesInput, ...func(*Options)) (*ListAppVersionResourcesOutput, error)
}
var _ ListAppVersionResourcesAPIClient = (*Client)(nil)
// ListAppVersionResourcesPaginatorOptions is the paginator options for
// ListAppVersionResources
type ListAppVersionResourcesPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListAppVersionResourcesPaginator is a paginator for ListAppVersionResources
type ListAppVersionResourcesPaginator struct {
options ListAppVersionResourcesPaginatorOptions
client ListAppVersionResourcesAPIClient
params *ListAppVersionResourcesInput
nextToken *string
firstPage bool
}
// NewListAppVersionResourcesPaginator returns a new
// ListAppVersionResourcesPaginator
func NewListAppVersionResourcesPaginator(client ListAppVersionResourcesAPIClient, params *ListAppVersionResourcesInput, optFns ...func(*ListAppVersionResourcesPaginatorOptions)) *ListAppVersionResourcesPaginator {
if params == nil {
params = &ListAppVersionResourcesInput{}
}
options := ListAppVersionResourcesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppVersionResourcesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppVersionResourcesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAppVersionResources page.
func (p *ListAppVersionResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppVersionResourcesOutput, 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.ListAppVersionResources(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_opListAppVersionResources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAppVersionResources",
}
}
| 249 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the different versions for the Resilience Hub applications.
func (c *Client) ListAppVersions(ctx context.Context, params *ListAppVersionsInput, optFns ...func(*Options)) (*ListAppVersionsOutput, error) {
if params == nil {
params = &ListAppVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAppVersions", params, optFns, c.addOperationListAppVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAppVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAppVersionsInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAppVersionsOutput struct {
// The version of the application.
//
// This member is required.
AppVersions []types.AppVersionSummary
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAppVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppVersions{}, 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 = addOpListAppVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppVersions(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
}
// ListAppVersionsAPIClient is a client that implements the ListAppVersions
// operation.
type ListAppVersionsAPIClient interface {
ListAppVersions(context.Context, *ListAppVersionsInput, ...func(*Options)) (*ListAppVersionsOutput, error)
}
var _ ListAppVersionsAPIClient = (*Client)(nil)
// ListAppVersionsPaginatorOptions is the paginator options for ListAppVersions
type ListAppVersionsPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListAppVersionsPaginator is a paginator for ListAppVersions
type ListAppVersionsPaginator struct {
options ListAppVersionsPaginatorOptions
client ListAppVersionsAPIClient
params *ListAppVersionsInput
nextToken *string
firstPage bool
}
// NewListAppVersionsPaginator returns a new ListAppVersionsPaginator
func NewListAppVersionsPaginator(client ListAppVersionsAPIClient, params *ListAppVersionsInput, optFns ...func(*ListAppVersionsPaginatorOptions)) *ListAppVersionsPaginator {
if params == nil {
params = &ListAppVersionsInput{}
}
options := ListAppVersionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAppVersionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAppVersionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAppVersions page.
func (p *ListAppVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppVersionsOutput, 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.ListAppVersions(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_opListAppVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListAppVersions",
}
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the recommendation templates for the Resilience Hub applications.
func (c *Client) ListRecommendationTemplates(ctx context.Context, params *ListRecommendationTemplatesInput, optFns ...func(*Options)) (*ListRecommendationTemplatesOutput, error) {
if params == nil {
params = &ListRecommendationTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListRecommendationTemplates", params, optFns, c.addOperationListRecommendationTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListRecommendationTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListRecommendationTemplatesInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// The name for one of the listed recommendation templates.
Name *string
// Null, or the token from a previous call to get the next set of results.
NextToken *string
// The Amazon Resource Name (ARN) for a recommendation template.
RecommendationTemplateArn *string
// The default is to sort by ascending startTime. To sort by descending startTime,
// set reverseOrder to true .
ReverseOrder *bool
// The status of the action.
Status []types.RecommendationTemplateStatus
noSmithyDocumentSerde
}
type ListRecommendationTemplatesOutput struct {
// The token for the next set of results, or null if there are no more results.
NextToken *string
// The recommendation templates for the Resilience Hub applications.
RecommendationTemplates []types.RecommendationTemplate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListRecommendationTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListRecommendationTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRecommendationTemplates{}, 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 = addOpListRecommendationTemplatesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRecommendationTemplates(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
}
// ListRecommendationTemplatesAPIClient is a client that implements the
// ListRecommendationTemplates operation.
type ListRecommendationTemplatesAPIClient interface {
ListRecommendationTemplates(context.Context, *ListRecommendationTemplatesInput, ...func(*Options)) (*ListRecommendationTemplatesOutput, error)
}
var _ ListRecommendationTemplatesAPIClient = (*Client)(nil)
// ListRecommendationTemplatesPaginatorOptions is the paginator options for
// ListRecommendationTemplates
type ListRecommendationTemplatesPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListRecommendationTemplatesPaginator is a paginator for
// ListRecommendationTemplates
type ListRecommendationTemplatesPaginator struct {
options ListRecommendationTemplatesPaginatorOptions
client ListRecommendationTemplatesAPIClient
params *ListRecommendationTemplatesInput
nextToken *string
firstPage bool
}
// NewListRecommendationTemplatesPaginator returns a new
// ListRecommendationTemplatesPaginator
func NewListRecommendationTemplatesPaginator(client ListRecommendationTemplatesAPIClient, params *ListRecommendationTemplatesInput, optFns ...func(*ListRecommendationTemplatesPaginatorOptions)) *ListRecommendationTemplatesPaginator {
if params == nil {
params = &ListRecommendationTemplatesInput{}
}
options := ListRecommendationTemplatesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListRecommendationTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListRecommendationTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListRecommendationTemplates page.
func (p *ListRecommendationTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationTemplatesOutput, 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.ListRecommendationTemplates(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_opListRecommendationTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListRecommendationTemplates",
}
}
| 248 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the resiliency policies for the Resilience Hub applications.
func (c *Client) ListResiliencyPolicies(ctx context.Context, params *ListResiliencyPoliciesInput, optFns ...func(*Options)) (*ListResiliencyPoliciesOutput, error) {
if params == nil {
params = &ListResiliencyPoliciesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListResiliencyPolicies", params, optFns, c.addOperationListResiliencyPoliciesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListResiliencyPoliciesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListResiliencyPoliciesInput struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
// The name of the policy
PolicyName *string
noSmithyDocumentSerde
}
type ListResiliencyPoliciesOutput struct {
// The resiliency policies for the Resilience Hub applications.
//
// This member is required.
ResiliencyPolicies []types.ResiliencyPolicy
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListResiliencyPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListResiliencyPolicies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListResiliencyPolicies{}, 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_opListResiliencyPolicies(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
}
// ListResiliencyPoliciesAPIClient is a client that implements the
// ListResiliencyPolicies operation.
type ListResiliencyPoliciesAPIClient interface {
ListResiliencyPolicies(context.Context, *ListResiliencyPoliciesInput, ...func(*Options)) (*ListResiliencyPoliciesOutput, error)
}
var _ ListResiliencyPoliciesAPIClient = (*Client)(nil)
// ListResiliencyPoliciesPaginatorOptions is the paginator options for
// ListResiliencyPolicies
type ListResiliencyPoliciesPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListResiliencyPoliciesPaginator is a paginator for ListResiliencyPolicies
type ListResiliencyPoliciesPaginator struct {
options ListResiliencyPoliciesPaginatorOptions
client ListResiliencyPoliciesAPIClient
params *ListResiliencyPoliciesInput
nextToken *string
firstPage bool
}
// NewListResiliencyPoliciesPaginator returns a new ListResiliencyPoliciesPaginator
func NewListResiliencyPoliciesPaginator(client ListResiliencyPoliciesAPIClient, params *ListResiliencyPoliciesInput, optFns ...func(*ListResiliencyPoliciesPaginatorOptions)) *ListResiliencyPoliciesPaginator {
if params == nil {
params = &ListResiliencyPoliciesInput{}
}
options := ListResiliencyPoliciesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListResiliencyPoliciesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListResiliencyPoliciesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListResiliencyPolicies page.
func (p *ListResiliencyPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResiliencyPoliciesOutput, 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.ListResiliencyPolicies(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_opListResiliencyPolicies(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListResiliencyPolicies",
}
}
| 227 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the standard operating procedure (SOP) recommendations for the Resilience
// Hub applications.
func (c *Client) ListSopRecommendations(ctx context.Context, params *ListSopRecommendationsInput, optFns ...func(*Options)) (*ListSopRecommendationsOutput, error) {
if params == nil {
params = &ListSopRecommendationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSopRecommendations", params, optFns, c.addOperationListSopRecommendationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSopRecommendationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSopRecommendationsInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListSopRecommendationsOutput struct {
// The standard operating procedure (SOP) recommendations for the Resilience Hub
// applications.
//
// This member is required.
SopRecommendations []types.SopRecommendation
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSopRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSopRecommendations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSopRecommendations{}, 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 = addOpListSopRecommendationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSopRecommendations(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
}
// ListSopRecommendationsAPIClient is a client that implements the
// ListSopRecommendations operation.
type ListSopRecommendationsAPIClient interface {
ListSopRecommendations(context.Context, *ListSopRecommendationsInput, ...func(*Options)) (*ListSopRecommendationsOutput, error)
}
var _ ListSopRecommendationsAPIClient = (*Client)(nil)
// ListSopRecommendationsPaginatorOptions is the paginator options for
// ListSopRecommendations
type ListSopRecommendationsPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListSopRecommendationsPaginator is a paginator for ListSopRecommendations
type ListSopRecommendationsPaginator struct {
options ListSopRecommendationsPaginatorOptions
client ListSopRecommendationsAPIClient
params *ListSopRecommendationsInput
nextToken *string
firstPage bool
}
// NewListSopRecommendationsPaginator returns a new ListSopRecommendationsPaginator
func NewListSopRecommendationsPaginator(client ListSopRecommendationsAPIClient, params *ListSopRecommendationsInput, optFns ...func(*ListSopRecommendationsPaginatorOptions)) *ListSopRecommendationsPaginator {
if params == nil {
params = &ListSopRecommendationsInput{}
}
options := ListSopRecommendationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSopRecommendationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSopRecommendationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSopRecommendations page.
func (p *ListSopRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSopRecommendationsOutput, 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.ListSopRecommendations(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_opListSopRecommendations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListSopRecommendations",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the suggested resiliency policies for the Resilience Hub applications.
func (c *Client) ListSuggestedResiliencyPolicies(ctx context.Context, params *ListSuggestedResiliencyPoliciesInput, optFns ...func(*Options)) (*ListSuggestedResiliencyPoliciesOutput, error) {
if params == nil {
params = &ListSuggestedResiliencyPoliciesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSuggestedResiliencyPolicies", params, optFns, c.addOperationListSuggestedResiliencyPoliciesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSuggestedResiliencyPoliciesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSuggestedResiliencyPoliciesInput struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListSuggestedResiliencyPoliciesOutput struct {
// The suggested resiliency policies for the Resilience Hub applications.
//
// This member is required.
ResiliencyPolicies []types.ResiliencyPolicy
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSuggestedResiliencyPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSuggestedResiliencyPolicies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSuggestedResiliencyPolicies{}, 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_opListSuggestedResiliencyPolicies(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
}
// ListSuggestedResiliencyPoliciesAPIClient is a client that implements the
// ListSuggestedResiliencyPolicies operation.
type ListSuggestedResiliencyPoliciesAPIClient interface {
ListSuggestedResiliencyPolicies(context.Context, *ListSuggestedResiliencyPoliciesInput, ...func(*Options)) (*ListSuggestedResiliencyPoliciesOutput, error)
}
var _ ListSuggestedResiliencyPoliciesAPIClient = (*Client)(nil)
// ListSuggestedResiliencyPoliciesPaginatorOptions is the paginator options for
// ListSuggestedResiliencyPolicies
type ListSuggestedResiliencyPoliciesPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListSuggestedResiliencyPoliciesPaginator is a paginator for
// ListSuggestedResiliencyPolicies
type ListSuggestedResiliencyPoliciesPaginator struct {
options ListSuggestedResiliencyPoliciesPaginatorOptions
client ListSuggestedResiliencyPoliciesAPIClient
params *ListSuggestedResiliencyPoliciesInput
nextToken *string
firstPage bool
}
// NewListSuggestedResiliencyPoliciesPaginator returns a new
// ListSuggestedResiliencyPoliciesPaginator
func NewListSuggestedResiliencyPoliciesPaginator(client ListSuggestedResiliencyPoliciesAPIClient, params *ListSuggestedResiliencyPoliciesInput, optFns ...func(*ListSuggestedResiliencyPoliciesPaginatorOptions)) *ListSuggestedResiliencyPoliciesPaginator {
if params == nil {
params = &ListSuggestedResiliencyPoliciesInput{}
}
options := ListSuggestedResiliencyPoliciesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSuggestedResiliencyPoliciesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSuggestedResiliencyPoliciesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSuggestedResiliencyPolicies page.
func (p *ListSuggestedResiliencyPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSuggestedResiliencyPoliciesOutput, 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.ListSuggestedResiliencyPolicies(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_opListSuggestedResiliencyPolicies(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListSuggestedResiliencyPolicies",
}
}
| 226 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags for your resources in your Resilience Hub applications.
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) for a specific resource in your Resilience Hub
// application.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tags assigned to the resource. A tag is a label that you assign to an
// Amazon Web Services resource. Each tag consists of a key/value pair.
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: "resiliencehub",
OperationName: "ListTagsForResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the test recommendations for the Resilience Hub application.
func (c *Client) ListTestRecommendations(ctx context.Context, params *ListTestRecommendationsInput, optFns ...func(*Options)) (*ListTestRecommendationsOutput, error) {
if params == nil {
params = &ListTestRecommendationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTestRecommendations", params, optFns, c.addOperationListTestRecommendationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTestRecommendationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTestRecommendationsInput struct {
// The Amazon Resource Name (ARN) of the assessment. The format for this ARN is:
// arn: partition :resiliencehub: region : account :app-assessment/ app-id . For
// more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AssessmentArn *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListTestRecommendationsOutput struct {
// The test recommendations for the Resilience Hub application.
//
// This member is required.
TestRecommendations []types.TestRecommendation
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTestRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTestRecommendations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTestRecommendations{}, 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 = addOpListTestRecommendationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTestRecommendations(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
}
// ListTestRecommendationsAPIClient is a client that implements the
// ListTestRecommendations operation.
type ListTestRecommendationsAPIClient interface {
ListTestRecommendations(context.Context, *ListTestRecommendationsInput, ...func(*Options)) (*ListTestRecommendationsOutput, error)
}
var _ ListTestRecommendationsAPIClient = (*Client)(nil)
// ListTestRecommendationsPaginatorOptions is the paginator options for
// ListTestRecommendations
type ListTestRecommendationsPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListTestRecommendationsPaginator is a paginator for ListTestRecommendations
type ListTestRecommendationsPaginator struct {
options ListTestRecommendationsPaginatorOptions
client ListTestRecommendationsAPIClient
params *ListTestRecommendationsInput
nextToken *string
firstPage bool
}
// NewListTestRecommendationsPaginator returns a new
// ListTestRecommendationsPaginator
func NewListTestRecommendationsPaginator(client ListTestRecommendationsAPIClient, params *ListTestRecommendationsInput, optFns ...func(*ListTestRecommendationsPaginatorOptions)) *ListTestRecommendationsPaginator {
if params == nil {
params = &ListTestRecommendationsInput{}
}
options := ListTestRecommendationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTestRecommendationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTestRecommendationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTestRecommendations page.
func (p *ListTestRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestRecommendationsOutput, 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.ListTestRecommendations(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_opListTestRecommendations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListTestRecommendations",
}
}
| 236 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the resources that are not currently supported in Resilience Hub. An
// unsupported resource is a resource that exists in the object that was used to
// create an app, but is not supported by Resilience Hub.
func (c *Client) ListUnsupportedAppVersionResources(ctx context.Context, params *ListUnsupportedAppVersionResourcesInput, optFns ...func(*Options)) (*ListUnsupportedAppVersionResourcesOutput, error) {
if params == nil {
params = &ListUnsupportedAppVersionResourcesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListUnsupportedAppVersionResources", params, optFns, c.addOperationListUnsupportedAppVersionResourcesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListUnsupportedAppVersionResourcesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListUnsupportedAppVersionResourcesInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
MaxResults *int32
// Null, or the token from a previous call to get the next set of results.
NextToken *string
// The identifier for a specific resolution.
ResolutionId *string
noSmithyDocumentSerde
}
type ListUnsupportedAppVersionResourcesOutput struct {
// The identifier for a specific resolution.
//
// This member is required.
ResolutionId *string
// The unsupported resources for the application.
//
// This member is required.
UnsupportedResources []types.UnsupportedResource
// The token for the next set of results, or null if there are no more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListUnsupportedAppVersionResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListUnsupportedAppVersionResources{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListUnsupportedAppVersionResources{}, 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 = addOpListUnsupportedAppVersionResourcesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListUnsupportedAppVersionResources(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
}
// ListUnsupportedAppVersionResourcesAPIClient is a client that implements the
// ListUnsupportedAppVersionResources operation.
type ListUnsupportedAppVersionResourcesAPIClient interface {
ListUnsupportedAppVersionResources(context.Context, *ListUnsupportedAppVersionResourcesInput, ...func(*Options)) (*ListUnsupportedAppVersionResourcesOutput, error)
}
var _ ListUnsupportedAppVersionResourcesAPIClient = (*Client)(nil)
// ListUnsupportedAppVersionResourcesPaginatorOptions is the paginator options for
// ListUnsupportedAppVersionResources
type ListUnsupportedAppVersionResourcesPaginatorOptions struct {
// The maximum number of results to include in the response. If more results exist
// than the specified MaxResults value, a token is included in the response so
// that the remaining results can be retrieved.
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
}
// ListUnsupportedAppVersionResourcesPaginator is a paginator for
// ListUnsupportedAppVersionResources
type ListUnsupportedAppVersionResourcesPaginator struct {
options ListUnsupportedAppVersionResourcesPaginatorOptions
client ListUnsupportedAppVersionResourcesAPIClient
params *ListUnsupportedAppVersionResourcesInput
nextToken *string
firstPage bool
}
// NewListUnsupportedAppVersionResourcesPaginator returns a new
// ListUnsupportedAppVersionResourcesPaginator
func NewListUnsupportedAppVersionResourcesPaginator(client ListUnsupportedAppVersionResourcesAPIClient, params *ListUnsupportedAppVersionResourcesInput, optFns ...func(*ListUnsupportedAppVersionResourcesPaginatorOptions)) *ListUnsupportedAppVersionResourcesPaginator {
if params == nil {
params = &ListUnsupportedAppVersionResourcesInput{}
}
options := ListUnsupportedAppVersionResourcesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListUnsupportedAppVersionResourcesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListUnsupportedAppVersionResourcesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListUnsupportedAppVersionResources page.
func (p *ListUnsupportedAppVersionResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUnsupportedAppVersionResourcesOutput, 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.ListUnsupportedAppVersionResources(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_opListUnsupportedAppVersionResources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ListUnsupportedAppVersionResources",
}
}
| 252 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Publishes a new version of a specific Resilience Hub application.
func (c *Client) PublishAppVersion(ctx context.Context, params *PublishAppVersionInput, optFns ...func(*Options)) (*PublishAppVersionOutput, error) {
if params == nil {
params = &PublishAppVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PublishAppVersion", params, optFns, c.addOperationPublishAppVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PublishAppVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type PublishAppVersionInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
noSmithyDocumentSerde
}
type PublishAppVersionOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
AppVersion *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPublishAppVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPublishAppVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPublishAppVersion{}, 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 = addOpPublishAppVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPublishAppVersion(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_opPublishAppVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "PublishAppVersion",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds or updates the app template for an Resilience Hub application draft
// version.
func (c *Client) PutDraftAppVersionTemplate(ctx context.Context, params *PutDraftAppVersionTemplateInput, optFns ...func(*Options)) (*PutDraftAppVersionTemplateOutput, error) {
if params == nil {
params = &PutDraftAppVersionTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutDraftAppVersionTemplate", params, optFns, c.addOperationPutDraftAppVersionTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutDraftAppVersionTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutDraftAppVersionTemplateInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// A JSON string that provides information about your application structure. To
// learn more about the appTemplateBody template, see the sample template provided
// in the Examples section. The appTemplateBody JSON string has the following
// structure:
// - resources The list of logical resources that must be included in the
// Resilience Hub application. Type: Array Don't add the resources that you want to
// exclude. Each resources array item includes the following fields:
// - logicalResourceId The logical identifier of the resource. Type: Object Each
// logicalResourceId object includes the following fields:
// - identifier The identifier of the resource. Type: String
// - logicalStackName The name of the CloudFormation stack this resource belongs
// to. Type: String
// - resourceGroupName The name of the resource group this resource belongs to.
// Type: String
// - terraformSourceName The name of the Terraform S3 state file this resource
// belongs to. Type: String
// - eksSourceName The name of the Amazon Elastic Kubernetes Service cluster and
// namespace this resource belongs to. This parameter accepts values in
// "eks-cluster/namespace" format. Type: String
// - type The type of resource. Type: string
// - name The name of the resource. Type: String
// - additionalInfo Additional configuration parameters for an Resilience Hub
// application. If you want to implement additionalInfo through the Resilience
// Hub console rather than using an API call, see Configure the application
// configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter accepts a key-value mapping (in a string format) of
// only one failover region and one associated account. Key: "failover-regions"
// Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"
// - appComponents The list of Application Components that this resource belongs
// to. If an Application Component is not part of the Resilience Hub application,
// it will be added. Type: Array Each appComponents array item includes the
// following fields:
// - name The name of the Application Component. Type: String
// - type The type of Application Component. For more information about the types
// of Application Component, see Grouping resources in an AppComponent (https://docs.aws.amazon.com/resilience-hub/latest/userguide/AppComponent.grouping.html)
// . Type: String
// - resourceNames The list of included resources that are assigned to the
// Application Component. Type: Array of strings
// - additionalInfo Additional configuration parameters for an Resilience Hub
// application. If you want to implement additionalInfo through the Resilience
// Hub console rather than using an API call, see Configure the application
// configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter accepts a key-value mapping (in a string format) of
// only one failover region and one associated account. Key: "failover-regions"
// Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"
// - excludedResources The list of logical resource identifiers to be excluded
// from the application. Type: Array Don't add the resources that you want to
// include. Each excludedResources array item includes the following fields:
// - logicalResourceIds The logical identifier of the resource. Type: Object You
// can configure only one of the following fields:
// - logicalStackName
// - resourceGroupName
// - terraformSourceName
// - eksSourceName Each logicalResourceIds object includes the following fields:
// - identifier The identifier of the resource. Type: String
// - logicalStackName The name of the CloudFormation stack this resource belongs
// to. Type: String
// - resourceGroupName The name of the resource group this resource belongs to.
// Type: String
// - terraformSourceName The name of the Terraform S3 state file this resource
// belongs to. Type: String
// - eksSourceName The name of the Amazon Elastic Kubernetes Service cluster and
// namespace this resource belongs to. This parameter accepts values in
// "eks-cluster/namespace" format. Type: String
// - version The Resilience Hub application version.
// - additionalInfo Additional configuration parameters for an Resilience Hub
// application. If you want to implement additionalInfo through the Resilience
// Hub console rather than using an API call, see Configure the application
// configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter accepts a key-value mapping (in a string format) of
// only one failover region and one associated account. Key: "failover-regions"
// Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"
//
// This member is required.
AppTemplateBody *string
noSmithyDocumentSerde
}
type PutDraftAppVersionTemplateOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
AppArn *string
// The version of the application.
AppVersion *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutDraftAppVersionTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutDraftAppVersionTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutDraftAppVersionTemplate{}, 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 = addOpPutDraftAppVersionTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDraftAppVersionTemplate(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_opPutDraftAppVersionTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "PutDraftAppVersionTemplate",
}
}
| 210 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes resource mappings from a draft application version.
func (c *Client) RemoveDraftAppVersionResourceMappings(ctx context.Context, params *RemoveDraftAppVersionResourceMappingsInput, optFns ...func(*Options)) (*RemoveDraftAppVersionResourceMappingsOutput, error) {
if params == nil {
params = &RemoveDraftAppVersionResourceMappingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveDraftAppVersionResourceMappings", params, optFns, c.addOperationRemoveDraftAppVersionResourceMappingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveDraftAppVersionResourceMappingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type RemoveDraftAppVersionResourceMappingsInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The names of the registered applications you want to remove from the resource
// mappings.
AppRegistryAppNames []string
// The names of the Amazon Elastic Kubernetes Service clusters and namespaces you
// want to remove from the resource mappings. This parameter accepts values in
// "eks-cluster/namespace" format.
EksSourceNames []string
// The names of the CloudFormation stacks you want to remove from the resource
// mappings.
LogicalStackNames []string
// The names of the resource groups you want to remove from the resource mappings.
ResourceGroupNames []string
// The names of the resources you want to remove from the resource mappings.
ResourceNames []string
// The names of the Terraform sources you want to remove from the resource
// mappings.
TerraformSourceNames []string
noSmithyDocumentSerde
}
type RemoveDraftAppVersionResourceMappingsOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
AppArn *string
// The version of the application.
AppVersion *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveDraftAppVersionResourceMappingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveDraftAppVersionResourceMappings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings{}, 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 = addOpRemoveDraftAppVersionResourceMappingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveDraftAppVersionResourceMappings(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_opRemoveDraftAppVersionResourceMappings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "RemoveDraftAppVersionResourceMappings",
}
}
| 156 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Resolves the resources for an application version.
func (c *Client) ResolveAppVersionResources(ctx context.Context, params *ResolveAppVersionResourcesInput, optFns ...func(*Options)) (*ResolveAppVersionResourcesOutput, error) {
if params == nil {
params = &ResolveAppVersionResourcesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ResolveAppVersionResources", params, optFns, c.addOperationResolveAppVersionResourcesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ResolveAppVersionResourcesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ResolveAppVersionResourcesInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
noSmithyDocumentSerde
}
type ResolveAppVersionResourcesOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The identifier for a specific resolution.
//
// This member is required.
ResolutionId *string
// The status of the action.
//
// This member is required.
Status types.ResourceResolutionStatusType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationResolveAppVersionResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpResolveAppVersionResources{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpResolveAppVersionResources{}, 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 = addOpResolveAppVersionResourcesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResolveAppVersionResources(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_opResolveAppVersionResources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "ResolveAppVersionResources",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new application assessment for an application.
func (c *Client) StartAppAssessment(ctx context.Context, params *StartAppAssessmentInput, optFns ...func(*Options)) (*StartAppAssessmentOutput, error) {
if params == nil {
params = &StartAppAssessmentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartAppAssessment", params, optFns, c.addOperationStartAppAssessmentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartAppAssessmentOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartAppAssessmentInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The version of the application.
//
// This member is required.
AppVersion *string
// The name for the assessment.
//
// This member is required.
AssessmentName *string
// Used for an idempotency token. A client token is a unique, case-sensitive
// string of up to 64 ASCII characters. You should not reuse the same client token
// for other API requests.
ClientToken *string
// The tags assigned to the resource. A tag is a label that you assign to an
// Amazon Web Services resource. Each tag consists of a key/value pair.
Tags map[string]string
noSmithyDocumentSerde
}
type StartAppAssessmentOutput struct {
// The assessment created.
//
// This member is required.
Assessment *types.AppAssessment
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartAppAssessmentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartAppAssessment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartAppAssessment{}, 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_opStartAppAssessmentMiddleware(stack, options); err != nil {
return err
}
if err = addOpStartAppAssessmentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAppAssessment(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_initializeOpStartAppAssessment struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpStartAppAssessment) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpStartAppAssessment) 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.(*StartAppAssessmentInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *StartAppAssessmentInput ")
}
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_opStartAppAssessmentMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpStartAppAssessment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opStartAppAssessment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "StartAppAssessment",
}
}
| 186 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Applies one or more tags 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.
//
// This member is required.
ResourceArn *string
// The tags to assign to the resource. Each tag consists of a key/value pair.
//
// 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: "resiliencehub",
OperationName: "TagResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes one or more tags 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.
//
// This member is required.
ResourceArn *string
// The keys of the tags you want to remove.
//
// 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: "resiliencehub",
OperationName: "UntagResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an application.
func (c *Client) UpdateApp(ctx context.Context, params *UpdateAppInput, optFns ...func(*Options)) (*UpdateAppOutput, error) {
if params == nil {
params = &UpdateAppInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateApp", params, optFns, c.addOperationUpdateAppMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAppOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAppInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// Assessment execution schedule with 'Daily' or 'Disabled' values.
AssessmentSchedule types.AppAssessmentScheduleType
// Specifies if the resiliency policy ARN should be cleared.
ClearResiliencyPolicyArn *bool
// The optional description for an app.
Description *string
// The Amazon Resource Name (ARN) of the resiliency policy. The format for this
// ARN is: arn: partition :resiliencehub: region : account :resiliency-policy/
// policy-id . For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
PolicyArn *string
noSmithyDocumentSerde
}
type UpdateAppOutput struct {
// The specified application, returned as an object with details including
// compliance status, creation time, description, resiliency score, and more.
//
// This member is required.
App *types.App
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAppMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApp{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApp{}, 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 = addOpUpdateAppValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApp(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_opUpdateApp(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "UpdateApp",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the Resilience Hub application version. This API updates the Resilience
// Hub application draft version. To use this information for running resiliency
// assessments, you must publish the Resilience Hub application using the
// PublishAppVersion API.
func (c *Client) UpdateAppVersion(ctx context.Context, params *UpdateAppVersionInput, optFns ...func(*Options)) (*UpdateAppVersionOutput, error) {
if params == nil {
params = &UpdateAppVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAppVersion", params, optFns, c.addOperationUpdateAppVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAppVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAppVersionInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// Additional configuration parameters for an Resilience Hub application. If you
// want to implement additionalInfo through the Resilience Hub console rather than
// using an API call, see Configure the application configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter accepts a key-value mapping (in a string format) of
// only one failover region and one associated account. Key: "failover-regions"
// Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"
AdditionalInfo map[string][]string
noSmithyDocumentSerde
}
type UpdateAppVersionOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// Additional configuration parameters for an Resilience Hub application. If you
// want to implement additionalInfo through the Resilience Hub console rather than
// using an API call, see Configure the application configuration parameters (https://docs.aws.amazon.com/resilience-hub/latest/userguide/app-config-param.html)
// . Currently, this parameter supports only failover region and account.
AdditionalInfo map[string][]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAppVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAppVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAppVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateAppVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAppVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_opUpdateAppVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "UpdateAppVersion",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an existing Application Component in the Resilience Hub application.
// This API updates the Resilience Hub application draft version. To use this
// Application Component for running assessments, you must publish the Resilience
// Hub application using the PublishAppVersion API.
func (c *Client) UpdateAppVersionAppComponent(ctx context.Context, params *UpdateAppVersionAppComponentInput, optFns ...func(*Options)) (*UpdateAppVersionAppComponentOutput, error) {
if params == nil {
params = &UpdateAppVersionAppComponentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAppVersionAppComponent", params, optFns, c.addOperationUpdateAppVersionAppComponentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAppVersionAppComponentOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAppVersionAppComponentInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The identifier of the Application Component.
//
// This member is required.
Id *string
// Currently, there is no supported additional information for Application
// Components.
AdditionalInfo map[string][]string
// The name of the Application Component.
Name *string
// The type of Application Component. For more information about the types of
// Application Component, see Grouping resources in an AppComponent (https://docs.aws.amazon.com/resilience-hub/latest/userguide/AppComponent.grouping.html)
// .
Type *string
noSmithyDocumentSerde
}
type UpdateAppVersionAppComponentOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// The list of Application Components that belong to this resource.
AppComponent *types.AppComponent
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAppVersionAppComponentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAppVersionAppComponent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAppVersionAppComponent{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateAppVersionAppComponentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAppVersionAppComponent(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_opUpdateAppVersionAppComponent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "UpdateAppVersionAppComponent",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the resource details in the Resilience Hub application.
// - This action has no effect outside Resilience Hub.
// - This API updates the Resilience Hub application draft version. To use this
// resource for running resiliency assessments, you must publish the Resilience Hub
// application using the PublishAppVersion API.
// - To update application version with new physicalResourceID , you must call
// ResolveAppVersionResources API.
func (c *Client) UpdateAppVersionResource(ctx context.Context, params *UpdateAppVersionResourceInput, optFns ...func(*Options)) (*UpdateAppVersionResourceOutput, error) {
if params == nil {
params = &UpdateAppVersionResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAppVersionResource", params, optFns, c.addOperationUpdateAppVersionResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAppVersionResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAppVersionResourceInput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// Currently, there is no supported additional information for resources.
AdditionalInfo map[string][]string
// The list of Application Components that this resource belongs to. If an
// Application Component is not part of the Resilience Hub application, it will be
// added.
AppComponents []string
// The Amazon Web Services account that owns the physical resource.
AwsAccountId *string
// The Amazon Web Services region that owns the physical resource.
AwsRegion *string
// Indicates if a resource is excluded from an Resilience Hub application. You can
// exclude only imported resources from an Resilience Hub application.
Excluded *bool
// The logical identifier of the resource.
LogicalResourceId *types.LogicalResourceId
// The physical identifier of the resource.
PhysicalResourceId *string
// The name of the resource.
ResourceName *string
// The type of resource.
ResourceType *string
noSmithyDocumentSerde
}
type UpdateAppVersionResourceOutput struct {
// The Amazon Resource Name (ARN) of the Resilience Hub application. The format
// for this ARN is: arn: partition :resiliencehub: region : account :app/ app-id .
// For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
AppArn *string
// The Resilience Hub application version.
//
// This member is required.
AppVersion *string
// Defines a physical resource. A physical resource is a resource that exists in
// your account. It can be identified using an Amazon Resource Name (ARN) or a
// Resilience Hub-native identifier.
PhysicalResource *types.PhysicalResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAppVersionResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAppVersionResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAppVersionResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateAppVersionResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAppVersionResource(options.Region), middleware.Before); err != nil {
return err
}
if err = 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_opUpdateAppVersionResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "UpdateAppVersionResource",
}
}
| 179 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a resiliency policy.
func (c *Client) UpdateResiliencyPolicy(ctx context.Context, params *UpdateResiliencyPolicyInput, optFns ...func(*Options)) (*UpdateResiliencyPolicyOutput, error) {
if params == nil {
params = &UpdateResiliencyPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateResiliencyPolicy", params, optFns, c.addOperationUpdateResiliencyPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateResiliencyPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateResiliencyPolicyInput struct {
// The Amazon Resource Name (ARN) of the resiliency policy. The format for this
// ARN is: arn: partition :resiliencehub: region : account :resiliency-policy/
// policy-id . For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the AWS General Reference guide.
//
// This member is required.
PolicyArn *string
// Specifies a high-level geographical location constraint for where your
// resilience policy data can be stored.
DataLocationConstraint types.DataLocationConstraint
// The type of resiliency policy to be created, including the recovery time
// objective (RTO) and recovery point objective (RPO) in seconds.
Policy map[string]types.FailurePolicy
// The description for the policy.
PolicyDescription *string
// The name of the policy
PolicyName *string
// The tier for this resiliency policy, ranging from the highest severity (
// MissionCritical ) to lowest ( NonCritical ).
Tier types.ResiliencyPolicyTier
noSmithyDocumentSerde
}
type UpdateResiliencyPolicyOutput struct {
// The type of resiliency policy that was updated, including the recovery time
// objective (RTO) and recovery point objective (RPO) in seconds.
//
// This member is required.
Policy *types.ResiliencyPolicy
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateResiliencyPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateResiliencyPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateResiliencyPolicy{}, 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 = addOpUpdateResiliencyPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateResiliencyPolicy(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_opUpdateResiliencyPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resiliencehub",
OperationName: "UpdateResiliencyPolicy",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/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_deserializeOpAddDraftAppVersionResourceMappings struct {
}
func (*awsRestjson1_deserializeOpAddDraftAppVersionResourceMappings) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpAddDraftAppVersionResourceMappings) 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_deserializeOpErrorAddDraftAppVersionResourceMappings(response, &metadata)
}
output := &AddDraftAppVersionResourceMappingsOutput{}
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_deserializeOpDocumentAddDraftAppVersionResourceMappingsOutput(&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_deserializeOpErrorAddDraftAppVersionResourceMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentAddDraftAppVersionResourceMappingsOutput(v **AddDraftAppVersionResourceMappingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddDraftAppVersionResourceMappingsOutput
if *v == nil {
sv = &AddDraftAppVersionResourceMappingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "resourceMappings":
if err := awsRestjson1_deserializeDocumentResourceMappingList(&sv.ResourceMappings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateApp struct {
}
func (*awsRestjson1_deserializeOpCreateApp) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateApp) 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_deserializeOpErrorCreateApp(response, &metadata)
}
output := &CreateAppOutput{}
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_deserializeOpDocumentCreateAppOutput(&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_deserializeOpErrorCreateApp(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateAppOutput(v **CreateAppOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateAppOutput
if *v == nil {
sv = &CreateAppOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "app":
if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateAppVersionAppComponent struct {
}
func (*awsRestjson1_deserializeOpCreateAppVersionAppComponent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateAppVersionAppComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorCreateAppVersionAppComponent(response, &metadata)
}
output := &CreateAppVersionAppComponentOutput{}
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_deserializeOpDocumentCreateAppVersionAppComponentOutput(&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_deserializeOpErrorCreateAppVersionAppComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateAppVersionAppComponentOutput(v **CreateAppVersionAppComponentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateAppVersionAppComponentOutput
if *v == nil {
sv = &CreateAppVersionAppComponentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appComponent":
if err := awsRestjson1_deserializeDocumentAppComponent(&sv.AppComponent, value); err != nil {
return err
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateAppVersionResource struct {
}
func (*awsRestjson1_deserializeOpCreateAppVersionResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateAppVersionResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorCreateAppVersionResource(response, &metadata)
}
output := &CreateAppVersionResourceOutput{}
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_deserializeOpDocumentCreateAppVersionResourceOutput(&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_deserializeOpErrorCreateAppVersionResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateAppVersionResourceOutput(v **CreateAppVersionResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateAppVersionResourceOutput
if *v == nil {
sv = &CreateAppVersionResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "physicalResource":
if err := awsRestjson1_deserializeDocumentPhysicalResource(&sv.PhysicalResource, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateRecommendationTemplate struct {
}
func (*awsRestjson1_deserializeOpCreateRecommendationTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateRecommendationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorCreateRecommendationTemplate(response, &metadata)
}
output := &CreateRecommendationTemplateOutput{}
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_deserializeOpDocumentCreateRecommendationTemplateOutput(&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_deserializeOpErrorCreateRecommendationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateRecommendationTemplateOutput(v **CreateRecommendationTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRecommendationTemplateOutput
if *v == nil {
sv = &CreateRecommendationTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "recommendationTemplate":
if err := awsRestjson1_deserializeDocumentRecommendationTemplate(&sv.RecommendationTemplate, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateResiliencyPolicy struct {
}
func (*awsRestjson1_deserializeOpCreateResiliencyPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateResiliencyPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorCreateResiliencyPolicy(response, &metadata)
}
output := &CreateResiliencyPolicyOutput{}
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_deserializeOpDocumentCreateResiliencyPolicyOutput(&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_deserializeOpErrorCreateResiliencyPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateResiliencyPolicyOutput(v **CreateResiliencyPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateResiliencyPolicyOutput
if *v == nil {
sv = &CreateResiliencyPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "policy":
if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&sv.Policy, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteApp struct {
}
func (*awsRestjson1_deserializeOpDeleteApp) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDeleteApp(response, &metadata)
}
output := &DeleteAppOutput{}
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_deserializeOpDocumentDeleteAppOutput(&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_deserializeOpErrorDeleteApp(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
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("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteAppOutput(v **DeleteAppOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteAppOutput
if *v == nil {
sv = &DeleteAppOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteAppAssessment struct {
}
func (*awsRestjson1_deserializeOpDeleteAppAssessment) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteAppAssessment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDeleteAppAssessment(response, &metadata)
}
output := &DeleteAppAssessmentOutput{}
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_deserializeOpDocumentDeleteAppAssessmentOutput(&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_deserializeOpErrorDeleteAppAssessment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteAppAssessmentOutput(v **DeleteAppAssessmentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteAppAssessmentOutput
if *v == nil {
sv = &DeleteAppAssessmentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentArn = ptr.String(jtv)
}
case "assessmentStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentStatus to be of type string, got %T instead", value)
}
sv.AssessmentStatus = types.AssessmentStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteAppInputSource struct {
}
func (*awsRestjson1_deserializeOpDeleteAppInputSource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteAppInputSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDeleteAppInputSource(response, &metadata)
}
output := &DeleteAppInputSourceOutput{}
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_deserializeOpDocumentDeleteAppInputSourceOutput(&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_deserializeOpErrorDeleteAppInputSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteAppInputSourceOutput(v **DeleteAppInputSourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteAppInputSourceOutput
if *v == nil {
sv = &DeleteAppInputSourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appInputSource":
if err := awsRestjson1_deserializeDocumentAppInputSource(&sv.AppInputSource, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteAppVersionAppComponent struct {
}
func (*awsRestjson1_deserializeOpDeleteAppVersionAppComponent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteAppVersionAppComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDeleteAppVersionAppComponent(response, &metadata)
}
output := &DeleteAppVersionAppComponentOutput{}
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_deserializeOpDocumentDeleteAppVersionAppComponentOutput(&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_deserializeOpErrorDeleteAppVersionAppComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteAppVersionAppComponentOutput(v **DeleteAppVersionAppComponentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteAppVersionAppComponentOutput
if *v == nil {
sv = &DeleteAppVersionAppComponentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appComponent":
if err := awsRestjson1_deserializeDocumentAppComponent(&sv.AppComponent, value); err != nil {
return err
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteAppVersionResource struct {
}
func (*awsRestjson1_deserializeOpDeleteAppVersionResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteAppVersionResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDeleteAppVersionResource(response, &metadata)
}
output := &DeleteAppVersionResourceOutput{}
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_deserializeOpDocumentDeleteAppVersionResourceOutput(&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_deserializeOpErrorDeleteAppVersionResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteAppVersionResourceOutput(v **DeleteAppVersionResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteAppVersionResourceOutput
if *v == nil {
sv = &DeleteAppVersionResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "physicalResource":
if err := awsRestjson1_deserializeDocumentPhysicalResource(&sv.PhysicalResource, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteRecommendationTemplate struct {
}
func (*awsRestjson1_deserializeOpDeleteRecommendationTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteRecommendationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDeleteRecommendationTemplate(response, &metadata)
}
output := &DeleteRecommendationTemplateOutput{}
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_deserializeOpDocumentDeleteRecommendationTemplateOutput(&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_deserializeOpErrorDeleteRecommendationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteRecommendationTemplateOutput(v **DeleteRecommendationTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteRecommendationTemplateOutput
if *v == nil {
sv = &DeleteRecommendationTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "recommendationTemplateArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.RecommendationTemplateArn = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecommendationTemplateStatus to be of type string, got %T instead", value)
}
sv.Status = types.RecommendationTemplateStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteResiliencyPolicy struct {
}
func (*awsRestjson1_deserializeOpDeleteResiliencyPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteResiliencyPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDeleteResiliencyPolicy(response, &metadata)
}
output := &DeleteResiliencyPolicyOutput{}
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_deserializeOpDocumentDeleteResiliencyPolicyOutput(&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_deserializeOpErrorDeleteResiliencyPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteResiliencyPolicyOutput(v **DeleteResiliencyPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteResiliencyPolicyOutput
if *v == nil {
sv = &DeleteResiliencyPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "policyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.PolicyArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeApp struct {
}
func (*awsRestjson1_deserializeOpDescribeApp) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeApp(response, &metadata)
}
output := &DescribeAppOutput{}
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_deserializeOpDocumentDescribeAppOutput(&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_deserializeOpErrorDescribeApp(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeAppOutput(v **DescribeAppOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAppOutput
if *v == nil {
sv = &DescribeAppOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "app":
if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeAppAssessment struct {
}
func (*awsRestjson1_deserializeOpDescribeAppAssessment) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeAppAssessment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeAppAssessment(response, &metadata)
}
output := &DescribeAppAssessmentOutput{}
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_deserializeOpDocumentDescribeAppAssessmentOutput(&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_deserializeOpErrorDescribeAppAssessment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeAppAssessmentOutput(v **DescribeAppAssessmentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAppAssessmentOutput
if *v == nil {
sv = &DescribeAppAssessmentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessment":
if err := awsRestjson1_deserializeDocumentAppAssessment(&sv.Assessment, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeAppVersion struct {
}
func (*awsRestjson1_deserializeOpDescribeAppVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeAppVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeAppVersion(response, &metadata)
}
output := &DescribeAppVersionOutput{}
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_deserializeOpDocumentDescribeAppVersionOutput(&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_deserializeOpErrorDescribeAppVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeAppVersionOutput(v **DescribeAppVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAppVersionOutput
if *v == nil {
sv = &DescribeAppVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "additionalInfo":
if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil {
return err
}
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeAppVersionAppComponent struct {
}
func (*awsRestjson1_deserializeOpDescribeAppVersionAppComponent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeAppVersionAppComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeAppVersionAppComponent(response, &metadata)
}
output := &DescribeAppVersionAppComponentOutput{}
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_deserializeOpDocumentDescribeAppVersionAppComponentOutput(&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_deserializeOpErrorDescribeAppVersionAppComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeAppVersionAppComponentOutput(v **DescribeAppVersionAppComponentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAppVersionAppComponentOutput
if *v == nil {
sv = &DescribeAppVersionAppComponentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appComponent":
if err := awsRestjson1_deserializeDocumentAppComponent(&sv.AppComponent, value); err != nil {
return err
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeAppVersionResource struct {
}
func (*awsRestjson1_deserializeOpDescribeAppVersionResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeAppVersionResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeAppVersionResource(response, &metadata)
}
output := &DescribeAppVersionResourceOutput{}
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_deserializeOpDocumentDescribeAppVersionResourceOutput(&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_deserializeOpErrorDescribeAppVersionResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeAppVersionResourceOutput(v **DescribeAppVersionResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAppVersionResourceOutput
if *v == nil {
sv = &DescribeAppVersionResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "physicalResource":
if err := awsRestjson1_deserializeDocumentPhysicalResource(&sv.PhysicalResource, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus struct {
}
func (*awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeAppVersionResourcesResolutionStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeAppVersionResourcesResolutionStatus(response, &metadata)
}
output := &DescribeAppVersionResourcesResolutionStatusOutput{}
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_deserializeOpDocumentDescribeAppVersionResourcesResolutionStatusOutput(&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_deserializeOpErrorDescribeAppVersionResourcesResolutionStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeAppVersionResourcesResolutionStatusOutput(v **DescribeAppVersionResourcesResolutionStatusOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAppVersionResourcesResolutionStatusOutput
if *v == nil {
sv = &DescribeAppVersionResourcesResolutionStatusOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "errorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
case "resolutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.ResolutionId = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceResolutionStatusType to be of type string, got %T instead", value)
}
sv.Status = types.ResourceResolutionStatusType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeAppVersionTemplate struct {
}
func (*awsRestjson1_deserializeOpDescribeAppVersionTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeAppVersionTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeAppVersionTemplate(response, &metadata)
}
output := &DescribeAppVersionTemplateOutput{}
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_deserializeOpDocumentDescribeAppVersionTemplateOutput(&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_deserializeOpErrorDescribeAppVersionTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeAppVersionTemplateOutput(v **DescribeAppVersionTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAppVersionTemplateOutput
if *v == nil {
sv = &DescribeAppVersionTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appTemplateBody":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AppTemplateBody to be of type string, got %T instead", value)
}
sv.AppTemplateBody = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus struct {
}
func (*awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeDraftAppVersionResourcesImportStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeDraftAppVersionResourcesImportStatus(response, &metadata)
}
output := &DescribeDraftAppVersionResourcesImportStatusOutput{}
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_deserializeOpDocumentDescribeDraftAppVersionResourcesImportStatusOutput(&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_deserializeOpErrorDescribeDraftAppVersionResourcesImportStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeDraftAppVersionResourcesImportStatusOutput(v **DescribeDraftAppVersionResourcesImportStatusOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeDraftAppVersionResourcesImportStatusOutput
if *v == nil {
sv = &DescribeDraftAppVersionResourcesImportStatusOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "errorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceImportStatusType to be of type string, got %T instead", value)
}
sv.Status = types.ResourceImportStatusType(jtv)
}
case "statusChangeTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StatusChangeTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeResiliencyPolicy struct {
}
func (*awsRestjson1_deserializeOpDescribeResiliencyPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeResiliencyPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorDescribeResiliencyPolicy(response, &metadata)
}
output := &DescribeResiliencyPolicyOutput{}
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_deserializeOpDocumentDescribeResiliencyPolicyOutput(&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_deserializeOpErrorDescribeResiliencyPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeResiliencyPolicyOutput(v **DescribeResiliencyPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeResiliencyPolicyOutput
if *v == nil {
sv = &DescribeResiliencyPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "policy":
if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&sv.Policy, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpImportResourcesToDraftAppVersion struct {
}
func (*awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpImportResourcesToDraftAppVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorImportResourcesToDraftAppVersion(response, &metadata)
}
output := &ImportResourcesToDraftAppVersionOutput{}
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_deserializeOpDocumentImportResourcesToDraftAppVersionOutput(&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_deserializeOpErrorImportResourcesToDraftAppVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentImportResourcesToDraftAppVersionOutput(v **ImportResourcesToDraftAppVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ImportResourcesToDraftAppVersionOutput
if *v == nil {
sv = &ImportResourcesToDraftAppVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "eksSources":
if err := awsRestjson1_deserializeDocumentEksSourceList(&sv.EksSources, value); err != nil {
return err
}
case "sourceArns":
if err := awsRestjson1_deserializeDocumentArnList(&sv.SourceArns, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceImportStatusType to be of type string, got %T instead", value)
}
sv.Status = types.ResourceImportStatusType(jtv)
}
case "terraformSources":
if err := awsRestjson1_deserializeDocumentTerraformSourceList(&sv.TerraformSources, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAlarmRecommendations struct {
}
func (*awsRestjson1_deserializeOpListAlarmRecommendations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAlarmRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAlarmRecommendations(response, &metadata)
}
output := &ListAlarmRecommendationsOutput{}
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_deserializeOpDocumentListAlarmRecommendationsOutput(&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_deserializeOpErrorListAlarmRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAlarmRecommendationsOutput(v **ListAlarmRecommendationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAlarmRecommendationsOutput
if *v == nil {
sv = &ListAlarmRecommendationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "alarmRecommendations":
if err := awsRestjson1_deserializeDocumentAlarmRecommendationList(&sv.AlarmRecommendations, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAppAssessments struct {
}
func (*awsRestjson1_deserializeOpListAppAssessments) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAppAssessments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAppAssessments(response, &metadata)
}
output := &ListAppAssessmentsOutput{}
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_deserializeOpDocumentListAppAssessmentsOutput(&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_deserializeOpErrorListAppAssessments(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppAssessmentsOutput(v **ListAppAssessmentsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppAssessmentsOutput
if *v == nil {
sv = &ListAppAssessmentsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessmentSummaries":
if err := awsRestjson1_deserializeDocumentAppAssessmentSummaryList(&sv.AssessmentSummaries, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAppComponentCompliances struct {
}
func (*awsRestjson1_deserializeOpListAppComponentCompliances) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAppComponentCompliances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAppComponentCompliances(response, &metadata)
}
output := &ListAppComponentCompliancesOutput{}
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_deserializeOpDocumentListAppComponentCompliancesOutput(&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_deserializeOpErrorListAppComponentCompliances(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppComponentCompliancesOutput(v **ListAppComponentCompliancesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppComponentCompliancesOutput
if *v == nil {
sv = &ListAppComponentCompliancesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "componentCompliances":
if err := awsRestjson1_deserializeDocumentComponentCompliancesList(&sv.ComponentCompliances, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAppComponentRecommendations struct {
}
func (*awsRestjson1_deserializeOpListAppComponentRecommendations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAppComponentRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAppComponentRecommendations(response, &metadata)
}
output := &ListAppComponentRecommendationsOutput{}
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_deserializeOpDocumentListAppComponentRecommendationsOutput(&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_deserializeOpErrorListAppComponentRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppComponentRecommendationsOutput(v **ListAppComponentRecommendationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppComponentRecommendationsOutput
if *v == nil {
sv = &ListAppComponentRecommendationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "componentRecommendations":
if err := awsRestjson1_deserializeDocumentComponentRecommendationList(&sv.ComponentRecommendations, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAppInputSources struct {
}
func (*awsRestjson1_deserializeOpListAppInputSources) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAppInputSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAppInputSources(response, &metadata)
}
output := &ListAppInputSourcesOutput{}
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_deserializeOpDocumentListAppInputSourcesOutput(&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_deserializeOpErrorListAppInputSources(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppInputSourcesOutput(v **ListAppInputSourcesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppInputSourcesOutput
if *v == nil {
sv = &ListAppInputSourcesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appInputSources":
if err := awsRestjson1_deserializeDocumentAppInputSourceList(&sv.AppInputSources, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListApps struct {
}
func (*awsRestjson1_deserializeOpListApps) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListApps) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListApps(response, &metadata)
}
output := &ListAppsOutput{}
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_deserializeOpDocumentListAppsOutput(&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_deserializeOpErrorListApps(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppsOutput(v **ListAppsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppsOutput
if *v == nil {
sv = &ListAppsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appSummaries":
if err := awsRestjson1_deserializeDocumentAppSummaryList(&sv.AppSummaries, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAppVersionAppComponents struct {
}
func (*awsRestjson1_deserializeOpListAppVersionAppComponents) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAppVersionAppComponents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAppVersionAppComponents(response, &metadata)
}
output := &ListAppVersionAppComponentsOutput{}
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_deserializeOpDocumentListAppVersionAppComponentsOutput(&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_deserializeOpErrorListAppVersionAppComponents(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppVersionAppComponentsOutput(v **ListAppVersionAppComponentsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppVersionAppComponentsOutput
if *v == nil {
sv = &ListAppVersionAppComponentsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appComponents":
if err := awsRestjson1_deserializeDocumentAppComponentList(&sv.AppComponents, value); err != nil {
return err
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAppVersionResourceMappings struct {
}
func (*awsRestjson1_deserializeOpListAppVersionResourceMappings) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAppVersionResourceMappings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAppVersionResourceMappings(response, &metadata)
}
output := &ListAppVersionResourceMappingsOutput{}
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_deserializeOpDocumentListAppVersionResourceMappingsOutput(&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_deserializeOpErrorListAppVersionResourceMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppVersionResourceMappingsOutput(v **ListAppVersionResourceMappingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppVersionResourceMappingsOutput
if *v == nil {
sv = &ListAppVersionResourceMappingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "resourceMappings":
if err := awsRestjson1_deserializeDocumentResourceMappingList(&sv.ResourceMappings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAppVersionResources struct {
}
func (*awsRestjson1_deserializeOpListAppVersionResources) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAppVersionResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAppVersionResources(response, &metadata)
}
output := &ListAppVersionResourcesOutput{}
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_deserializeOpDocumentListAppVersionResourcesOutput(&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_deserializeOpErrorListAppVersionResources(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(v **ListAppVersionResourcesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppVersionResourcesOutput
if *v == nil {
sv = &ListAppVersionResourcesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "physicalResources":
if err := awsRestjson1_deserializeDocumentPhysicalResourceList(&sv.PhysicalResources, value); err != nil {
return err
}
case "resolutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.ResolutionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListAppVersions struct {
}
func (*awsRestjson1_deserializeOpListAppVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListAppVersions(response, &metadata)
}
output := &ListAppVersionsOutput{}
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_deserializeOpDocumentListAppVersionsOutput(&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_deserializeOpErrorListAppVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAppVersionsOutput
if *v == nil {
sv = &ListAppVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appVersions":
if err := awsRestjson1_deserializeDocumentAppVersionList(&sv.AppVersions, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListRecommendationTemplates struct {
}
func (*awsRestjson1_deserializeOpListRecommendationTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListRecommendationTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorListRecommendationTemplates(response, &metadata)
}
output := &ListRecommendationTemplatesOutput{}
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_deserializeOpDocumentListRecommendationTemplatesOutput(&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_deserializeOpErrorListRecommendationTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListRecommendationTemplatesOutput(v **ListRecommendationTemplatesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRecommendationTemplatesOutput
if *v == nil {
sv = &ListRecommendationTemplatesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "recommendationTemplates":
if err := awsRestjson1_deserializeDocumentRecommendationTemplateList(&sv.RecommendationTemplates, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListResiliencyPolicies struct {
}
func (*awsRestjson1_deserializeOpListResiliencyPolicies) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListResiliencyPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListResiliencyPolicies(response, &metadata)
}
output := &ListResiliencyPoliciesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListResiliencyPoliciesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListResiliencyPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListResiliencyPoliciesOutput(v **ListResiliencyPoliciesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListResiliencyPoliciesOutput
if *v == nil {
sv = &ListResiliencyPoliciesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "resiliencyPolicies":
if err := awsRestjson1_deserializeDocumentResiliencyPolicies(&sv.ResiliencyPolicies, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSopRecommendations struct {
}
func (*awsRestjson1_deserializeOpListSopRecommendations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSopRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListSopRecommendations(response, &metadata)
}
output := &ListSopRecommendationsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListSopRecommendationsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListSopRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSopRecommendationsOutput(v **ListSopRecommendationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSopRecommendationsOutput
if *v == nil {
sv = &ListSopRecommendationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "sopRecommendations":
if err := awsRestjson1_deserializeDocumentSopRecommendationList(&sv.SopRecommendations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSuggestedResiliencyPolicies struct {
}
func (*awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSuggestedResiliencyPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListSuggestedResiliencyPolicies(response, &metadata)
}
output := &ListSuggestedResiliencyPoliciesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListSuggestedResiliencyPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSuggestedResiliencyPoliciesOutput(v **ListSuggestedResiliencyPoliciesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSuggestedResiliencyPoliciesOutput
if *v == nil {
sv = &ListSuggestedResiliencyPoliciesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "resiliencyPolicies":
if err := awsRestjson1_deserializeDocumentResiliencyPolicies(&sv.ResiliencyPolicies, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTagsForResource struct {
}
func (*awsRestjson1_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTestRecommendations struct {
}
func (*awsRestjson1_deserializeOpListTestRecommendations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTestRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListTestRecommendations(response, &metadata)
}
output := &ListTestRecommendationsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListTestRecommendationsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListTestRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTestRecommendationsOutput(v **ListTestRecommendationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTestRecommendationsOutput
if *v == nil {
sv = &ListTestRecommendationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "testRecommendations":
if err := awsRestjson1_deserializeDocumentTestRecommendationList(&sv.TestRecommendations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListUnsupportedAppVersionResources struct {
}
func (*awsRestjson1_deserializeOpListUnsupportedAppVersionResources) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListUnsupportedAppVersionResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListUnsupportedAppVersionResources(response, &metadata)
}
output := &ListUnsupportedAppVersionResourcesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListUnsupportedAppVersionResourcesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListUnsupportedAppVersionResources(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListUnsupportedAppVersionResourcesOutput(v **ListUnsupportedAppVersionResourcesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListUnsupportedAppVersionResourcesOutput
if *v == nil {
sv = &ListUnsupportedAppVersionResourcesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "resolutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.ResolutionId = ptr.String(jtv)
}
case "unsupportedResources":
if err := awsRestjson1_deserializeDocumentUnsupportedResourceList(&sv.UnsupportedResources, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPublishAppVersion struct {
}
func (*awsRestjson1_deserializeOpPublishAppVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPublishAppVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorPublishAppVersion(response, &metadata)
}
output := &PublishAppVersionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentPublishAppVersionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPublishAppVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPublishAppVersionOutput(v **PublishAppVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PublishAppVersionOutput
if *v == nil {
sv = &PublishAppVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutDraftAppVersionTemplate struct {
}
func (*awsRestjson1_deserializeOpPutDraftAppVersionTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutDraftAppVersionTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorPutDraftAppVersionTemplate(response, &metadata)
}
output := &PutDraftAppVersionTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentPutDraftAppVersionTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutDraftAppVersionTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutDraftAppVersionTemplateOutput(v **PutDraftAppVersionTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutDraftAppVersionTemplateOutput
if *v == nil {
sv = &PutDraftAppVersionTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings struct {
}
func (*awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpRemoveDraftAppVersionResourceMappings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorRemoveDraftAppVersionResourceMappings(response, &metadata)
}
output := &RemoveDraftAppVersionResourceMappingsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentRemoveDraftAppVersionResourceMappingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorRemoveDraftAppVersionResourceMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentRemoveDraftAppVersionResourceMappingsOutput(v **RemoveDraftAppVersionResourceMappingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RemoveDraftAppVersionResourceMappingsOutput
if *v == nil {
sv = &RemoveDraftAppVersionResourceMappingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpResolveAppVersionResources struct {
}
func (*awsRestjson1_deserializeOpResolveAppVersionResources) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpResolveAppVersionResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorResolveAppVersionResources(response, &metadata)
}
output := &ResolveAppVersionResourcesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentResolveAppVersionResourcesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorResolveAppVersionResources(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentResolveAppVersionResourcesOutput(v **ResolveAppVersionResourcesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ResolveAppVersionResourcesOutput
if *v == nil {
sv = &ResolveAppVersionResourcesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "resolutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.ResolutionId = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceResolutionStatusType to be of type string, got %T instead", value)
}
sv.Status = types.ResourceResolutionStatusType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpStartAppAssessment struct {
}
func (*awsRestjson1_deserializeOpStartAppAssessment) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartAppAssessment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorStartAppAssessment(response, &metadata)
}
output := &StartAppAssessmentOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentStartAppAssessmentOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorStartAppAssessment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentStartAppAssessmentOutput(v **StartAppAssessmentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartAppAssessmentOutput
if *v == nil {
sv = &StartAppAssessmentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "assessment":
if err := awsRestjson1_deserializeDocumentAppAssessment(&sv.Assessment, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpTagResource struct {
}
func (*awsRestjson1_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUntagResource struct {
}
func (*awsRestjson1_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateApp struct {
}
func (*awsRestjson1_deserializeOpUpdateApp) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorUpdateApp(response, &metadata)
}
output := &UpdateAppOutput{}
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_deserializeOpDocumentUpdateAppOutput(&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_deserializeOpErrorUpdateApp(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateAppOutput(v **UpdateAppOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateAppOutput
if *v == nil {
sv = &UpdateAppOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "app":
if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateAppVersion struct {
}
func (*awsRestjson1_deserializeOpUpdateAppVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateAppVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorUpdateAppVersion(response, &metadata)
}
output := &UpdateAppVersionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateAppVersionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateAppVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateAppVersionOutput(v **UpdateAppVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateAppVersionOutput
if *v == nil {
sv = &UpdateAppVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "additionalInfo":
if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil {
return err
}
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateAppVersionAppComponent struct {
}
func (*awsRestjson1_deserializeOpUpdateAppVersionAppComponent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateAppVersionAppComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorUpdateAppVersionAppComponent(response, &metadata)
}
output := &UpdateAppVersionAppComponentOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateAppVersionAppComponentOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateAppVersionAppComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateAppVersionAppComponentOutput(v **UpdateAppVersionAppComponentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateAppVersionAppComponentOutput
if *v == nil {
sv = &UpdateAppVersionAppComponentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appComponent":
if err := awsRestjson1_deserializeDocumentAppComponent(&sv.AppComponent, value); err != nil {
return err
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateAppVersionResource struct {
}
func (*awsRestjson1_deserializeOpUpdateAppVersionResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateAppVersionResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
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_deserializeOpErrorUpdateAppVersionResource(response, &metadata)
}
output := &UpdateAppVersionResourceOutput{}
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_deserializeOpDocumentUpdateAppVersionResourceOutput(&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_deserializeOpErrorUpdateAppVersionResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateAppVersionResourceOutput(v **UpdateAppVersionResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateAppVersionResourceOutput
if *v == nil {
sv = &UpdateAppVersionResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "physicalResource":
if err := awsRestjson1_deserializeDocumentPhysicalResource(&sv.PhysicalResource, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateResiliencyPolicy struct {
}
func (*awsRestjson1_deserializeOpUpdateResiliencyPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateResiliencyPolicy) 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_deserializeOpErrorUpdateResiliencyPolicy(response, &metadata)
}
output := &UpdateResiliencyPolicyOutput{}
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_deserializeOpDocumentUpdateResiliencyPolicyOutput(&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_deserializeOpErrorUpdateResiliencyPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateResiliencyPolicyOutput(v **UpdateResiliencyPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateResiliencyPolicyOutput
if *v == nil {
sv = &UpdateResiliencyPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "policy":
if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&sv.Policy, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccessDeniedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConflictException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServerException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceNotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ServiceQuotaExceededException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ThrottlingException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ValidationException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentValidationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedException
if *v == nil {
sv = &types.AccessDeniedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAdditionalInfoMap(v *map[string][]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string][]string
if *v == nil {
mv = map[string][]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal []string
mapVar := parsedVal
if err := awsRestjson1_deserializeDocumentAdditionalInfoValueList(&mapVar, value); err != nil {
return err
}
parsedVal = mapVar
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentAdditionalInfoValueList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String1024 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAlarmRecommendation(v **types.AlarmRecommendation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AlarmRecommendation
if *v == nil {
sv = &types.AlarmRecommendation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appComponentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.AppComponentName = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "items":
if err := awsRestjson1_deserializeDocumentRecommendationItemList(&sv.Items, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "prerequisite":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Prerequisite = ptr.String(jtv)
}
case "recommendationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uuid to be of type string, got %T instead", value)
}
sv.RecommendationId = ptr.String(jtv)
}
case "referenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SpecReferenceId to be of type string, got %T instead", value)
}
sv.ReferenceId = ptr.String(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AlarmType to be of type string, got %T instead", value)
}
sv.Type = types.AlarmType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAlarmRecommendationList(v *[]types.AlarmRecommendation, 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.AlarmRecommendation
if *v == nil {
cv = []types.AlarmRecommendation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AlarmRecommendation
destAddr := &col
if err := awsRestjson1_deserializeDocumentAlarmRecommendation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAlarmReferenceIdList(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 String500 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentApp(v **types.App, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.App
if *v == nil {
sv = &types.App{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "assessmentSchedule":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AppAssessmentScheduleType to be of type string, got %T instead", value)
}
sv.AssessmentSchedule = types.AppAssessmentScheduleType(jtv)
}
case "complianceStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AppComplianceStatusType to be of type string, got %T instead", value)
}
sv.ComplianceStatus = types.AppComplianceStatusType(jtv)
}
case "creationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = 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 EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "lastAppComplianceEvaluationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastAppComplianceEvaluationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)
}
}
case "lastResiliencyScoreEvaluationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastResiliencyScoreEvaluationTime = 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 EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "policyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.PolicyArn = ptr.String(jtv)
}
case "resiliencyScore":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ResiliencyScore = 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.ResiliencyScore = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AppStatusType to be of type string, got %T instead", value)
}
sv.Status = types.AppStatusType(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAppAssessment(v **types.AppAssessment, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AppAssessment
if *v == nil {
sv = &types.AppAssessment{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "assessmentArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentArn = ptr.String(jtv)
}
case "assessmentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.AssessmentName = ptr.String(jtv)
}
case "assessmentStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentStatus to be of type string, got %T instead", value)
}
sv.AssessmentStatus = types.AssessmentStatus(jtv)
}
case "compliance":
if err := awsRestjson1_deserializeDocumentAssessmentCompliance(&sv.Compliance, value); err != nil {
return err
}
case "complianceStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComplianceStatus to be of type string, got %T instead", value)
}
sv.ComplianceStatus = types.ComplianceStatus(jtv)
}
case "cost":
if err := awsRestjson1_deserializeDocumentCost(&sv.Cost, value); err != nil {
return err
}
case "endTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)
}
}
case "invoker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentInvoker to be of type string, got %T instead", value)
}
sv.Invoker = types.AssessmentInvoker(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "policy":
if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&sv.Policy, value); err != nil {
return err
}
case "resiliencyScore":
if err := awsRestjson1_deserializeDocumentResiliencyScore(&sv.ResiliencyScore, value); err != nil {
return err
}
case "resourceErrorsDetails":
if err := awsRestjson1_deserializeDocumentResourceErrorsDetails(&sv.ResourceErrorsDetails, value); err != nil {
return err
}
case "startTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)
}
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAppAssessmentSummary(v **types.AppAssessmentSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AppAssessmentSummary
if *v == nil {
sv = &types.AppAssessmentSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
case "assessmentArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentArn = ptr.String(jtv)
}
case "assessmentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.AssessmentName = ptr.String(jtv)
}
case "assessmentStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentStatus to be of type string, got %T instead", value)
}
sv.AssessmentStatus = types.AssessmentStatus(jtv)
}
case "complianceStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComplianceStatus to be of type string, got %T instead", value)
}
sv.ComplianceStatus = types.ComplianceStatus(jtv)
}
case "cost":
if err := awsRestjson1_deserializeDocumentCost(&sv.Cost, value); err != nil {
return err
}
case "endTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)
}
}
case "invoker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AssessmentInvoker to be of type string, got %T instead", value)
}
sv.Invoker = types.AssessmentInvoker(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "resiliencyScore":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ResiliencyScore = 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.ResiliencyScore = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "startTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = 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 awsRestjson1_deserializeDocumentAppAssessmentSummaryList(v *[]types.AppAssessmentSummary, 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.AppAssessmentSummary
if *v == nil {
cv = []types.AppAssessmentSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AppAssessmentSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentAppAssessmentSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAppComponent(v **types.AppComponent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AppComponent
if *v == nil {
sv = &types.AppComponent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "additionalInfo":
if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil {
return err
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 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 String255 to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAppComponentCompliance(v **types.AppComponentCompliance, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AppComponentCompliance
if *v == nil {
sv = &types.AppComponentCompliance{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appComponentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.AppComponentName = ptr.String(jtv)
}
case "compliance":
if err := awsRestjson1_deserializeDocumentAssessmentCompliance(&sv.Compliance, value); err != nil {
return err
}
case "cost":
if err := awsRestjson1_deserializeDocumentCost(&sv.Cost, value); err != nil {
return err
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "resiliencyScore":
if err := awsRestjson1_deserializeDocumentResiliencyScore(&sv.ResiliencyScore, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComplianceStatus to be of type string, got %T instead", value)
}
sv.Status = types.ComplianceStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAppComponentList(v *[]types.AppComponent, 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.AppComponent
if *v == nil {
cv = []types.AppComponent{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AppComponent
destAddr := &col
if err := awsRestjson1_deserializeDocumentAppComponent(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAppInputSource(v **types.AppInputSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AppInputSource
if *v == nil {
sv = &types.AppInputSource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eksSourceClusterNamespace":
if err := awsRestjson1_deserializeDocumentEksSourceClusterNamespace(&sv.EksSourceClusterNamespace, value); err != nil {
return err
}
case "importType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceMappingType to be of type string, got %T instead", value)
}
sv.ImportType = types.ResourceMappingType(jtv)
}
case "resourceCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResourceCount = int32(i64)
}
case "sourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.SourceArn = ptr.String(jtv)
}
case "sourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.SourceName = ptr.String(jtv)
}
case "terraformSource":
if err := awsRestjson1_deserializeDocumentTerraformSource(&sv.TerraformSource, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAppInputSourceList(v *[]types.AppInputSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.AppInputSource
if *v == nil {
cv = []types.AppInputSource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AppInputSource
destAddr := &col
if err := awsRestjson1_deserializeDocumentAppInputSource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAppSummary(v **types.AppSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AppSummary
if *v == nil {
sv = &types.AppSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "assessmentSchedule":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AppAssessmentScheduleType to be of type string, got %T instead", value)
}
sv.AssessmentSchedule = types.AppAssessmentScheduleType(jtv)
}
case "complianceStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AppComplianceStatusType to be of type string, got %T instead", value)
}
sv.ComplianceStatus = types.AppComplianceStatusType(jtv)
}
case "creationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = 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 EntityDescription 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 EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "resiliencyScore":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ResiliencyScore = 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.ResiliencyScore = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AppStatusType to be of type string, got %T instead", value)
}
sv.Status = types.AppStatusType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAppSummaryList(v *[]types.AppSummary, 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.AppSummary
if *v == nil {
cv = []types.AppSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AppSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentAppSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAppVersionList(v *[]types.AppVersionSummary, 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.AppVersionSummary
if *v == nil {
cv = []types.AppVersionSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AppVersionSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentAppVersionSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAppVersionSummary(v **types.AppVersionSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AppVersionSummary
if *v == nil {
sv = &types.AppVersionSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value)
}
sv.AppVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentArnList(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 awsRestjson1_deserializeDocumentAssessmentCompliance(v *map[string]types.DisruptionCompliance, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %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.DisruptionCompliance
if *v == nil {
mv = map[string]types.DisruptionCompliance{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.DisruptionCompliance
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentDisruptionCompliance(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentComponentCompliancesList(v *[]types.AppComponentCompliance, 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.AppComponentCompliance
if *v == nil {
cv = []types.AppComponentCompliance{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AppComponentCompliance
destAddr := &col
if err := awsRestjson1_deserializeDocumentAppComponentCompliance(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentComponentRecommendation(v **types.ComponentRecommendation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ComponentRecommendation
if *v == nil {
sv = &types.ComponentRecommendation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appComponentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.AppComponentName = ptr.String(jtv)
}
case "configRecommendations":
if err := awsRestjson1_deserializeDocumentConfigRecommendationList(&sv.ConfigRecommendations, value); err != nil {
return err
}
case "recommendationStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecommendationComplianceStatus to be of type string, got %T instead", value)
}
sv.RecommendationStatus = types.RecommendationComplianceStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentComponentRecommendationList(v *[]types.ComponentRecommendation, 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.ComponentRecommendation
if *v == nil {
cv = []types.ComponentRecommendation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ComponentRecommendation
destAddr := &col
if err := awsRestjson1_deserializeDocumentComponentRecommendation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentConfigRecommendation(v **types.ConfigRecommendation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ConfigRecommendation
if *v == nil {
sv = &types.ConfigRecommendation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appComponentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.AppComponentName = ptr.String(jtv)
}
case "compliance":
if err := awsRestjson1_deserializeDocumentAssessmentCompliance(&sv.Compliance, value); err != nil {
return err
}
case "cost":
if err := awsRestjson1_deserializeDocumentCost(&sv.Cost, value); err != nil {
return err
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "haArchitecture":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HaArchitecture to be of type string, got %T instead", value)
}
sv.HaArchitecture = types.HaArchitecture(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "optimizationType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConfigRecommendationOptimizationType to be of type string, got %T instead", value)
}
sv.OptimizationType = types.ConfigRecommendationOptimizationType(jtv)
}
case "recommendationCompliance":
if err := awsRestjson1_deserializeDocumentRecommendationCompliance(&sv.RecommendationCompliance, value); err != nil {
return err
}
case "referenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SpecReferenceId to be of type string, got %T instead", value)
}
sv.ReferenceId = ptr.String(jtv)
}
case "suggestedChanges":
if err := awsRestjson1_deserializeDocumentSuggestedChangesList(&sv.SuggestedChanges, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConfigRecommendationList(v *[]types.ConfigRecommendation, 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.ConfigRecommendation
if *v == nil {
cv = []types.ConfigRecommendation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ConfigRecommendation
destAddr := &col
if err := awsRestjson1_deserializeDocumentConfigRecommendation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} 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 String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "resourceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.ResourceId = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCost(v **types.Cost, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Cost
if *v == nil {
sv = &types.Cost{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "amount":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Amount = 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.Amount = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "currency":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CurrencyCode to be of type string, got %T instead", value)
}
sv.Currency = ptr.String(jtv)
}
case "frequency":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CostFrequency to be of type string, got %T instead", value)
}
sv.Frequency = types.CostFrequency(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDisruptionCompliance(v **types.DisruptionCompliance, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DisruptionCompliance
if *v == nil {
sv = &types.DisruptionCompliance{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "achievableRpoInSecs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.AchievableRpoInSecs = int32(i64)
}
case "achievableRtoInSecs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.AchievableRtoInSecs = int32(i64)
}
case "complianceStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComplianceStatus to be of type string, got %T instead", value)
}
sv.ComplianceStatus = types.ComplianceStatus(jtv)
}
case "currentRpoInSecs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CurrentRpoInSecs = int32(i64)
}
case "currentRtoInSecs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CurrentRtoInSecs = int32(i64)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "rpoDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.RpoDescription = ptr.String(jtv)
}
case "rpoReferenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.RpoReferenceId = ptr.String(jtv)
}
case "rtoDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.RtoDescription = ptr.String(jtv)
}
case "rtoReferenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.RtoReferenceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDisruptionPolicy(v *map[string]types.FailurePolicy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %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.FailurePolicy
if *v == nil {
mv = map[string]types.FailurePolicy{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.FailurePolicy
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentFailurePolicy(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentDisruptionResiliencyScore(v *map[string]float64, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %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]float64
if *v == nil {
mv = map[string]float64{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal float64
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
parsedVal = 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)
}
parsedVal = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentEksNamespaceList(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 EksNamespace to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentEksSource(v **types.EksSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.EksSource
if *v == nil {
sv = &types.EksSource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eksClusterArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.EksClusterArn = ptr.String(jtv)
}
case "namespaces":
if err := awsRestjson1_deserializeDocumentEksNamespaceList(&sv.Namespaces, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEksSourceClusterNamespace(v **types.EksSourceClusterNamespace, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.EksSourceClusterNamespace
if *v == nil {
sv = &types.EksSourceClusterNamespace{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eksClusterArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.EksClusterArn = ptr.String(jtv)
}
case "namespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EksNamespace to be of type string, got %T instead", value)
}
sv.Namespace = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEksSourceList(v *[]types.EksSource, 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.EksSource
if *v == nil {
cv = []types.EksSource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EksSource
destAddr := &col
if err := awsRestjson1_deserializeDocumentEksSource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentFailurePolicy(v **types.FailurePolicy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.FailurePolicy
if *v == nil {
sv = &types.FailurePolicy{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "rpoInSecs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RpoInSecs = int32(i64)
}
case "rtoInSecs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RtoInSecs = int32(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerException
if *v == nil {
sv = &types.InternalServerException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLogicalResourceId(v **types.LogicalResourceId, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.LogicalResourceId
if *v == nil {
sv = &types.LogicalResourceId{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eksSourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.EksSourceName = ptr.String(jtv)
}
case "identifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.Identifier = ptr.String(jtv)
}
case "logicalStackName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.LogicalStackName = ptr.String(jtv)
}
case "resourceGroupName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.ResourceGroupName = ptr.String(jtv)
}
case "terraformSourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.TerraformSourceName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPhysicalResource(v **types.PhysicalResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.PhysicalResource
if *v == nil {
sv = &types.PhysicalResource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "additionalInfo":
if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil {
return err
}
case "appComponents":
if err := awsRestjson1_deserializeDocumentAppComponentList(&sv.AppComponents, value); err != nil {
return err
}
case "excluded":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
}
sv.Excluded = ptr.Bool(jtv)
}
case "logicalResourceId":
if err := awsRestjson1_deserializeDocumentLogicalResourceId(&sv.LogicalResourceId, value); err != nil {
return err
}
case "parentResourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.ParentResourceName = ptr.String(jtv)
}
case "physicalResourceId":
if err := awsRestjson1_deserializeDocumentPhysicalResourceId(&sv.PhysicalResourceId, value); err != nil {
return err
}
case "resourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.ResourceName = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
case "sourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceSourceType to be of type string, got %T instead", value)
}
sv.SourceType = types.ResourceSourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPhysicalResourceId(v **types.PhysicalResourceId, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.PhysicalResourceId
if *v == nil {
sv = &types.PhysicalResourceId{}
} 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 CustomerId to be of type string, got %T instead", value)
}
sv.AwsAccountId = ptr.String(jtv)
}
case "awsRegion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsRegion to be of type string, got %T instead", value)
}
sv.AwsRegion = ptr.String(jtv)
}
case "identifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.Identifier = ptr.String(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PhysicalIdentifierType to be of type string, got %T instead", value)
}
sv.Type = types.PhysicalIdentifierType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPhysicalResourceList(v *[]types.PhysicalResource, 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.PhysicalResource
if *v == nil {
cv = []types.PhysicalResource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PhysicalResource
destAddr := &col
if err := awsRestjson1_deserializeDocumentPhysicalResource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentRecommendationCompliance(v *map[string]types.RecommendationDisruptionCompliance, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %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.RecommendationDisruptionCompliance
if *v == nil {
mv = map[string]types.RecommendationDisruptionCompliance{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.RecommendationDisruptionCompliance
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentRecommendationDisruptionCompliance(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentRecommendationDisruptionCompliance(v **types.RecommendationDisruptionCompliance, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.RecommendationDisruptionCompliance
if *v == nil {
sv = &types.RecommendationDisruptionCompliance{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "expectedComplianceStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComplianceStatus to be of type string, got %T instead", value)
}
sv.ExpectedComplianceStatus = types.ComplianceStatus(jtv)
}
case "expectedRpoDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.ExpectedRpoDescription = ptr.String(jtv)
}
case "expectedRpoInSecs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ExpectedRpoInSecs = int32(i64)
}
case "expectedRtoDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.ExpectedRtoDescription = ptr.String(jtv)
}
case "expectedRtoInSecs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ExpectedRtoInSecs = int32(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRecommendationIdList(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 Uuid to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentRecommendationItem(v **types.RecommendationItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.RecommendationItem
if *v == nil {
sv = &types.RecommendationItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "alreadyImplemented":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
}
sv.AlreadyImplemented = ptr.Bool(jtv)
}
case "resourceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.ResourceId = ptr.String(jtv)
}
case "targetAccountId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomerId to be of type string, got %T instead", value)
}
sv.TargetAccountId = ptr.String(jtv)
}
case "targetRegion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsRegion to be of type string, got %T instead", value)
}
sv.TargetRegion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRecommendationItemList(v *[]types.RecommendationItem, 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.RecommendationItem
if *v == nil {
cv = []types.RecommendationItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RecommendationItem
destAddr := &col
if err := awsRestjson1_deserializeDocumentRecommendationItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentRecommendationTemplate(v **types.RecommendationTemplate, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.RecommendationTemplate
if *v == nil {
sv = &types.RecommendationTemplate{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AppArn = ptr.String(jtv)
}
case "assessmentArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.AssessmentArn = ptr.String(jtv)
}
case "endTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)
}
}
case "format":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TemplateFormat to be of type string, got %T instead", value)
}
sv.Format = types.TemplateFormat(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 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 EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "needsReplacements":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
}
sv.NeedsReplacements = ptr.Bool(jtv)
}
case "recommendationIds":
if err := awsRestjson1_deserializeDocumentRecommendationIdList(&sv.RecommendationIds, value); err != nil {
return err
}
case "recommendationTemplateArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.RecommendationTemplateArn = ptr.String(jtv)
}
case "recommendationTypes":
if err := awsRestjson1_deserializeDocumentRenderRecommendationTypeList(&sv.RecommendationTypes, value); err != nil {
return err
}
case "startTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)
}
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecommendationTemplateStatus to be of type string, got %T instead", value)
}
sv.Status = types.RecommendationTemplateStatus(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "templatesLocation":
if err := awsRestjson1_deserializeDocumentS3Location(&sv.TemplatesLocation, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRecommendationTemplateList(v *[]types.RecommendationTemplate, 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.RecommendationTemplate
if *v == nil {
cv = []types.RecommendationTemplate{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RecommendationTemplate
destAddr := &col
if err := awsRestjson1_deserializeDocumentRecommendationTemplate(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentRenderRecommendationTypeList(v *[]types.RenderRecommendationType, 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.RenderRecommendationType
if *v == nil {
cv = []types.RenderRecommendationType{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RenderRecommendationType
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RenderRecommendationType to be of type string, got %T instead", value)
}
col = types.RenderRecommendationType(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentResiliencyPolicies(v *[]types.ResiliencyPolicy, 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.ResiliencyPolicy
if *v == nil {
cv = []types.ResiliencyPolicy{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ResiliencyPolicy
destAddr := &col
if err := awsRestjson1_deserializeDocumentResiliencyPolicy(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentResiliencyPolicy(v **types.ResiliencyPolicy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ResiliencyPolicy
if *v == nil {
sv = &types.ResiliencyPolicy{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "creationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)
}
}
case "dataLocationConstraint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataLocationConstraint to be of type string, got %T instead", value)
}
sv.DataLocationConstraint = types.DataLocationConstraint(jtv)
}
case "estimatedCostTier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EstimatedCostTier to be of type string, got %T instead", value)
}
sv.EstimatedCostTier = types.EstimatedCostTier(jtv)
}
case "policy":
if err := awsRestjson1_deserializeDocumentDisruptionPolicy(&sv.Policy, value); err != nil {
return err
}
case "policyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.PolicyArn = ptr.String(jtv)
}
case "policyDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.PolicyDescription = ptr.String(jtv)
}
case "policyName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.PolicyName = ptr.String(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "tier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResiliencyPolicyTier to be of type string, got %T instead", value)
}
sv.Tier = types.ResiliencyPolicyTier(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResiliencyScore(v **types.ResiliencyScore, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ResiliencyScore
if *v == nil {
sv = &types.ResiliencyScore{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "disruptionScore":
if err := awsRestjson1_deserializeDocumentDisruptionResiliencyScore(&sv.DisruptionScore, value); err != nil {
return err
}
case "score":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Score = 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 = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceError(v **types.ResourceError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ResourceError
if *v == nil {
sv = &types.ResourceError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logicalResourceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.LogicalResourceId = ptr.String(jtv)
}
case "physicalResourceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.PhysicalResourceId = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceErrorList(v *[]types.ResourceError, 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.ResourceError
if *v == nil {
cv = []types.ResourceError{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ResourceError
destAddr := &col
if err := awsRestjson1_deserializeDocumentResourceError(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentResourceErrorsDetails(v **types.ResourceErrorsDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ResourceErrorsDetails
if *v == nil {
sv = &types.ResourceErrorsDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "hasMoreErrors":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
}
sv.HasMoreErrors = ptr.Bool(jtv)
}
case "resourceErrors":
if err := awsRestjson1_deserializeDocumentResourceErrorList(&sv.ResourceErrors, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceMapping(v **types.ResourceMapping, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ResourceMapping
if *v == nil {
sv = &types.ResourceMapping{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appRegistryAppName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.AppRegistryAppName = ptr.String(jtv)
}
case "eksSourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.EksSourceName = ptr.String(jtv)
}
case "logicalStackName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.LogicalStackName = ptr.String(jtv)
}
case "mappingType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceMappingType to be of type string, got %T instead", value)
}
sv.MappingType = types.ResourceMappingType(jtv)
}
case "physicalResourceId":
if err := awsRestjson1_deserializeDocumentPhysicalResourceId(&sv.PhysicalResourceId, value); err != nil {
return err
}
case "resourceGroupName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.ResourceGroupName = ptr.String(jtv)
}
case "resourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.ResourceName = ptr.String(jtv)
}
case "terraformSourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.TerraformSourceName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceMappingList(v *[]types.ResourceMapping, 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.ResourceMapping
if *v == nil {
cv = []types.ResourceMapping{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ResourceMapping
destAddr := &col
if err := awsRestjson1_deserializeDocumentResourceMapping(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
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 String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "resourceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.ResourceId = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentS3Location(v **types.S3Location, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.S3Location
if *v == nil {
sv = &types.S3Location{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bucket":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Bucket = ptr.String(jtv)
}
case "prefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Prefix = 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 String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSopRecommendation(v **types.SopRecommendation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SopRecommendation
if *v == nil {
sv = &types.SopRecommendation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appComponentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.AppComponentName = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "items":
if err := awsRestjson1_deserializeDocumentRecommendationItemList(&sv.Items, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DocumentName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "prerequisite":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Prerequisite = ptr.String(jtv)
}
case "recommendationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uuid to be of type string, got %T instead", value)
}
sv.RecommendationId = ptr.String(jtv)
}
case "referenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SpecReferenceId to be of type string, got %T instead", value)
}
sv.ReferenceId = ptr.String(jtv)
}
case "serviceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SopServiceType to be of type string, got %T instead", value)
}
sv.ServiceType = types.SopServiceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSopRecommendationList(v *[]types.SopRecommendation, 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.SopRecommendation
if *v == nil {
cv = []types.SopRecommendation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SopRecommendation
destAddr := &col
if err := awsRestjson1_deserializeDocumentSopRecommendation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSuggestedChangesList(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 EntityDescription to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
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_deserializeDocumentTerraformSource(v **types.TerraformSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.TerraformSource
if *v == nil {
sv = &types.TerraformSource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "s3StateFileUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3Url to be of type string, got %T instead", value)
}
sv.S3StateFileUrl = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTerraformSourceList(v *[]types.TerraformSource, 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.TerraformSource
if *v == nil {
cv = []types.TerraformSource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TerraformSource
destAddr := &col
if err := awsRestjson1_deserializeDocumentTerraformSource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTestRecommendation(v **types.TestRecommendation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.TestRecommendation
if *v == nil {
sv = &types.TestRecommendation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "appComponentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.AppComponentName = ptr.String(jtv)
}
case "dependsOnAlarms":
if err := awsRestjson1_deserializeDocumentAlarmReferenceIdList(&sv.DependsOnAlarms, value); err != nil {
return err
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "intent":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Intent = ptr.String(jtv)
}
case "items":
if err := awsRestjson1_deserializeDocumentRecommendationItemList(&sv.Items, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DocumentName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "prerequisite":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Prerequisite = ptr.String(jtv)
}
case "recommendationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uuid to be of type string, got %T instead", value)
}
sv.RecommendationId = ptr.String(jtv)
}
case "referenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SpecReferenceId to be of type string, got %T instead", value)
}
sv.ReferenceId = ptr.String(jtv)
}
case "risk":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TestRisk to be of type string, got %T instead", value)
}
sv.Risk = types.TestRisk(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TestType to be of type string, got %T instead", value)
}
sv.Type = types.TestType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTestRecommendationList(v *[]types.TestRecommendation, 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.TestRecommendation
if *v == nil {
cv = []types.TestRecommendation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TestRecommendation
destAddr := &col
if err := awsRestjson1_deserializeDocumentTestRecommendation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ThrottlingException
if *v == nil {
sv = &types.ThrottlingException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "retryAfterSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RetryAfterSeconds = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentUnsupportedResource(v **types.UnsupportedResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedResource
if *v == nil {
sv = &types.UnsupportedResource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logicalResourceId":
if err := awsRestjson1_deserializeDocumentLogicalResourceId(&sv.LogicalResourceId, value); err != nil {
return err
}
case "physicalResourceId":
if err := awsRestjson1_deserializeDocumentPhysicalResourceId(&sv.PhysicalResourceId, value); err != nil {
return err
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
case "unsupportedResourceStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String255 to be of type string, got %T instead", value)
}
sv.UnsupportedResourceStatus = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentUnsupportedResourceList(v *[]types.UnsupportedResource, 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.UnsupportedResource
if *v == nil {
cv = []types.UnsupportedResource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.UnsupportedResource
destAddr := &col
if err := awsRestjson1_deserializeDocumentUnsupportedResource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String500 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 13,482 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package resiliencehub provides the API client, operations, and parameter types
// for AWS Resilience Hub.
//
// Resilience Hub helps you proactively prepare and protect your Amazon Web
// Services applications from disruptions. It offers continual resiliency
// assessment and validation that integrates into your software development
// lifecycle. This enables you to uncover resiliency weaknesses, ensure recovery
// time objective (RTO) and recovery point objective (RPO) targets for your
// applications are met, and resolve issues before they are released into
// production.
package resiliencehub
| 14 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
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/resiliencehub/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 = "resiliencehub"
}
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 resiliencehub
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.11.3"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/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_serializeOpAddDraftAppVersionResourceMappings struct {
}
func (*awsRestjson1_serializeOpAddDraftAppVersionResourceMappings) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAddDraftAppVersionResourceMappings) 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.(*AddDraftAppVersionResourceMappingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/add-draft-app-version-resource-mappings")
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_serializeOpDocumentAddDraftAppVersionResourceMappingsInput(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_serializeOpHttpBindingsAddDraftAppVersionResourceMappingsInput(v *AddDraftAppVersionResourceMappingsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentAddDraftAppVersionResourceMappingsInput(v *AddDraftAppVersionResourceMappingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.ResourceMappings != nil {
ok := object.Key("resourceMappings")
if err := awsRestjson1_serializeDocumentResourceMappingList(v.ResourceMappings, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateApp struct {
}
func (*awsRestjson1_serializeOpCreateApp) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateApp) 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.(*CreateAppInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/create-app")
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_serializeOpDocumentCreateAppInput(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_serializeOpHttpBindingsCreateAppInput(v *CreateAppInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAppInput(v *CreateAppInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AssessmentSchedule) > 0 {
ok := object.Key("assessmentSchedule")
ok.String(string(v.AssessmentSchedule))
}
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.PolicyArn != nil {
ok := object.Key("policyArn")
ok.String(*v.PolicyArn)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateAppVersionAppComponent struct {
}
func (*awsRestjson1_serializeOpCreateAppVersionAppComponent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAppVersionAppComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateAppVersionAppComponentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/create-app-version-app-component")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateAppVersionAppComponentInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateAppVersionAppComponentInput(v *CreateAppVersionAppComponentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAppVersionAppComponentInput(v *CreateAppVersionAppComponentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalInfo != nil {
ok := object.Key("additionalInfo")
if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil {
return err
}
}
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
type awsRestjson1_serializeOpCreateAppVersionResource struct {
}
func (*awsRestjson1_serializeOpCreateAppVersionResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAppVersionResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateAppVersionResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/create-app-version-resource")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateAppVersionResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateAppVersionResourceInput(v *CreateAppVersionResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAppVersionResourceInput(v *CreateAppVersionResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalInfo != nil {
ok := object.Key("additionalInfo")
if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil {
return err
}
}
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppComponents != nil {
ok := object.Key("appComponents")
if err := awsRestjson1_serializeDocumentAppComponentNameList(v.AppComponents, ok); err != nil {
return err
}
}
if v.AwsAccountId != nil {
ok := object.Key("awsAccountId")
ok.String(*v.AwsAccountId)
}
if v.AwsRegion != nil {
ok := object.Key("awsRegion")
ok.String(*v.AwsRegion)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.LogicalResourceId != nil {
ok := object.Key("logicalResourceId")
if err := awsRestjson1_serializeDocumentLogicalResourceId(v.LogicalResourceId, ok); err != nil {
return err
}
}
if v.PhysicalResourceId != nil {
ok := object.Key("physicalResourceId")
ok.String(*v.PhysicalResourceId)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
if v.ResourceType != nil {
ok := object.Key("resourceType")
ok.String(*v.ResourceType)
}
return nil
}
type awsRestjson1_serializeOpCreateRecommendationTemplate struct {
}
func (*awsRestjson1_serializeOpCreateRecommendationTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateRecommendationTemplate) 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.(*CreateRecommendationTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/create-recommendation-template")
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_serializeOpDocumentCreateRecommendationTemplateInput(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_serializeOpHttpBindingsCreateRecommendationTemplateInput(v *CreateRecommendationTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateRecommendationTemplateInput(v *CreateRecommendationTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentArn != nil {
ok := object.Key("assessmentArn")
ok.String(*v.AssessmentArn)
}
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if len(v.Format) > 0 {
ok := object.Key("format")
ok.String(string(v.Format))
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.RecommendationIds != nil {
ok := object.Key("recommendationIds")
if err := awsRestjson1_serializeDocumentRecommendationIdList(v.RecommendationIds, ok); err != nil {
return err
}
}
if v.RecommendationTypes != nil {
ok := object.Key("recommendationTypes")
if err := awsRestjson1_serializeDocumentRenderRecommendationTypeList(v.RecommendationTypes, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateResiliencyPolicy struct {
}
func (*awsRestjson1_serializeOpCreateResiliencyPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateResiliencyPolicy) 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.(*CreateResiliencyPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/create-resiliency-policy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateResiliencyPolicyInput(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_serializeOpHttpBindingsCreateResiliencyPolicyInput(v *CreateResiliencyPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateResiliencyPolicyInput(v *CreateResiliencyPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if len(v.DataLocationConstraint) > 0 {
ok := object.Key("dataLocationConstraint")
ok.String(string(v.DataLocationConstraint))
}
if v.Policy != nil {
ok := object.Key("policy")
if err := awsRestjson1_serializeDocumentDisruptionPolicy(v.Policy, ok); err != nil {
return err
}
}
if v.PolicyDescription != nil {
ok := object.Key("policyDescription")
ok.String(*v.PolicyDescription)
}
if v.PolicyName != nil {
ok := object.Key("policyName")
ok.String(*v.PolicyName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if len(v.Tier) > 0 {
ok := object.Key("tier")
ok.String(string(v.Tier))
}
return nil
}
type awsRestjson1_serializeOpDeleteApp struct {
}
func (*awsRestjson1_serializeOpDeleteApp) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteApp) 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.(*DeleteAppInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/delete-app")
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_serializeOpDocumentDeleteAppInput(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_serializeOpHttpBindingsDeleteAppInput(v *DeleteAppInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteAppInput(v *DeleteAppInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ForceDelete != nil {
ok := object.Key("forceDelete")
ok.Boolean(*v.ForceDelete)
}
return nil
}
type awsRestjson1_serializeOpDeleteAppAssessment struct {
}
func (*awsRestjson1_serializeOpDeleteAppAssessment) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAppAssessment) 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.(*DeleteAppAssessmentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/delete-app-assessment")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDeleteAppAssessmentInput(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_serializeOpHttpBindingsDeleteAppAssessmentInput(v *DeleteAppAssessmentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteAppAssessmentInput(v *DeleteAppAssessmentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentArn != nil {
ok := object.Key("assessmentArn")
ok.String(*v.AssessmentArn)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpDeleteAppInputSource struct {
}
func (*awsRestjson1_serializeOpDeleteAppInputSource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAppInputSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAppInputSourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/delete-app-input-source")
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_serializeOpDocumentDeleteAppInputSourceInput(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_serializeOpHttpBindingsDeleteAppInputSourceInput(v *DeleteAppInputSourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteAppInputSourceInput(v *DeleteAppInputSourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.EksSourceClusterNamespace != nil {
ok := object.Key("eksSourceClusterNamespace")
if err := awsRestjson1_serializeDocumentEksSourceClusterNamespace(v.EksSourceClusterNamespace, ok); err != nil {
return err
}
}
if v.SourceArn != nil {
ok := object.Key("sourceArn")
ok.String(*v.SourceArn)
}
if v.TerraformSource != nil {
ok := object.Key("terraformSource")
if err := awsRestjson1_serializeDocumentTerraformSource(v.TerraformSource, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteAppVersionAppComponent struct {
}
func (*awsRestjson1_serializeOpDeleteAppVersionAppComponent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAppVersionAppComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAppVersionAppComponentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/delete-app-version-app-component")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDeleteAppVersionAppComponentInput(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_serializeOpHttpBindingsDeleteAppVersionAppComponentInput(v *DeleteAppVersionAppComponentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteAppVersionAppComponentInput(v *DeleteAppVersionAppComponentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
type awsRestjson1_serializeOpDeleteAppVersionResource struct {
}
func (*awsRestjson1_serializeOpDeleteAppVersionResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAppVersionResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAppVersionResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/delete-app-version-resource")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
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_serializeOpDocumentDeleteAppVersionResourceInput(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_serializeOpHttpBindingsDeleteAppVersionResourceInput(v *DeleteAppVersionResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteAppVersionResourceInput(v *DeleteAppVersionResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AwsAccountId != nil {
ok := object.Key("awsAccountId")
ok.String(*v.AwsAccountId)
}
if v.AwsRegion != nil {
ok := object.Key("awsRegion")
ok.String(*v.AwsRegion)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.LogicalResourceId != nil {
ok := object.Key("logicalResourceId")
if err := awsRestjson1_serializeDocumentLogicalResourceId(v.LogicalResourceId, ok); err != nil {
return err
}
}
if v.PhysicalResourceId != nil {
ok := object.Key("physicalResourceId")
ok.String(*v.PhysicalResourceId)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
type awsRestjson1_serializeOpDeleteRecommendationTemplate struct {
}
func (*awsRestjson1_serializeOpDeleteRecommendationTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteRecommendationTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRecommendationTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/delete-recommendation-template")
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_serializeOpDocumentDeleteRecommendationTemplateInput(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_serializeOpHttpBindingsDeleteRecommendationTemplateInput(v *DeleteRecommendationTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteRecommendationTemplateInput(v *DeleteRecommendationTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.RecommendationTemplateArn != nil {
ok := object.Key("recommendationTemplateArn")
ok.String(*v.RecommendationTemplateArn)
}
return nil
}
type awsRestjson1_serializeOpDeleteResiliencyPolicy struct {
}
func (*awsRestjson1_serializeOpDeleteResiliencyPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteResiliencyPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteResiliencyPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/delete-resiliency-policy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDeleteResiliencyPolicyInput(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_serializeOpHttpBindingsDeleteResiliencyPolicyInput(v *DeleteResiliencyPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteResiliencyPolicyInput(v *DeleteResiliencyPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.PolicyArn != nil {
ok := object.Key("policyArn")
ok.String(*v.PolicyArn)
}
return nil
}
type awsRestjson1_serializeOpDescribeApp struct {
}
func (*awsRestjson1_serializeOpDescribeApp) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAppInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-app")
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_serializeOpDocumentDescribeAppInput(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_serializeOpHttpBindingsDescribeAppInput(v *DescribeAppInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeAppInput(v *DescribeAppInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
return nil
}
type awsRestjson1_serializeOpDescribeAppAssessment struct {
}
func (*awsRestjson1_serializeOpDescribeAppAssessment) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAppAssessment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAppAssessmentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-app-assessment")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDescribeAppAssessmentInput(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_serializeOpHttpBindingsDescribeAppAssessmentInput(v *DescribeAppAssessmentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeAppAssessmentInput(v *DescribeAppAssessmentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentArn != nil {
ok := object.Key("assessmentArn")
ok.String(*v.AssessmentArn)
}
return nil
}
type awsRestjson1_serializeOpDescribeAppVersion struct {
}
func (*awsRestjson1_serializeOpDescribeAppVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAppVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAppVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-app-version")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDescribeAppVersionInput(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_serializeOpHttpBindingsDescribeAppVersionInput(v *DescribeAppVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeAppVersionInput(v *DescribeAppVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
return nil
}
type awsRestjson1_serializeOpDescribeAppVersionAppComponent struct {
}
func (*awsRestjson1_serializeOpDescribeAppVersionAppComponent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAppVersionAppComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAppVersionAppComponentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-app-version-app-component")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
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_serializeOpDocumentDescribeAppVersionAppComponentInput(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_serializeOpHttpBindingsDescribeAppVersionAppComponentInput(v *DescribeAppVersionAppComponentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeAppVersionAppComponentInput(v *DescribeAppVersionAppComponentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
type awsRestjson1_serializeOpDescribeAppVersionResource struct {
}
func (*awsRestjson1_serializeOpDescribeAppVersionResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAppVersionResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAppVersionResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-app-version-resource")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
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_serializeOpDocumentDescribeAppVersionResourceInput(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_serializeOpHttpBindingsDescribeAppVersionResourceInput(v *DescribeAppVersionResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeAppVersionResourceInput(v *DescribeAppVersionResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.AwsAccountId != nil {
ok := object.Key("awsAccountId")
ok.String(*v.AwsAccountId)
}
if v.AwsRegion != nil {
ok := object.Key("awsRegion")
ok.String(*v.AwsRegion)
}
if v.LogicalResourceId != nil {
ok := object.Key("logicalResourceId")
if err := awsRestjson1_serializeDocumentLogicalResourceId(v.LogicalResourceId, ok); err != nil {
return err
}
}
if v.PhysicalResourceId != nil {
ok := object.Key("physicalResourceId")
ok.String(*v.PhysicalResourceId)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
type awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus struct {
}
func (*awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAppVersionResourcesResolutionStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAppVersionResourcesResolutionStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-app-version-resources-resolution-status")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "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_serializeOpDocumentDescribeAppVersionResourcesResolutionStatusInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
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_serializeOpHttpBindingsDescribeAppVersionResourcesResolutionStatusInput(v *DescribeAppVersionResourcesResolutionStatusInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeAppVersionResourcesResolutionStatusInput(v *DescribeAppVersionResourcesResolutionStatusInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.ResolutionId != nil {
ok := object.Key("resolutionId")
ok.String(*v.ResolutionId)
}
return nil
}
type awsRestjson1_serializeOpDescribeAppVersionTemplate struct {
}
func (*awsRestjson1_serializeOpDescribeAppVersionTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAppVersionTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAppVersionTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-app-version-template")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
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_serializeOpDocumentDescribeAppVersionTemplateInput(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_serializeOpHttpBindingsDescribeAppVersionTemplateInput(v *DescribeAppVersionTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeAppVersionTemplateInput(v *DescribeAppVersionTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
return nil
}
type awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus struct {
}
func (*awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeDraftAppVersionResourcesImportStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeDraftAppVersionResourcesImportStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-draft-app-version-resources-import-status")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDescribeDraftAppVersionResourcesImportStatusInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeDraftAppVersionResourcesImportStatusInput(v *DescribeDraftAppVersionResourcesImportStatusInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeDraftAppVersionResourcesImportStatusInput(v *DescribeDraftAppVersionResourcesImportStatusInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
return nil
}
type awsRestjson1_serializeOpDescribeResiliencyPolicy struct {
}
func (*awsRestjson1_serializeOpDescribeResiliencyPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeResiliencyPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeResiliencyPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/describe-resiliency-policy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDescribeResiliencyPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeResiliencyPolicyInput(v *DescribeResiliencyPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDescribeResiliencyPolicyInput(v *DescribeResiliencyPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PolicyArn != nil {
ok := object.Key("policyArn")
ok.String(*v.PolicyArn)
}
return nil
}
type awsRestjson1_serializeOpImportResourcesToDraftAppVersion struct {
}
func (*awsRestjson1_serializeOpImportResourcesToDraftAppVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpImportResourcesToDraftAppVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ImportResourcesToDraftAppVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/import-resources-to-draft-app-version")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentImportResourcesToDraftAppVersionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsImportResourcesToDraftAppVersionInput(v *ImportResourcesToDraftAppVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentImportResourcesToDraftAppVersionInput(v *ImportResourcesToDraftAppVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.EksSources != nil {
ok := object.Key("eksSources")
if err := awsRestjson1_serializeDocumentEksSourceList(v.EksSources, ok); err != nil {
return err
}
}
if len(v.ImportStrategy) > 0 {
ok := object.Key("importStrategy")
ok.String(string(v.ImportStrategy))
}
if v.SourceArns != nil {
ok := object.Key("sourceArns")
if err := awsRestjson1_serializeDocumentArnList(v.SourceArns, ok); err != nil {
return err
}
}
if v.TerraformSources != nil {
ok := object.Key("terraformSources")
if err := awsRestjson1_serializeDocumentTerraformSourceList(v.TerraformSources, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListAlarmRecommendations struct {
}
func (*awsRestjson1_serializeOpListAlarmRecommendations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAlarmRecommendations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAlarmRecommendationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-alarm-recommendations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListAlarmRecommendationsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAlarmRecommendationsInput(v *ListAlarmRecommendationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListAlarmRecommendationsInput(v *ListAlarmRecommendationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentArn != nil {
ok := object.Key("assessmentArn")
ok.String(*v.AssessmentArn)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAppAssessments struct {
}
func (*awsRestjson1_serializeOpListAppAssessments) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAppAssessments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAppAssessmentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-app-assessments")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListAppAssessmentsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAppAssessmentsInput(v *ListAppAssessmentsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AppArn != nil {
encoder.SetQuery("appArn").String(*v.AppArn)
}
if v.AssessmentName != nil {
encoder.SetQuery("assessmentName").String(*v.AssessmentName)
}
if v.AssessmentStatus != nil {
for i := range v.AssessmentStatus {
encoder.AddQuery("assessmentStatus").String(string(v.AssessmentStatus[i]))
}
}
if len(v.ComplianceStatus) > 0 {
encoder.SetQuery("complianceStatus").String(string(v.ComplianceStatus))
}
if len(v.Invoker) > 0 {
encoder.SetQuery("invoker").String(string(v.Invoker))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.ReverseOrder != nil {
encoder.SetQuery("reverseOrder").Boolean(*v.ReverseOrder)
}
return nil
}
type awsRestjson1_serializeOpListAppComponentCompliances struct {
}
func (*awsRestjson1_serializeOpListAppComponentCompliances) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAppComponentCompliances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAppComponentCompliancesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-app-component-compliances")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListAppComponentCompliancesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAppComponentCompliancesInput(v *ListAppComponentCompliancesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListAppComponentCompliancesInput(v *ListAppComponentCompliancesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentArn != nil {
ok := object.Key("assessmentArn")
ok.String(*v.AssessmentArn)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAppComponentRecommendations struct {
}
func (*awsRestjson1_serializeOpListAppComponentRecommendations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAppComponentRecommendations) 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.(*ListAppComponentRecommendationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-app-component-recommendations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListAppComponentRecommendationsInput(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_serializeOpHttpBindingsListAppComponentRecommendationsInput(v *ListAppComponentRecommendationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListAppComponentRecommendationsInput(v *ListAppComponentRecommendationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentArn != nil {
ok := object.Key("assessmentArn")
ok.String(*v.AssessmentArn)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAppInputSources struct {
}
func (*awsRestjson1_serializeOpListAppInputSources) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAppInputSources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAppInputSourcesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-app-input-sources")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListAppInputSourcesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAppInputSourcesInput(v *ListAppInputSourcesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListAppInputSourcesInput(v *ListAppInputSourcesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListApps struct {
}
func (*awsRestjson1_serializeOpListApps) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListApps) 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.(*ListAppsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-apps")
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_serializeOpHttpBindingsListAppsInput(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_serializeOpHttpBindingsListAppsInput(v *ListAppsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AppArn != nil {
encoder.SetQuery("appArn").String(*v.AppArn)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.Name != nil {
encoder.SetQuery("name").String(*v.Name)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAppVersionAppComponents struct {
}
func (*awsRestjson1_serializeOpListAppVersionAppComponents) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAppVersionAppComponents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAppVersionAppComponentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-app-version-app-components")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListAppVersionAppComponentsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAppVersionAppComponentsInput(v *ListAppVersionAppComponentsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListAppVersionAppComponentsInput(v *ListAppVersionAppComponentsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAppVersionResourceMappings struct {
}
func (*awsRestjson1_serializeOpListAppVersionResourceMappings) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAppVersionResourceMappings) 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.(*ListAppVersionResourceMappingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-app-version-resource-mappings")
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_serializeOpDocumentListAppVersionResourceMappingsInput(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_serializeOpHttpBindingsListAppVersionResourceMappingsInput(v *ListAppVersionResourceMappingsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListAppVersionResourceMappingsInput(v *ListAppVersionResourceMappingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAppVersionResources struct {
}
func (*awsRestjson1_serializeOpListAppVersionResources) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAppVersionResources) 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.(*ListAppVersionResourcesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-app-version-resources")
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_serializeOpDocumentListAppVersionResourcesInput(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_serializeOpHttpBindingsListAppVersionResourcesInput(v *ListAppVersionResourcesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListAppVersionResourcesInput(v *ListAppVersionResourcesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.ResolutionId != nil {
ok := object.Key("resolutionId")
ok.String(*v.ResolutionId)
}
return nil
}
type awsRestjson1_serializeOpListAppVersions struct {
}
func (*awsRestjson1_serializeOpListAppVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAppVersions) 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.(*ListAppVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-app-versions")
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_serializeOpDocumentListAppVersionsInput(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_serializeOpHttpBindingsListAppVersionsInput(v *ListAppVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListAppVersionsInput(v *ListAppVersionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListRecommendationTemplates struct {
}
func (*awsRestjson1_serializeOpListRecommendationTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListRecommendationTemplates) 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.(*ListRecommendationTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-recommendation-templates")
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_serializeOpHttpBindingsListRecommendationTemplatesInput(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_serializeOpHttpBindingsListRecommendationTemplatesInput(v *ListRecommendationTemplatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssessmentArn != nil {
encoder.SetQuery("assessmentArn").String(*v.AssessmentArn)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.Name != nil {
encoder.SetQuery("name").String(*v.Name)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.RecommendationTemplateArn != nil {
encoder.SetQuery("recommendationTemplateArn").String(*v.RecommendationTemplateArn)
}
if v.ReverseOrder != nil {
encoder.SetQuery("reverseOrder").Boolean(*v.ReverseOrder)
}
if v.Status != nil {
for i := range v.Status {
encoder.AddQuery("status").String(string(v.Status[i]))
}
}
return nil
}
type awsRestjson1_serializeOpListResiliencyPolicies struct {
}
func (*awsRestjson1_serializeOpListResiliencyPolicies) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListResiliencyPolicies) 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.(*ListResiliencyPoliciesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-resiliency-policies")
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_serializeOpHttpBindingsListResiliencyPoliciesInput(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_serializeOpHttpBindingsListResiliencyPoliciesInput(v *ListResiliencyPoliciesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PolicyName != nil {
encoder.SetQuery("policyName").String(*v.PolicyName)
}
return nil
}
type awsRestjson1_serializeOpListSopRecommendations struct {
}
func (*awsRestjson1_serializeOpListSopRecommendations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSopRecommendations) 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.(*ListSopRecommendationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-sop-recommendations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListSopRecommendationsInput(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_serializeOpHttpBindingsListSopRecommendationsInput(v *ListSopRecommendationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListSopRecommendationsInput(v *ListSopRecommendationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentArn != nil {
ok := object.Key("assessmentArn")
ok.String(*v.AssessmentArn)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListSuggestedResiliencyPolicies struct {
}
func (*awsRestjson1_serializeOpListSuggestedResiliencyPolicies) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSuggestedResiliencyPolicies) 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.(*ListSuggestedResiliencyPoliciesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-suggested-resiliency-policies")
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_serializeOpHttpBindingsListSuggestedResiliencyPoliciesInput(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_serializeOpHttpBindingsListSuggestedResiliencyPoliciesInput(v *ListSuggestedResiliencyPoliciesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_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_serializeOpListTestRecommendations struct {
}
func (*awsRestjson1_serializeOpListTestRecommendations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTestRecommendations) 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.(*ListTestRecommendationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-test-recommendations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListTestRecommendationsInput(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_serializeOpHttpBindingsListTestRecommendationsInput(v *ListTestRecommendationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListTestRecommendationsInput(v *ListTestRecommendationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssessmentArn != nil {
ok := object.Key("assessmentArn")
ok.String(*v.AssessmentArn)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListUnsupportedAppVersionResources struct {
}
func (*awsRestjson1_serializeOpListUnsupportedAppVersionResources) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListUnsupportedAppVersionResources) 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.(*ListUnsupportedAppVersionResourcesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/list-unsupported-app-version-resources")
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_serializeOpDocumentListUnsupportedAppVersionResourcesInput(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_serializeOpHttpBindingsListUnsupportedAppVersionResourcesInput(v *ListUnsupportedAppVersionResourcesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListUnsupportedAppVersionResourcesInput(v *ListUnsupportedAppVersionResourcesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.ResolutionId != nil {
ok := object.Key("resolutionId")
ok.String(*v.ResolutionId)
}
return nil
}
type awsRestjson1_serializeOpPublishAppVersion struct {
}
func (*awsRestjson1_serializeOpPublishAppVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPublishAppVersion) 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.(*PublishAppVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/publish-app-version")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPublishAppVersionInput(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_serializeOpHttpBindingsPublishAppVersionInput(v *PublishAppVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPublishAppVersionInput(v *PublishAppVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
return nil
}
type awsRestjson1_serializeOpPutDraftAppVersionTemplate struct {
}
func (*awsRestjson1_serializeOpPutDraftAppVersionTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutDraftAppVersionTemplate) 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.(*PutDraftAppVersionTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/put-draft-app-version-template")
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_serializeOpDocumentPutDraftAppVersionTemplateInput(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_serializeOpHttpBindingsPutDraftAppVersionTemplateInput(v *PutDraftAppVersionTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutDraftAppVersionTemplateInput(v *PutDraftAppVersionTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppTemplateBody != nil {
ok := object.Key("appTemplateBody")
ok.String(*v.AppTemplateBody)
}
return nil
}
type awsRestjson1_serializeOpRemoveDraftAppVersionResourceMappings struct {
}
func (*awsRestjson1_serializeOpRemoveDraftAppVersionResourceMappings) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRemoveDraftAppVersionResourceMappings) 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.(*RemoveDraftAppVersionResourceMappingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/remove-draft-app-version-resource-mappings")
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_serializeOpDocumentRemoveDraftAppVersionResourceMappingsInput(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_serializeOpHttpBindingsRemoveDraftAppVersionResourceMappingsInput(v *RemoveDraftAppVersionResourceMappingsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentRemoveDraftAppVersionResourceMappingsInput(v *RemoveDraftAppVersionResourceMappingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppRegistryAppNames != nil {
ok := object.Key("appRegistryAppNames")
if err := awsRestjson1_serializeDocumentEntityNameList(v.AppRegistryAppNames, ok); err != nil {
return err
}
}
if v.EksSourceNames != nil {
ok := object.Key("eksSourceNames")
if err := awsRestjson1_serializeDocumentString255List(v.EksSourceNames, ok); err != nil {
return err
}
}
if v.LogicalStackNames != nil {
ok := object.Key("logicalStackNames")
if err := awsRestjson1_serializeDocumentString255List(v.LogicalStackNames, ok); err != nil {
return err
}
}
if v.ResourceGroupNames != nil {
ok := object.Key("resourceGroupNames")
if err := awsRestjson1_serializeDocumentEntityNameList(v.ResourceGroupNames, ok); err != nil {
return err
}
}
if v.ResourceNames != nil {
ok := object.Key("resourceNames")
if err := awsRestjson1_serializeDocumentEntityNameList(v.ResourceNames, ok); err != nil {
return err
}
}
if v.TerraformSourceNames != nil {
ok := object.Key("terraformSourceNames")
if err := awsRestjson1_serializeDocumentString255List(v.TerraformSourceNames, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpResolveAppVersionResources struct {
}
func (*awsRestjson1_serializeOpResolveAppVersionResources) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpResolveAppVersionResources) 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.(*ResolveAppVersionResourcesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/resolve-app-version-resources")
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_serializeOpDocumentResolveAppVersionResourcesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsResolveAppVersionResourcesInput(v *ResolveAppVersionResourcesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentResolveAppVersionResourcesInput(v *ResolveAppVersionResourcesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
return nil
}
type awsRestjson1_serializeOpStartAppAssessment struct {
}
func (*awsRestjson1_serializeOpStartAppAssessment) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartAppAssessment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartAppAssessmentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/start-app-assessment")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartAppAssessmentInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartAppAssessmentInput(v *StartAppAssessmentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartAppAssessmentInput(v *StartAppAssessmentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppVersion != nil {
ok := object.Key("appVersion")
ok.String(*v.AppVersion)
}
if v.AssessmentName != nil {
ok := object.Key("assessmentName")
ok.String(*v.AssessmentName)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUntagResource struct {
}
func (*awsRestjson1_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
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_serializeOpUpdateApp struct {
}
func (*awsRestjson1_serializeOpUpdateApp) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAppInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/update-app")
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_serializeOpDocumentUpdateAppInput(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_serializeOpHttpBindingsUpdateAppInput(v *UpdateAppInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAppInput(v *UpdateAppInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if len(v.AssessmentSchedule) > 0 {
ok := object.Key("assessmentSchedule")
ok.String(string(v.AssessmentSchedule))
}
if v.ClearResiliencyPolicyArn != nil {
ok := object.Key("clearResiliencyPolicyArn")
ok.Boolean(*v.ClearResiliencyPolicyArn)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.PolicyArn != nil {
ok := object.Key("policyArn")
ok.String(*v.PolicyArn)
}
return nil
}
type awsRestjson1_serializeOpUpdateAppVersion struct {
}
func (*awsRestjson1_serializeOpUpdateAppVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAppVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAppVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/update-app-version")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAppVersionInput(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_serializeOpHttpBindingsUpdateAppVersionInput(v *UpdateAppVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAppVersionInput(v *UpdateAppVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalInfo != nil {
ok := object.Key("additionalInfo")
if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil {
return err
}
}
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
return nil
}
type awsRestjson1_serializeOpUpdateAppVersionAppComponent struct {
}
func (*awsRestjson1_serializeOpUpdateAppVersionAppComponent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAppVersionAppComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAppVersionAppComponentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/update-app-version-app-component")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "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_serializeOpDocumentUpdateAppVersionAppComponentInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
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_serializeOpHttpBindingsUpdateAppVersionAppComponentInput(v *UpdateAppVersionAppComponentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAppVersionAppComponentInput(v *UpdateAppVersionAppComponentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalInfo != nil {
ok := object.Key("additionalInfo")
if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil {
return err
}
}
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
type awsRestjson1_serializeOpUpdateAppVersionResource struct {
}
func (*awsRestjson1_serializeOpUpdateAppVersionResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAppVersionResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAppVersionResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/update-app-version-resource")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAppVersionResourceInput(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_serializeOpHttpBindingsUpdateAppVersionResourceInput(v *UpdateAppVersionResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAppVersionResourceInput(v *UpdateAppVersionResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalInfo != nil {
ok := object.Key("additionalInfo")
if err := awsRestjson1_serializeDocumentAdditionalInfoMap(v.AdditionalInfo, ok); err != nil {
return err
}
}
if v.AppArn != nil {
ok := object.Key("appArn")
ok.String(*v.AppArn)
}
if v.AppComponents != nil {
ok := object.Key("appComponents")
if err := awsRestjson1_serializeDocumentAppComponentNameList(v.AppComponents, ok); err != nil {
return err
}
}
if v.AwsAccountId != nil {
ok := object.Key("awsAccountId")
ok.String(*v.AwsAccountId)
}
if v.AwsRegion != nil {
ok := object.Key("awsRegion")
ok.String(*v.AwsRegion)
}
if v.Excluded != nil {
ok := object.Key("excluded")
ok.Boolean(*v.Excluded)
}
if v.LogicalResourceId != nil {
ok := object.Key("logicalResourceId")
if err := awsRestjson1_serializeDocumentLogicalResourceId(v.LogicalResourceId, ok); err != nil {
return err
}
}
if v.PhysicalResourceId != nil {
ok := object.Key("physicalResourceId")
ok.String(*v.PhysicalResourceId)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
if v.ResourceType != nil {
ok := object.Key("resourceType")
ok.String(*v.ResourceType)
}
return nil
}
type awsRestjson1_serializeOpUpdateResiliencyPolicy struct {
}
func (*awsRestjson1_serializeOpUpdateResiliencyPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateResiliencyPolicy) 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.(*UpdateResiliencyPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/update-resiliency-policy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateResiliencyPolicyInput(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_serializeOpHttpBindingsUpdateResiliencyPolicyInput(v *UpdateResiliencyPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateResiliencyPolicyInput(v *UpdateResiliencyPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DataLocationConstraint) > 0 {
ok := object.Key("dataLocationConstraint")
ok.String(string(v.DataLocationConstraint))
}
if v.Policy != nil {
ok := object.Key("policy")
if err := awsRestjson1_serializeDocumentDisruptionPolicy(v.Policy, ok); err != nil {
return err
}
}
if v.PolicyArn != nil {
ok := object.Key("policyArn")
ok.String(*v.PolicyArn)
}
if v.PolicyDescription != nil {
ok := object.Key("policyDescription")
ok.String(*v.PolicyDescription)
}
if v.PolicyName != nil {
ok := object.Key("policyName")
ok.String(*v.PolicyName)
}
if len(v.Tier) > 0 {
ok := object.Key("tier")
ok.String(string(v.Tier))
}
return nil
}
func awsRestjson1_serializeDocumentAdditionalInfoMap(v map[string][]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentAdditionalInfoValueList(v[key], om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAdditionalInfoValueList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentAppComponentNameList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentArnList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentDisruptionPolicy(v map[string]types.FailurePolicy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentFailurePolicy(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEksNamespaceList(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_serializeDocumentEksSource(v *types.EksSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EksClusterArn != nil {
ok := object.Key("eksClusterArn")
ok.String(*v.EksClusterArn)
}
if v.Namespaces != nil {
ok := object.Key("namespaces")
if err := awsRestjson1_serializeDocumentEksNamespaceList(v.Namespaces, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEksSourceClusterNamespace(v *types.EksSourceClusterNamespace, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EksClusterArn != nil {
ok := object.Key("eksClusterArn")
ok.String(*v.EksClusterArn)
}
if v.Namespace != nil {
ok := object.Key("namespace")
ok.String(*v.Namespace)
}
return nil
}
func awsRestjson1_serializeDocumentEksSourceList(v []types.EksSource, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentEksSource(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEntityNameList(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_serializeDocumentFailurePolicy(v *types.FailurePolicy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("rpoInSecs")
ok.Integer(v.RpoInSecs)
}
{
ok := object.Key("rtoInSecs")
ok.Integer(v.RtoInSecs)
}
return nil
}
func awsRestjson1_serializeDocumentLogicalResourceId(v *types.LogicalResourceId, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EksSourceName != nil {
ok := object.Key("eksSourceName")
ok.String(*v.EksSourceName)
}
if v.Identifier != nil {
ok := object.Key("identifier")
ok.String(*v.Identifier)
}
if v.LogicalStackName != nil {
ok := object.Key("logicalStackName")
ok.String(*v.LogicalStackName)
}
if v.ResourceGroupName != nil {
ok := object.Key("resourceGroupName")
ok.String(*v.ResourceGroupName)
}
if v.TerraformSourceName != nil {
ok := object.Key("terraformSourceName")
ok.String(*v.TerraformSourceName)
}
return nil
}
func awsRestjson1_serializeDocumentPhysicalResourceId(v *types.PhysicalResourceId, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AwsAccountId != nil {
ok := object.Key("awsAccountId")
ok.String(*v.AwsAccountId)
}
if v.AwsRegion != nil {
ok := object.Key("awsRegion")
ok.String(*v.AwsRegion)
}
if v.Identifier != nil {
ok := object.Key("identifier")
ok.String(*v.Identifier)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentRecommendationIdList(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_serializeDocumentRenderRecommendationTypeList(v []types.RenderRecommendationType, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentResourceMapping(v *types.ResourceMapping, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AppRegistryAppName != nil {
ok := object.Key("appRegistryAppName")
ok.String(*v.AppRegistryAppName)
}
if v.EksSourceName != nil {
ok := object.Key("eksSourceName")
ok.String(*v.EksSourceName)
}
if v.LogicalStackName != nil {
ok := object.Key("logicalStackName")
ok.String(*v.LogicalStackName)
}
if len(v.MappingType) > 0 {
ok := object.Key("mappingType")
ok.String(string(v.MappingType))
}
if v.PhysicalResourceId != nil {
ok := object.Key("physicalResourceId")
if err := awsRestjson1_serializeDocumentPhysicalResourceId(v.PhysicalResourceId, ok); err != nil {
return err
}
}
if v.ResourceGroupName != nil {
ok := object.Key("resourceGroupName")
ok.String(*v.ResourceGroupName)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
if v.TerraformSourceName != nil {
ok := object.Key("terraformSourceName")
ok.String(*v.TerraformSourceName)
}
return nil
}
func awsRestjson1_serializeDocumentResourceMappingList(v []types.ResourceMapping, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentResourceMapping(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentString255List(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_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_serializeDocumentTerraformSource(v *types.TerraformSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3StateFileUrl != nil {
ok := object.Key("s3StateFileUrl")
ok.String(*v.S3StateFileUrl)
}
return nil
}
func awsRestjson1_serializeDocumentTerraformSourceList(v []types.TerraformSource, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentTerraformSource(&v[i], av); err != nil {
return err
}
}
return nil
}
| 4,611 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resiliencehub
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/resiliencehub/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAddDraftAppVersionResourceMappings struct {
}
func (*validateOpAddDraftAppVersionResourceMappings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddDraftAppVersionResourceMappings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddDraftAppVersionResourceMappingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddDraftAppVersionResourceMappingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateApp struct {
}
func (*validateOpCreateApp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAppInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAppInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAppVersionAppComponent struct {
}
func (*validateOpCreateAppVersionAppComponent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAppVersionAppComponentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAppVersionAppComponentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAppVersionResource struct {
}
func (*validateOpCreateAppVersionResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAppVersionResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAppVersionResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRecommendationTemplate struct {
}
func (*validateOpCreateRecommendationTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRecommendationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRecommendationTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRecommendationTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateResiliencyPolicy struct {
}
func (*validateOpCreateResiliencyPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateResiliencyPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateResiliencyPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateResiliencyPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAppAssessment struct {
}
func (*validateOpDeleteAppAssessment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAppAssessment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAppAssessmentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAppAssessmentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteApp struct {
}
func (*validateOpDeleteApp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAppInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAppInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAppInputSource struct {
}
func (*validateOpDeleteAppInputSource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAppInputSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAppInputSourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAppInputSourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAppVersionAppComponent struct {
}
func (*validateOpDeleteAppVersionAppComponent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAppVersionAppComponentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAppVersionAppComponentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAppVersionResource struct {
}
func (*validateOpDeleteAppVersionResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAppVersionResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAppVersionResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRecommendationTemplate struct {
}
func (*validateOpDeleteRecommendationTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRecommendationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRecommendationTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRecommendationTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteResiliencyPolicy struct {
}
func (*validateOpDeleteResiliencyPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteResiliencyPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteResiliencyPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteResiliencyPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAppAssessment struct {
}
func (*validateOpDescribeAppAssessment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAppAssessment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAppAssessmentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAppAssessmentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeApp struct {
}
func (*validateOpDescribeApp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAppInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAppInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAppVersionAppComponent struct {
}
func (*validateOpDescribeAppVersionAppComponent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAppVersionAppComponentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAppVersionAppComponentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAppVersion struct {
}
func (*validateOpDescribeAppVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAppVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAppVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAppVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAppVersionResource struct {
}
func (*validateOpDescribeAppVersionResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAppVersionResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAppVersionResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAppVersionResourcesResolutionStatus struct {
}
func (*validateOpDescribeAppVersionResourcesResolutionStatus) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAppVersionResourcesResolutionStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAppVersionResourcesResolutionStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAppVersionResourcesResolutionStatusInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAppVersionTemplate struct {
}
func (*validateOpDescribeAppVersionTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAppVersionTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAppVersionTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAppVersionTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeDraftAppVersionResourcesImportStatus struct {
}
func (*validateOpDescribeDraftAppVersionResourcesImportStatus) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeDraftAppVersionResourcesImportStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeDraftAppVersionResourcesImportStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeDraftAppVersionResourcesImportStatusInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeResiliencyPolicy struct {
}
func (*validateOpDescribeResiliencyPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeResiliencyPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeResiliencyPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeResiliencyPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpImportResourcesToDraftAppVersion struct {
}
func (*validateOpImportResourcesToDraftAppVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpImportResourcesToDraftAppVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ImportResourcesToDraftAppVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpImportResourcesToDraftAppVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAlarmRecommendations struct {
}
func (*validateOpListAlarmRecommendations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAlarmRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAlarmRecommendationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAlarmRecommendationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAppComponentCompliances struct {
}
func (*validateOpListAppComponentCompliances) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAppComponentCompliances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAppComponentCompliancesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAppComponentCompliancesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAppComponentRecommendations struct {
}
func (*validateOpListAppComponentRecommendations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAppComponentRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAppComponentRecommendationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAppComponentRecommendationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAppInputSources struct {
}
func (*validateOpListAppInputSources) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAppInputSources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAppInputSourcesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAppInputSourcesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAppVersionAppComponents struct {
}
func (*validateOpListAppVersionAppComponents) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAppVersionAppComponents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAppVersionAppComponentsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAppVersionAppComponentsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAppVersionResourceMappings struct {
}
func (*validateOpListAppVersionResourceMappings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAppVersionResourceMappings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAppVersionResourceMappingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAppVersionResourceMappingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAppVersionResources struct {
}
func (*validateOpListAppVersionResources) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAppVersionResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAppVersionResourcesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAppVersionResourcesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAppVersions struct {
}
func (*validateOpListAppVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAppVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAppVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAppVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListRecommendationTemplates struct {
}
func (*validateOpListRecommendationTemplates) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListRecommendationTemplates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListRecommendationTemplatesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListRecommendationTemplatesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListSopRecommendations struct {
}
func (*validateOpListSopRecommendations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListSopRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListSopRecommendationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListSopRecommendationsInput(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 validateOpListTestRecommendations struct {
}
func (*validateOpListTestRecommendations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTestRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTestRecommendationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTestRecommendationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListUnsupportedAppVersionResources struct {
}
func (*validateOpListUnsupportedAppVersionResources) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListUnsupportedAppVersionResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListUnsupportedAppVersionResourcesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListUnsupportedAppVersionResourcesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPublishAppVersion struct {
}
func (*validateOpPublishAppVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPublishAppVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PublishAppVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPublishAppVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutDraftAppVersionTemplate struct {
}
func (*validateOpPutDraftAppVersionTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutDraftAppVersionTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutDraftAppVersionTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutDraftAppVersionTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveDraftAppVersionResourceMappings struct {
}
func (*validateOpRemoveDraftAppVersionResourceMappings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveDraftAppVersionResourceMappings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveDraftAppVersionResourceMappingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveDraftAppVersionResourceMappingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpResolveAppVersionResources struct {
}
func (*validateOpResolveAppVersionResources) ID() string {
return "OperationInputValidation"
}
func (m *validateOpResolveAppVersionResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ResolveAppVersionResourcesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpResolveAppVersionResourcesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartAppAssessment struct {
}
func (*validateOpStartAppAssessment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartAppAssessment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartAppAssessmentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartAppAssessmentInput(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 validateOpUpdateApp struct {
}
func (*validateOpUpdateApp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAppInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAppInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateAppVersionAppComponent struct {
}
func (*validateOpUpdateAppVersionAppComponent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAppVersionAppComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAppVersionAppComponentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAppVersionAppComponentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateAppVersion struct {
}
func (*validateOpUpdateAppVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAppVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAppVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAppVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateAppVersionResource struct {
}
func (*validateOpUpdateAppVersionResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAppVersionResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAppVersionResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAppVersionResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateResiliencyPolicy struct {
}
func (*validateOpUpdateResiliencyPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateResiliencyPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateResiliencyPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateResiliencyPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAddDraftAppVersionResourceMappingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddDraftAppVersionResourceMappings{}, middleware.After)
}
func addOpCreateAppValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateApp{}, middleware.After)
}
func addOpCreateAppVersionAppComponentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAppVersionAppComponent{}, middleware.After)
}
func addOpCreateAppVersionResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAppVersionResource{}, middleware.After)
}
func addOpCreateRecommendationTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRecommendationTemplate{}, middleware.After)
}
func addOpCreateResiliencyPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateResiliencyPolicy{}, middleware.After)
}
func addOpDeleteAppAssessmentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAppAssessment{}, middleware.After)
}
func addOpDeleteAppValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteApp{}, middleware.After)
}
func addOpDeleteAppInputSourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAppInputSource{}, middleware.After)
}
func addOpDeleteAppVersionAppComponentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAppVersionAppComponent{}, middleware.After)
}
func addOpDeleteAppVersionResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAppVersionResource{}, middleware.After)
}
func addOpDeleteRecommendationTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRecommendationTemplate{}, middleware.After)
}
func addOpDeleteResiliencyPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteResiliencyPolicy{}, middleware.After)
}
func addOpDescribeAppAssessmentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAppAssessment{}, middleware.After)
}
func addOpDescribeAppValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeApp{}, middleware.After)
}
func addOpDescribeAppVersionAppComponentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAppVersionAppComponent{}, middleware.After)
}
func addOpDescribeAppVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAppVersion{}, middleware.After)
}
func addOpDescribeAppVersionResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAppVersionResource{}, middleware.After)
}
func addOpDescribeAppVersionResourcesResolutionStatusValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAppVersionResourcesResolutionStatus{}, middleware.After)
}
func addOpDescribeAppVersionTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAppVersionTemplate{}, middleware.After)
}
func addOpDescribeDraftAppVersionResourcesImportStatusValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeDraftAppVersionResourcesImportStatus{}, middleware.After)
}
func addOpDescribeResiliencyPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeResiliencyPolicy{}, middleware.After)
}
func addOpImportResourcesToDraftAppVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpImportResourcesToDraftAppVersion{}, middleware.After)
}
func addOpListAlarmRecommendationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAlarmRecommendations{}, middleware.After)
}
func addOpListAppComponentCompliancesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAppComponentCompliances{}, middleware.After)
}
func addOpListAppComponentRecommendationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAppComponentRecommendations{}, middleware.After)
}
func addOpListAppInputSourcesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAppInputSources{}, middleware.After)
}
func addOpListAppVersionAppComponentsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAppVersionAppComponents{}, middleware.After)
}
func addOpListAppVersionResourceMappingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAppVersionResourceMappings{}, middleware.After)
}
func addOpListAppVersionResourcesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAppVersionResources{}, middleware.After)
}
func addOpListAppVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAppVersions{}, middleware.After)
}
func addOpListRecommendationTemplatesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListRecommendationTemplates{}, middleware.After)
}
func addOpListSopRecommendationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListSopRecommendations{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpListTestRecommendationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTestRecommendations{}, middleware.After)
}
func addOpListUnsupportedAppVersionResourcesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListUnsupportedAppVersionResources{}, middleware.After)
}
func addOpPublishAppVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPublishAppVersion{}, middleware.After)
}
func addOpPutDraftAppVersionTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutDraftAppVersionTemplate{}, middleware.After)
}
func addOpRemoveDraftAppVersionResourceMappingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveDraftAppVersionResourceMappings{}, middleware.After)
}
func addOpResolveAppVersionResourcesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpResolveAppVersionResources{}, middleware.After)
}
func addOpStartAppAssessmentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartAppAssessment{}, 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 addOpUpdateAppValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateApp{}, middleware.After)
}
func addOpUpdateAppVersionAppComponentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAppVersionAppComponent{}, middleware.After)
}
func addOpUpdateAppVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAppVersion{}, middleware.After)
}
func addOpUpdateAppVersionResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAppVersionResource{}, middleware.After)
}
func addOpUpdateResiliencyPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateResiliencyPolicy{}, middleware.After)
}
func validateDisruptionPolicy(v map[string]types.FailurePolicy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisruptionPolicy"}
for key := range v {
value := v[key]
if err := validateFailurePolicy(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEksSource(v *types.EksSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EksSource"}
if v.EksClusterArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("EksClusterArn"))
}
if v.Namespaces == nil {
invalidParams.Add(smithy.NewErrParamRequired("Namespaces"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEksSourceClusterNamespace(v *types.EksSourceClusterNamespace) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EksSourceClusterNamespace"}
if v.EksClusterArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("EksClusterArn"))
}
if v.Namespace == nil {
invalidParams.Add(smithy.NewErrParamRequired("Namespace"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEksSourceList(v []types.EksSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EksSourceList"}
for i := range v {
if err := validateEksSource(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFailurePolicy(v *types.FailurePolicy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FailurePolicy"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLogicalResourceId(v *types.LogicalResourceId) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LogicalResourceId"}
if v.Identifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Identifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePhysicalResourceId(v *types.PhysicalResourceId) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PhysicalResourceId"}
if v.Identifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Identifier"))
}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResourceMapping(v *types.ResourceMapping) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResourceMapping"}
if len(v.MappingType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MappingType"))
}
if v.PhysicalResourceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PhysicalResourceId"))
} else if v.PhysicalResourceId != nil {
if err := validatePhysicalResourceId(v.PhysicalResourceId); err != nil {
invalidParams.AddNested("PhysicalResourceId", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResourceMappingList(v []types.ResourceMapping) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResourceMappingList"}
for i := range v {
if err := validateResourceMapping(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTerraformSource(v *types.TerraformSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TerraformSource"}
if v.S3StateFileUrl == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3StateFileUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTerraformSourceList(v []types.TerraformSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TerraformSourceList"}
for i := range v {
if err := validateTerraformSource(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddDraftAppVersionResourceMappingsInput(v *AddDraftAppVersionResourceMappingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddDraftAppVersionResourceMappingsInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.ResourceMappings == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceMappings"))
} else if v.ResourceMappings != nil {
if err := validateResourceMappingList(v.ResourceMappings); err != nil {
invalidParams.AddNested("ResourceMappings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAppInput(v *CreateAppInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAppInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAppVersionAppComponentInput(v *CreateAppVersionAppComponentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAppVersionAppComponentInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAppVersionResourceInput(v *CreateAppVersionResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAppVersionResourceInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.LogicalResourceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogicalResourceId"))
} else if v.LogicalResourceId != nil {
if err := validateLogicalResourceId(v.LogicalResourceId); err != nil {
invalidParams.AddNested("LogicalResourceId", err.(smithy.InvalidParamsError))
}
}
if v.PhysicalResourceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PhysicalResourceId"))
}
if v.ResourceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
}
if v.AppComponents == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppComponents"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRecommendationTemplateInput(v *CreateRecommendationTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRecommendationTemplateInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateResiliencyPolicyInput(v *CreateResiliencyPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateResiliencyPolicyInput"}
if v.PolicyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyName"))
}
if len(v.Tier) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Tier"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
} else if v.Policy != nil {
if err := validateDisruptionPolicy(v.Policy); err != nil {
invalidParams.AddNested("Policy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAppAssessmentInput(v *DeleteAppAssessmentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAppAssessmentInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAppInput(v *DeleteAppInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAppInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAppInputSourceInput(v *DeleteAppInputSourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAppInputSourceInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.TerraformSource != nil {
if err := validateTerraformSource(v.TerraformSource); err != nil {
invalidParams.AddNested("TerraformSource", err.(smithy.InvalidParamsError))
}
}
if v.EksSourceClusterNamespace != nil {
if err := validateEksSourceClusterNamespace(v.EksSourceClusterNamespace); err != nil {
invalidParams.AddNested("EksSourceClusterNamespace", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAppVersionAppComponentInput(v *DeleteAppVersionAppComponentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAppVersionAppComponentInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAppVersionResourceInput(v *DeleteAppVersionResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAppVersionResourceInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.LogicalResourceId != nil {
if err := validateLogicalResourceId(v.LogicalResourceId); err != nil {
invalidParams.AddNested("LogicalResourceId", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRecommendationTemplateInput(v *DeleteRecommendationTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRecommendationTemplateInput"}
if v.RecommendationTemplateArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RecommendationTemplateArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteResiliencyPolicyInput(v *DeleteResiliencyPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteResiliencyPolicyInput"}
if v.PolicyArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAppAssessmentInput(v *DescribeAppAssessmentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAppAssessmentInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAppInput(v *DescribeAppInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAppInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAppVersionAppComponentInput(v *DescribeAppVersionAppComponentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAppVersionAppComponentInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAppVersionInput(v *DescribeAppVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAppVersionInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAppVersionResourceInput(v *DescribeAppVersionResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAppVersionResourceInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if v.LogicalResourceId != nil {
if err := validateLogicalResourceId(v.LogicalResourceId); err != nil {
invalidParams.AddNested("LogicalResourceId", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAppVersionResourcesResolutionStatusInput(v *DescribeAppVersionResourcesResolutionStatusInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAppVersionResourcesResolutionStatusInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAppVersionTemplateInput(v *DescribeAppVersionTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAppVersionTemplateInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeDraftAppVersionResourcesImportStatusInput(v *DescribeDraftAppVersionResourcesImportStatusInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeDraftAppVersionResourcesImportStatusInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeResiliencyPolicyInput(v *DescribeResiliencyPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeResiliencyPolicyInput"}
if v.PolicyArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpImportResourcesToDraftAppVersionInput(v *ImportResourcesToDraftAppVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportResourcesToDraftAppVersionInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.TerraformSources != nil {
if err := validateTerraformSourceList(v.TerraformSources); err != nil {
invalidParams.AddNested("TerraformSources", err.(smithy.InvalidParamsError))
}
}
if v.EksSources != nil {
if err := validateEksSourceList(v.EksSources); err != nil {
invalidParams.AddNested("EksSources", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAlarmRecommendationsInput(v *ListAlarmRecommendationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAlarmRecommendationsInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAppComponentCompliancesInput(v *ListAppComponentCompliancesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAppComponentCompliancesInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAppComponentRecommendationsInput(v *ListAppComponentRecommendationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAppComponentRecommendationsInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAppInputSourcesInput(v *ListAppInputSourcesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAppInputSourcesInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAppVersionAppComponentsInput(v *ListAppVersionAppComponentsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAppVersionAppComponentsInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAppVersionResourceMappingsInput(v *ListAppVersionResourceMappingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAppVersionResourceMappingsInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAppVersionResourcesInput(v *ListAppVersionResourcesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAppVersionResourcesInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAppVersionsInput(v *ListAppVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAppVersionsInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListRecommendationTemplatesInput(v *ListRecommendationTemplatesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListRecommendationTemplatesInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListSopRecommendationsInput(v *ListSopRecommendationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListSopRecommendationsInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
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 validateOpListTestRecommendationsInput(v *ListTestRecommendationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTestRecommendationsInput"}
if v.AssessmentArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListUnsupportedAppVersionResourcesInput(v *ListUnsupportedAppVersionResourcesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListUnsupportedAppVersionResourcesInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPublishAppVersionInput(v *PublishAppVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PublishAppVersionInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutDraftAppVersionTemplateInput(v *PutDraftAppVersionTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutDraftAppVersionTemplateInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppTemplateBody == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppTemplateBody"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveDraftAppVersionResourceMappingsInput(v *RemoveDraftAppVersionResourceMappingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveDraftAppVersionResourceMappingsInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpResolveAppVersionResourcesInput(v *ResolveAppVersionResourcesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResolveAppVersionResourcesInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartAppAssessmentInput(v *StartAppAssessmentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartAppAssessmentInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.AppVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppVersion"))
}
if v.AssessmentName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssessmentName"))
}
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 validateOpUpdateAppInput(v *UpdateAppInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAppInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAppVersionAppComponentInput(v *UpdateAppVersionAppComponentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAppVersionAppComponentInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAppVersionInput(v *UpdateAppVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAppVersionInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAppVersionResourceInput(v *UpdateAppVersionResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAppVersionResourceInput"}
if v.AppArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AppArn"))
}
if v.LogicalResourceId != nil {
if err := validateLogicalResourceId(v.LogicalResourceId); err != nil {
invalidParams.AddNested("LogicalResourceId", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateResiliencyPolicyInput(v *UpdateResiliencyPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateResiliencyPolicyInput"}
if v.PolicyArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyArn"))
}
if v.Policy != nil {
if err := validateDisruptionPolicy(v.Policy); err != nil {
invalidParams.AddNested("Policy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 2,210 |
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 resiliencehub 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: "resiliencehub.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "resiliencehub-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "resiliencehub-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "resiliencehub.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
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-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "resiliencehub.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "resiliencehub-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "resiliencehub-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "resiliencehub.{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: "resiliencehub-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "resiliencehub.{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: "resiliencehub-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "resiliencehub.{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: "resiliencehub-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "resiliencehub.{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: "resiliencehub-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "resiliencehub.{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: "resiliencehub.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "resiliencehub-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "resiliencehub-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "resiliencehub.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 359 |
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 AlarmType string
// Enum values for AlarmType
const (
AlarmTypeMetric AlarmType = "Metric"
AlarmTypeComposite AlarmType = "Composite"
AlarmTypeCanary AlarmType = "Canary"
AlarmTypeLogs AlarmType = "Logs"
AlarmTypeEvent AlarmType = "Event"
)
// Values returns all known values for AlarmType. 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 (AlarmType) Values() []AlarmType {
return []AlarmType{
"Metric",
"Composite",
"Canary",
"Logs",
"Event",
}
}
type AppAssessmentScheduleType string
// Enum values for AppAssessmentScheduleType
const (
AppAssessmentScheduleTypeDisabled AppAssessmentScheduleType = "Disabled"
AppAssessmentScheduleTypeDaily AppAssessmentScheduleType = "Daily"
)
// Values returns all known values for AppAssessmentScheduleType. 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 (AppAssessmentScheduleType) Values() []AppAssessmentScheduleType {
return []AppAssessmentScheduleType{
"Disabled",
"Daily",
}
}
type AppComplianceStatusType string
// Enum values for AppComplianceStatusType
const (
AppComplianceStatusTypePolicyBreached AppComplianceStatusType = "PolicyBreached"
AppComplianceStatusTypePolicyMet AppComplianceStatusType = "PolicyMet"
AppComplianceStatusTypeNotAssessed AppComplianceStatusType = "NotAssessed"
AppComplianceStatusTypeChangesDetected AppComplianceStatusType = "ChangesDetected"
)
// Values returns all known values for AppComplianceStatusType. 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 (AppComplianceStatusType) Values() []AppComplianceStatusType {
return []AppComplianceStatusType{
"PolicyBreached",
"PolicyMet",
"NotAssessed",
"ChangesDetected",
}
}
type AppStatusType string
// Enum values for AppStatusType
const (
AppStatusTypeActive AppStatusType = "Active"
AppStatusTypeDeleting AppStatusType = "Deleting"
)
// Values returns all known values for AppStatusType. 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 (AppStatusType) Values() []AppStatusType {
return []AppStatusType{
"Active",
"Deleting",
}
}
type AssessmentInvoker string
// Enum values for AssessmentInvoker
const (
AssessmentInvokerUser AssessmentInvoker = "User"
AssessmentInvokerSystem AssessmentInvoker = "System"
)
// Values returns all known values for AssessmentInvoker. 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 (AssessmentInvoker) Values() []AssessmentInvoker {
return []AssessmentInvoker{
"User",
"System",
}
}
type AssessmentStatus string
// Enum values for AssessmentStatus
const (
AssessmentStatusPending AssessmentStatus = "Pending"
AssessmentStatusInprogress AssessmentStatus = "InProgress"
AssessmentStatusFailed AssessmentStatus = "Failed"
AssessmentStatusSuccess AssessmentStatus = "Success"
)
// Values returns all known values for AssessmentStatus. 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 (AssessmentStatus) Values() []AssessmentStatus {
return []AssessmentStatus{
"Pending",
"InProgress",
"Failed",
"Success",
}
}
type ComplianceStatus string
// Enum values for ComplianceStatus
const (
ComplianceStatusPolicyBreached ComplianceStatus = "PolicyBreached"
ComplianceStatusPolicyMet ComplianceStatus = "PolicyMet"
)
// Values returns all known values for ComplianceStatus. 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 (ComplianceStatus) Values() []ComplianceStatus {
return []ComplianceStatus{
"PolicyBreached",
"PolicyMet",
}
}
type ConfigRecommendationOptimizationType string
// Enum values for ConfigRecommendationOptimizationType
const (
ConfigRecommendationOptimizationTypeLeastCost ConfigRecommendationOptimizationType = "LeastCost"
ConfigRecommendationOptimizationTypeLeastChange ConfigRecommendationOptimizationType = "LeastChange"
ConfigRecommendationOptimizationTypeBestAzRecovery ConfigRecommendationOptimizationType = "BestAZRecovery"
ConfigRecommendationOptimizationTypeLeastErrors ConfigRecommendationOptimizationType = "LeastErrors"
ConfigRecommendationOptimizationTypeBestAttainable ConfigRecommendationOptimizationType = "BestAttainable"
ConfigRecommendationOptimizationTypeBestRegionRecovery ConfigRecommendationOptimizationType = "BestRegionRecovery"
)
// Values returns all known values for ConfigRecommendationOptimizationType. 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 (ConfigRecommendationOptimizationType) Values() []ConfigRecommendationOptimizationType {
return []ConfigRecommendationOptimizationType{
"LeastCost",
"LeastChange",
"BestAZRecovery",
"LeastErrors",
"BestAttainable",
"BestRegionRecovery",
}
}
type CostFrequency string
// Enum values for CostFrequency
const (
CostFrequencyHourly CostFrequency = "Hourly"
CostFrequencyDaily CostFrequency = "Daily"
CostFrequencyMonthly CostFrequency = "Monthly"
CostFrequencyYearly CostFrequency = "Yearly"
)
// Values returns all known values for CostFrequency. 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 (CostFrequency) Values() []CostFrequency {
return []CostFrequency{
"Hourly",
"Daily",
"Monthly",
"Yearly",
}
}
type DataLocationConstraint string
// Enum values for DataLocationConstraint
const (
DataLocationConstraintAnyLocation DataLocationConstraint = "AnyLocation"
DataLocationConstraintSameContinent DataLocationConstraint = "SameContinent"
DataLocationConstraintSameCountry DataLocationConstraint = "SameCountry"
)
// Values returns all known values for DataLocationConstraint. 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 (DataLocationConstraint) Values() []DataLocationConstraint {
return []DataLocationConstraint{
"AnyLocation",
"SameContinent",
"SameCountry",
}
}
type DisruptionType string
// Enum values for DisruptionType
const (
DisruptionTypeSoftware DisruptionType = "Software"
DisruptionTypeHardware DisruptionType = "Hardware"
DisruptionTypeAz DisruptionType = "AZ"
DisruptionTypeRegion DisruptionType = "Region"
)
// Values returns all known values for DisruptionType. 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 (DisruptionType) Values() []DisruptionType {
return []DisruptionType{
"Software",
"Hardware",
"AZ",
"Region",
}
}
type EstimatedCostTier string
// Enum values for EstimatedCostTier
const (
EstimatedCostTierL1 EstimatedCostTier = "L1"
EstimatedCostTierL2 EstimatedCostTier = "L2"
EstimatedCostTierL3 EstimatedCostTier = "L3"
EstimatedCostTierL4 EstimatedCostTier = "L4"
)
// Values returns all known values for EstimatedCostTier. 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 (EstimatedCostTier) Values() []EstimatedCostTier {
return []EstimatedCostTier{
"L1",
"L2",
"L3",
"L4",
}
}
type HaArchitecture string
// Enum values for HaArchitecture
const (
HaArchitectureMultiSite HaArchitecture = "MultiSite"
HaArchitectureWarmStandby HaArchitecture = "WarmStandby"
HaArchitecturePilotLight HaArchitecture = "PilotLight"
HaArchitectureBackupAndRestore HaArchitecture = "BackupAndRestore"
HaArchitectureNoRecoveryPlan HaArchitecture = "NoRecoveryPlan"
)
// Values returns all known values for HaArchitecture. 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 (HaArchitecture) Values() []HaArchitecture {
return []HaArchitecture{
"MultiSite",
"WarmStandby",
"PilotLight",
"BackupAndRestore",
"NoRecoveryPlan",
}
}
type PhysicalIdentifierType string
// Enum values for PhysicalIdentifierType
const (
PhysicalIdentifierTypeArn PhysicalIdentifierType = "Arn"
PhysicalIdentifierTypeNative PhysicalIdentifierType = "Native"
)
// Values returns all known values for PhysicalIdentifierType. 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 (PhysicalIdentifierType) Values() []PhysicalIdentifierType {
return []PhysicalIdentifierType{
"Arn",
"Native",
}
}
type RecommendationComplianceStatus string
// Enum values for RecommendationComplianceStatus
const (
RecommendationComplianceStatusBreachedUnattainable RecommendationComplianceStatus = "BreachedUnattainable"
RecommendationComplianceStatusBreachedCanMeet RecommendationComplianceStatus = "BreachedCanMeet"
RecommendationComplianceStatusMetCanImprove RecommendationComplianceStatus = "MetCanImprove"
)
// Values returns all known values for RecommendationComplianceStatus. 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 (RecommendationComplianceStatus) Values() []RecommendationComplianceStatus {
return []RecommendationComplianceStatus{
"BreachedUnattainable",
"BreachedCanMeet",
"MetCanImprove",
}
}
type RecommendationTemplateStatus string
// Enum values for RecommendationTemplateStatus
const (
RecommendationTemplateStatusPending RecommendationTemplateStatus = "Pending"
RecommendationTemplateStatusInProgress RecommendationTemplateStatus = "InProgress"
RecommendationTemplateStatusFailed RecommendationTemplateStatus = "Failed"
RecommendationTemplateStatusSuccess RecommendationTemplateStatus = "Success"
)
// Values returns all known values for RecommendationTemplateStatus. 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 (RecommendationTemplateStatus) Values() []RecommendationTemplateStatus {
return []RecommendationTemplateStatus{
"Pending",
"InProgress",
"Failed",
"Success",
}
}
type RenderRecommendationType string
// Enum values for RenderRecommendationType
const (
RenderRecommendationTypeAlarm RenderRecommendationType = "Alarm"
RenderRecommendationTypeSop RenderRecommendationType = "Sop"
RenderRecommendationTypeTest RenderRecommendationType = "Test"
)
// Values returns all known values for RenderRecommendationType. 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 (RenderRecommendationType) Values() []RenderRecommendationType {
return []RenderRecommendationType{
"Alarm",
"Sop",
"Test",
}
}
type ResiliencyPolicyTier string
// Enum values for ResiliencyPolicyTier
const (
ResiliencyPolicyTierMissionCritical ResiliencyPolicyTier = "MissionCritical"
ResiliencyPolicyTierCritical ResiliencyPolicyTier = "Critical"
ResiliencyPolicyTierImportant ResiliencyPolicyTier = "Important"
ResiliencyPolicyTierCoreServices ResiliencyPolicyTier = "CoreServices"
ResiliencyPolicyTierNonCritical ResiliencyPolicyTier = "NonCritical"
)
// Values returns all known values for ResiliencyPolicyTier. 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 (ResiliencyPolicyTier) Values() []ResiliencyPolicyTier {
return []ResiliencyPolicyTier{
"MissionCritical",
"Critical",
"Important",
"CoreServices",
"NonCritical",
}
}
type ResourceImportStatusType string
// Enum values for ResourceImportStatusType
const (
ResourceImportStatusTypePending ResourceImportStatusType = "Pending"
ResourceImportStatusTypeInProgress ResourceImportStatusType = "InProgress"
ResourceImportStatusTypeFailed ResourceImportStatusType = "Failed"
ResourceImportStatusTypeSuccess ResourceImportStatusType = "Success"
)
// Values returns all known values for ResourceImportStatusType. 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 (ResourceImportStatusType) Values() []ResourceImportStatusType {
return []ResourceImportStatusType{
"Pending",
"InProgress",
"Failed",
"Success",
}
}
type ResourceImportStrategyType string
// Enum values for ResourceImportStrategyType
const (
ResourceImportStrategyTypeAddOnly ResourceImportStrategyType = "AddOnly"
ResourceImportStrategyTypeReplaceAll ResourceImportStrategyType = "ReplaceAll"
)
// Values returns all known values for ResourceImportStrategyType. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (ResourceImportStrategyType) Values() []ResourceImportStrategyType {
return []ResourceImportStrategyType{
"AddOnly",
"ReplaceAll",
}
}
type ResourceMappingType string
// Enum values for ResourceMappingType
const (
ResourceMappingTypeCfnStack ResourceMappingType = "CfnStack"
ResourceMappingTypeResource ResourceMappingType = "Resource"
ResourceMappingTypeAppRegistryApp ResourceMappingType = "AppRegistryApp"
ResourceMappingTypeResourceGroup ResourceMappingType = "ResourceGroup"
ResourceMappingTypeTerraform ResourceMappingType = "Terraform"
ResourceMappingTypeEks ResourceMappingType = "EKS"
)
// Values returns all known values for ResourceMappingType. 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 (ResourceMappingType) Values() []ResourceMappingType {
return []ResourceMappingType{
"CfnStack",
"Resource",
"AppRegistryApp",
"ResourceGroup",
"Terraform",
"EKS",
}
}
type ResourceResolutionStatusType string
// Enum values for ResourceResolutionStatusType
const (
ResourceResolutionStatusTypePending ResourceResolutionStatusType = "Pending"
ResourceResolutionStatusTypeInProgress ResourceResolutionStatusType = "InProgress"
ResourceResolutionStatusTypeFailed ResourceResolutionStatusType = "Failed"
ResourceResolutionStatusTypeSuccess ResourceResolutionStatusType = "Success"
)
// Values returns all known values for ResourceResolutionStatusType. 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 (ResourceResolutionStatusType) Values() []ResourceResolutionStatusType {
return []ResourceResolutionStatusType{
"Pending",
"InProgress",
"Failed",
"Success",
}
}
type ResourceSourceType string
// Enum values for ResourceSourceType
const (
ResourceSourceTypeAppTemplate ResourceSourceType = "AppTemplate"
ResourceSourceTypeDiscovered ResourceSourceType = "Discovered"
)
// Values returns all known values for ResourceSourceType. 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 (ResourceSourceType) Values() []ResourceSourceType {
return []ResourceSourceType{
"AppTemplate",
"Discovered",
}
}
type SopServiceType string
// Enum values for SopServiceType
const (
SopServiceTypeSsm SopServiceType = "SSM"
)
// Values returns all known values for SopServiceType. 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 (SopServiceType) Values() []SopServiceType {
return []SopServiceType{
"SSM",
}
}
type TemplateFormat string
// Enum values for TemplateFormat
const (
TemplateFormatCfnYaml TemplateFormat = "CfnYaml"
TemplateFormatCfnJson TemplateFormat = "CfnJson"
)
// Values returns all known values for TemplateFormat. 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 (TemplateFormat) Values() []TemplateFormat {
return []TemplateFormat{
"CfnYaml",
"CfnJson",
}
}
type TestRisk string
// Enum values for TestRisk
const (
TestRiskSmall TestRisk = "Small"
TestRiskMedium TestRisk = "Medium"
TestRiskHigh TestRisk = "High"
)
// Values returns all known values for TestRisk. 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 (TestRisk) Values() []TestRisk {
return []TestRisk{
"Small",
"Medium",
"High",
}
}
type TestType string
// Enum values for TestType
const (
TestTypeSoftware TestType = "Software"
TestTypeHardware TestType = "Hardware"
TestTypeAz TestType = "AZ"
TestTypeRegion TestType = "Region"
)
// Values returns all known values for TestType. 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 (TestType) Values() []TestType {
return []TestType{
"Software",
"Hardware",
"AZ",
"Region",
}
}
| 570 |
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 don't have permissions to perform the requested operation. The user or role
// that is making the request must have at least one IAM permissions policy
// attached that grants the required permissions.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// This exception occurs when a conflict with a previous successful write is
// detected. This generally occurs when the previous write did not have time to
// propagate to the host serving the current request. A retry (with appropriate
// backoff logic) is the recommended response to this exception.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
ResourceId *string
ResourceType *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// This exception occurs when there is an internal failure in the Resilience Hub
// service.
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// This exception occurs when the specified resource could not be found.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
ResourceId *string
ResourceType *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 occurs when you have exceeded your service quota. To perform the
// requested action, remove some of the relevant resources, or use Service Quotas
// to request a service quota increase.
type ServiceQuotaExceededException struct {
Message *string
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 }
// This exception occurs when you have exceeded the limit on the number of
// requests per second.
type ThrottlingException struct {
Message *string
ErrorCodeOverride *string
RetryAfterSeconds *int32
noSmithyDocumentSerde
}
func (e *ThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// This exception occurs when a request is not valid.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ValidationException"
}
return *e.ErrorCodeOverride
}
func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 208 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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 = "Resource Explorer 2"
const ServiceAPIVersion = "2022-07-28"
// Client provides the API client to make operations call for AWS Resource
// Explorer.
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, "resourceexplorer2", 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)
}
| 455 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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 resourceexplorer2
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"
)
// Sets the specified view as the default for the Amazon Web Services Region in
// which you call this operation. When a user performs a Search that doesn't
// explicitly specify which view to use, then Amazon Web Services Resource Explorer
// automatically chooses this default view for searches performed in this Amazon
// Web Services Region. If an Amazon Web Services Region doesn't have a default
// view configured, then users must explicitly specify a view with every Search
// operation performed in that Region.
func (c *Client) AssociateDefaultView(ctx context.Context, params *AssociateDefaultViewInput, optFns ...func(*Options)) (*AssociateDefaultViewOutput, error) {
if params == nil {
params = &AssociateDefaultViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateDefaultView", params, optFns, c.addOperationAssociateDefaultViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateDefaultViewOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateDefaultViewInput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view to set as the default for the Amazon Web Services Region and Amazon
// Web Services account in which you call this operation. The specified view must
// already exist in the called Region.
//
// This member is required.
ViewArn *string
noSmithyDocumentSerde
}
type AssociateDefaultViewOutput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view that the operation set as the default for queries made in the Amazon
// Web Services Region and Amazon Web Services account in which you called this
// operation.
ViewArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateDefaultViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateDefaultView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateDefaultView{}, 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 = addOpAssociateDefaultViewValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateDefaultView(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_opAssociateDefaultView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "AssociateDefaultView",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves details about a list of views.
func (c *Client) BatchGetView(ctx context.Context, params *BatchGetViewInput, optFns ...func(*Options)) (*BatchGetViewOutput, error) {
if params == nil {
params = &BatchGetViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchGetView", params, optFns, c.addOperationBatchGetViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchGetViewOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchGetViewInput struct {
// A list of Amazon resource names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// that identify the views you want details for.
ViewArns []string
noSmithyDocumentSerde
}
type BatchGetViewOutput struct {
// If any of the specified ARNs result in an error, then this structure describes
// the error.
Errors []types.BatchGetViewError
// A structure with a list of objects with details for each of the specified views.
Views []types.View
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchGetViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetView{}, 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_opBatchGetView(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_opBatchGetView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "BatchGetView",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Turns on Amazon Web Services Resource Explorer in the Amazon Web Services
// Region in which you called this operation by creating an index. Resource
// Explorer begins discovering the resources in this Region and stores the details
// about the resources in the index so that they can be queried by using the Search
// operation. You can create only one index in a Region. This operation creates
// only a local index. To promote the local index in one Amazon Web Services Region
// into the aggregator index for the Amazon Web Services account, use the
// UpdateIndexType operation. For more information, see Turning on cross-Region
// search by creating an aggregator index (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html)
// in the Amazon Web Services Resource Explorer User Guide. For more details about
// what happens when you turn on Resource Explorer in an Amazon Web Services
// Region, see Turn on Resource Explorer to index your resources in an Amazon Web
// Services Region (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-service-activate.html)
// in the Amazon Web Services Resource Explorer User Guide. If this is the first
// Amazon Web Services Region in which you've created an index for Resource
// Explorer, then this operation also creates a service-linked role (https://docs.aws.amazon.com/resource-explorer/latest/userguide/security_iam_service-linked-roles.html)
// in your Amazon Web Services account that allows Resource Explorer to enumerate
// your resources to populate the index.
// - Action: resource-explorer-2:CreateIndex Resource: The ARN of the index (as
// it will exist after the operation completes) in the Amazon Web Services Region
// and account in which you're trying to create the index. Use the wildcard
// character ( * ) at the end of the string to match the eventual UUID. For
// example, the following Resource element restricts the role or user to creating
// an index in only the us-east-2 Region of the specified account. "Resource":
// "arn:aws:resource-explorer-2:us-west-2:<account-id>:index/*" Alternatively,
// you can use "Resource": "*" to allow the role or user to create an index in
// any Region.
// - Action: iam:CreateServiceLinkedRole Resource: No specific resource (*). This
// permission is required only the first time you create an index to turn on
// Resource Explorer in the account. Resource Explorer uses this to create the
// service-linked role needed to index the resources in your account (https://docs.aws.amazon.com/resource-explorer/latest/userguide/security_iam_service-linked-roles.html)
// . Resource Explorer uses the same service-linked role for all additional indexes
// you create afterwards.
func (c *Client) CreateIndex(ctx context.Context, params *CreateIndexInput, optFns ...func(*Options)) (*CreateIndexOutput, error) {
if params == nil {
params = &CreateIndexInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateIndex", params, optFns, c.addOperationCreateIndexMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateIndexOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateIndexInput struct {
// This value helps ensure idempotency. Resource Explorer uses this value to
// prevent the accidental creation of duplicate versions. We recommend that you
// generate a UUID-type value (https://wikipedia.org/wiki/Universally_unique_identifier)
// to ensure the uniqueness of your views.
ClientToken *string
// The specified tags are attached only to the index created in this Amazon Web
// Services Region. The tags aren't attached to any of the resources listed in the
// index.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateIndexOutput struct {
// The ARN of the new local index for the Region. You can reference this ARN in
// IAM permission policies to authorize the following operations: DeleteIndex |
// GetIndex | UpdateIndexType | CreateView
Arn *string
// The date and timestamp when the index was created.
CreatedAt *time.Time
// Indicates the current state of the index. You can check for changes to the
// state for asynchronous operations by calling the GetIndex operation. The state
// can remain in the CREATING or UPDATING state for several hours as Resource
// Explorer discovers the information about your resources and populates the index.
State types.IndexState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateIndexMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateIndex{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateIndex{}, 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_opCreateIndexMiddleware(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIndex(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_initializeOpCreateIndex struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateIndex) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateIndex) 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.(*CreateIndexInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIndexInput ")
}
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_opCreateIndexMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIndex{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateIndex(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "CreateIndex",
}
}
| 209 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a view that users can query by using the Search operation. Results from
// queries that you make using this view include only resources that match the
// view's Filters . For more information about Amazon Web Services Resource
// Explorer views, see Managing views (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views.html)
// in the Amazon Web Services Resource Explorer User Guide. Only the principals
// with an IAM identity-based policy that grants Allow to the Search action on a
// Resource with the Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of this view can Search using views you create with this operation.
func (c *Client) CreateView(ctx context.Context, params *CreateViewInput, optFns ...func(*Options)) (*CreateViewOutput, error) {
if params == nil {
params = &CreateViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateView", params, optFns, c.addOperationCreateViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateViewOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateViewInput struct {
// The name of the new view. This name appears in the list of views in Resource
// Explorer. The name must be no more than 64 characters long, and can include
// letters, digits, and the dash (-) character. The name must be unique within its
// Amazon Web Services Region.
//
// This member is required.
ViewName *string
// This value helps ensure idempotency. Resource Explorer uses this value to
// prevent the accidental creation of duplicate versions. We recommend that you
// generate a UUID-type value (https://wikipedia.org/wiki/Universally_unique_identifier)
// to ensure the uniqueness of your views.
ClientToken *string
// An array of strings that specify which resources are included in the results of
// queries made using this view. When you use this view in a Search operation, the
// filter string is combined with the search's QueryString parameter using a
// logical AND operator. For information about the supported syntax, see Search
// query reference for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html)
// in the Amazon Web Services Resource Explorer User Guide. This query string in
// the context of this operation supports only filter prefixes (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters)
// with optional operators (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators)
// . It doesn't support free-form text. For example, the string region:us*
// service:ec2 -tag:stage=prod includes all Amazon EC2 resources in any Amazon Web
// Services Region that begins with the letters us and is not tagged with a key
// Stage that has the value prod .
Filters *types.SearchFilter
// Specifies optional fields that you want included in search results from this
// view. It is a list of objects that each describe a field to include. The default
// is an empty list, with no optional fields included in the results.
IncludedProperties []types.IncludedProperty
// Tag key and value pairs that are attached to the view.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateViewOutput struct {
// A structure that contains the details about the new view.
View *types.View
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateView{}, 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_opCreateViewMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateViewValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateView(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_initializeOpCreateView struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateView) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateView) 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.(*CreateViewInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateViewInput ")
}
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_opCreateViewMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateView{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "CreateView",
}
}
| 200 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Deletes the specified index and turns off Amazon Web Services Resource Explorer
// in the specified Amazon Web Services Region. When you delete an index, Resource
// Explorer stops discovering and indexing resources in that Region. Resource
// Explorer also deletes all views in that Region. These actions occur as
// asynchronous background tasks. You can check to see when the actions are
// complete by using the GetIndex operation and checking the Status response
// value. If the index you delete is the aggregator index for the Amazon Web
// Services account, you must wait 24 hours before you can promote another local
// index to be the aggregator index for the account. Users can't perform
// account-wide searches using Resource Explorer until another aggregator index is
// configured.
func (c *Client) DeleteIndex(ctx context.Context, params *DeleteIndexInput, optFns ...func(*Options)) (*DeleteIndexOutput, error) {
if params == nil {
params = &DeleteIndexInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteIndex", params, optFns, c.addOperationDeleteIndexMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteIndexOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteIndexInput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the index that you want to delete.
//
// This member is required.
Arn *string
noSmithyDocumentSerde
}
type DeleteIndexOutput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the index that you successfully started the deletion process. This operation
// is asynchronous. To check its status, call the GetIndex operation.
Arn *string
// The date and time when you last updated this index.
LastUpdatedAt *time.Time
// Indicates the current state of the index.
State types.IndexState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteIndexMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteIndex{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteIndex{}, 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 = addOpDeleteIndexValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIndex(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_opDeleteIndex(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "DeleteIndex",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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 specified view. If the specified view is the default view for its
// Amazon Web Services Region, then all Search operations in that Region must
// explicitly specify the view to use until you configure a new default by calling
// the AssociateDefaultView operation.
func (c *Client) DeleteView(ctx context.Context, params *DeleteViewInput, optFns ...func(*Options)) (*DeleteViewOutput, error) {
if params == nil {
params = &DeleteViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteView", params, optFns, c.addOperationDeleteViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteViewOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteViewInput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view that you want to delete.
//
// This member is required.
ViewArn *string
noSmithyDocumentSerde
}
type DeleteViewOutput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view that you successfully deleted.
ViewArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteView{}, 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 = addOpDeleteViewValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteView(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_opDeleteView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "DeleteView",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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"
)
// After you call this operation, the affected Amazon Web Services Region no
// longer has a default view. All Search operations in that Region must explicitly
// specify a view or the operation fails. You can configure a new default by
// calling the AssociateDefaultView operation. If an Amazon Web Services Region
// doesn't have a default view configured, then users must explicitly specify a
// view with every Search operation performed in that Region.
func (c *Client) DisassociateDefaultView(ctx context.Context, params *DisassociateDefaultViewInput, optFns ...func(*Options)) (*DisassociateDefaultViewOutput, error) {
if params == nil {
params = &DisassociateDefaultViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateDefaultView", params, optFns, c.addOperationDisassociateDefaultViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateDefaultViewOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateDefaultViewInput struct {
noSmithyDocumentSerde
}
type DisassociateDefaultViewOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateDefaultViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateDefaultView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateDefaultView{}, 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_opDisassociateDefaultView(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_opDisassociateDefaultView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "DisassociateDefaultView",
}
}
| 116 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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"
)
// Retrieves the Amazon Resource Name (ARN) of the view that is the default for
// the Amazon Web Services Region in which you call this operation. You can then
// call GetView to retrieve the details of that view.
func (c *Client) GetDefaultView(ctx context.Context, params *GetDefaultViewInput, optFns ...func(*Options)) (*GetDefaultViewOutput, error) {
if params == nil {
params = &GetDefaultViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDefaultView", params, optFns, c.addOperationGetDefaultViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDefaultViewOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetDefaultViewInput struct {
noSmithyDocumentSerde
}
type GetDefaultViewOutput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view that is the current default for the Amazon Web Services Region in
// which you called this operation.
ViewArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDefaultViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDefaultView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDefaultView{}, 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_opGetDefaultView(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_opGetDefaultView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "GetDefaultView",
}
}
| 119 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves details about the Amazon Web Services Resource Explorer index in the
// Amazon Web Services Region in which you invoked the operation.
func (c *Client) GetIndex(ctx context.Context, params *GetIndexInput, optFns ...func(*Options)) (*GetIndexOutput, error) {
if params == nil {
params = &GetIndexInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetIndex", params, optFns, c.addOperationGetIndexMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetIndexOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetIndexInput struct {
noSmithyDocumentSerde
}
type GetIndexOutput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the index.
Arn *string
// The date and time when the index was originally created.
CreatedAt *time.Time
// The date and time when the index was last updated.
LastUpdatedAt *time.Time
// This response value is present only if this index is Type=AGGREGATOR . A list of
// the Amazon Web Services Regions that replicate their content to the index in
// this Region.
ReplicatingFrom []string
// This response value is present only if this index is Type=LOCAL . The Amazon Web
// Services Region that contains the aggregator index, if one exists. If an
// aggregator index does exist then the Region in which you called this operation
// replicates its index information to the Region specified in this response value.
ReplicatingTo []string
// The current state of the index in this Amazon Web Services Region.
State types.IndexState
// Tag key and value pairs that are attached to the index.
Tags map[string]string
// The type of the index in this Region. For information about the aggregator
// index and how it differs from a local index, see Turning on cross-Region search
// by creating an aggregator index (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html)
// .
Type types.IndexType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetIndexMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetIndex{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetIndex{}, 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_opGetIndex(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_opGetIndex(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "GetIndex",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves details of the specified view.
func (c *Client) GetView(ctx context.Context, params *GetViewInput, optFns ...func(*Options)) (*GetViewOutput, error) {
if params == nil {
params = &GetViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetView", params, optFns, c.addOperationGetViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetViewOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetViewInput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view that you want information about.
//
// This member is required.
ViewArn *string
noSmithyDocumentSerde
}
type GetViewOutput struct {
// Tag key and value pairs that are attached to the view.
Tags map[string]string
// A structure that contains the details for the requested view.
View *types.View
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetView{}, 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 = addOpGetViewValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetView(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_opGetView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "GetView",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a list of all of the indexes in Amazon Web Services Regions that are
// currently collecting resource information for Amazon Web Services Resource
// Explorer.
func (c *Client) ListIndexes(ctx context.Context, params *ListIndexesInput, optFns ...func(*Options)) (*ListIndexesOutput, error) {
if params == nil {
params = &ListIndexesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListIndexes", params, optFns, c.addOperationListIndexesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListIndexesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListIndexesInput struct {
// The maximum number of results that you want included on each page of the
// response. If you do not include this parameter, it defaults to a value
// appropriate to the operation. If additional items exist beyond those included in
// the current response, the NextToken response element is present and has a value
// (is not null). Include that value as the NextToken request parameter in the
// next call to the operation to get the next part of the results. An API operation
// can return fewer results than the maximum even when there are more results
// available. You should check NextToken after every operation to ensure that you
// receive all of the results.
MaxResults *int32
// The parameter for receiving additional results if you receive a NextToken
// response in a previous request. A NextToken response indicates that more output
// is available. Set this parameter to the value of the previous call's NextToken
// response to indicate where the output should continue from.
NextToken *string
// If specified, limits the response to only information about the index in the
// specified list of Amazon Web Services Regions.
Regions []string
// If specified, limits the output to only indexes of the specified Type, either
// LOCAL or AGGREGATOR . Use this option to discover the aggregator index for your
// account.
Type types.IndexType
noSmithyDocumentSerde
}
type ListIndexesOutput struct {
// A structure that contains the details and status of each index.
Indexes []types.Index
// If present, indicates that more output is available than is included in the
// current response. Use this value in the NextToken request parameter in a
// subsequent call to the operation to get the next part of the output. You should
// repeat this until the NextToken response element comes back as null .
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListIndexesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListIndexes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListIndexes{}, 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_opListIndexes(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
}
// ListIndexesAPIClient is a client that implements the ListIndexes operation.
type ListIndexesAPIClient interface {
ListIndexes(context.Context, *ListIndexesInput, ...func(*Options)) (*ListIndexesOutput, error)
}
var _ ListIndexesAPIClient = (*Client)(nil)
// ListIndexesPaginatorOptions is the paginator options for ListIndexes
type ListIndexesPaginatorOptions struct {
// The maximum number of results that you want included on each page of the
// response. If you do not include this parameter, it defaults to a value
// appropriate to the operation. If additional items exist beyond those included in
// the current response, the NextToken response element is present and has a value
// (is not null). Include that value as the NextToken request parameter in the
// next call to the operation to get the next part of the results. An API operation
// can return fewer results than the maximum even when there are more results
// available. You should check NextToken after every operation to ensure that you
// receive all of the results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListIndexesPaginator is a paginator for ListIndexes
type ListIndexesPaginator struct {
options ListIndexesPaginatorOptions
client ListIndexesAPIClient
params *ListIndexesInput
nextToken *string
firstPage bool
}
// NewListIndexesPaginator returns a new ListIndexesPaginator
func NewListIndexesPaginator(client ListIndexesAPIClient, params *ListIndexesInput, optFns ...func(*ListIndexesPaginatorOptions)) *ListIndexesPaginator {
if params == nil {
params = &ListIndexesInput{}
}
options := ListIndexesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListIndexesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListIndexesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListIndexes page.
func (p *ListIndexesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIndexesOutput, 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.ListIndexes(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_opListIndexes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "ListIndexes",
}
}
| 249 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a list of all resource types currently supported by Amazon Web
// Services Resource Explorer.
func (c *Client) ListSupportedResourceTypes(ctx context.Context, params *ListSupportedResourceTypesInput, optFns ...func(*Options)) (*ListSupportedResourceTypesOutput, error) {
if params == nil {
params = &ListSupportedResourceTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSupportedResourceTypes", params, optFns, c.addOperationListSupportedResourceTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSupportedResourceTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSupportedResourceTypesInput struct {
// The maximum number of results that you want included on each page of the
// response. If you do not include this parameter, it defaults to a value
// appropriate to the operation. If additional items exist beyond those included in
// the current response, the NextToken response element is present and has a value
// (is not null). Include that value as the NextToken request parameter in the
// next call to the operation to get the next part of the results. An API operation
// can return fewer results than the maximum even when there are more results
// available. You should check NextToken after every operation to ensure that you
// receive all of the results.
MaxResults *int32
// The parameter for receiving additional results if you receive a NextToken
// response in a previous request. A NextToken response indicates that more output
// is available. Set this parameter to the value of the previous call's NextToken
// response to indicate where the output should continue from.
NextToken *string
noSmithyDocumentSerde
}
type ListSupportedResourceTypesOutput struct {
// If present, indicates that more output is available than is included in the
// current response. Use this value in the NextToken request parameter in a
// subsequent call to the operation to get the next part of the output. You should
// repeat this until the NextToken response element comes back as null .
NextToken *string
// The list of resource types supported by Resource Explorer.
ResourceTypes []types.SupportedResourceType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSupportedResourceTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSupportedResourceTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSupportedResourceTypes{}, 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_opListSupportedResourceTypes(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
}
// ListSupportedResourceTypesAPIClient is a client that implements the
// ListSupportedResourceTypes operation.
type ListSupportedResourceTypesAPIClient interface {
ListSupportedResourceTypes(context.Context, *ListSupportedResourceTypesInput, ...func(*Options)) (*ListSupportedResourceTypesOutput, error)
}
var _ ListSupportedResourceTypesAPIClient = (*Client)(nil)
// ListSupportedResourceTypesPaginatorOptions is the paginator options for
// ListSupportedResourceTypes
type ListSupportedResourceTypesPaginatorOptions struct {
// The maximum number of results that you want included on each page of the
// response. If you do not include this parameter, it defaults to a value
// appropriate to the operation. If additional items exist beyond those included in
// the current response, the NextToken response element is present and has a value
// (is not null). Include that value as the NextToken request parameter in the
// next call to the operation to get the next part of the results. An API operation
// can return fewer results than the maximum even when there are more results
// available. You should check NextToken after every operation to ensure that you
// receive all of the results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListSupportedResourceTypesPaginator is a paginator for
// ListSupportedResourceTypes
type ListSupportedResourceTypesPaginator struct {
options ListSupportedResourceTypesPaginatorOptions
client ListSupportedResourceTypesAPIClient
params *ListSupportedResourceTypesInput
nextToken *string
firstPage bool
}
// NewListSupportedResourceTypesPaginator returns a new
// ListSupportedResourceTypesPaginator
func NewListSupportedResourceTypesPaginator(client ListSupportedResourceTypesAPIClient, params *ListSupportedResourceTypesInput, optFns ...func(*ListSupportedResourceTypesPaginatorOptions)) *ListSupportedResourceTypesPaginator {
if params == nil {
params = &ListSupportedResourceTypesInput{}
}
options := ListSupportedResourceTypesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSupportedResourceTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSupportedResourceTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSupportedResourceTypes page.
func (p *ListSupportedResourceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSupportedResourceTypesOutput, 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.ListSupportedResourceTypes(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_opListSupportedResourceTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "ListSupportedResourceTypes",
}
}
| 243 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags that are attached to 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) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view or index that you want to attach tags to.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tag key and value pairs that you want to attach to the specified view or
// index.
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: "resource-explorer-2",
OperationName: "ListTagsForResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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 the Amazon resource names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the views available in the Amazon Web Services Region in which you call this
// operation. Always check the NextToken response parameter for a null value when
// calling a paginated operation. These operations can occasionally return an empty
// set of results even when there are more results available. The NextToken
// response parameter value is null only when there are no more results to display.
func (c *Client) ListViews(ctx context.Context, params *ListViewsInput, optFns ...func(*Options)) (*ListViewsOutput, error) {
if params == nil {
params = &ListViewsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListViews", params, optFns, c.addOperationListViewsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListViewsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListViewsInput struct {
// The maximum number of results that you want included on each page of the
// response. If you do not include this parameter, it defaults to a value
// appropriate to the operation. If additional items exist beyond those included in
// the current response, the NextToken response element is present and has a value
// (is not null). Include that value as the NextToken request parameter in the
// next call to the operation to get the next part of the results. An API operation
// can return fewer results than the maximum even when there are more results
// available. You should check NextToken after every operation to ensure that you
// receive all of the results.
MaxResults *int32
// The parameter for receiving additional results if you receive a NextToken
// response in a previous request. A NextToken response indicates that more output
// is available. Set this parameter to the value of the previous call's NextToken
// response to indicate where the output should continue from.
NextToken *string
noSmithyDocumentSerde
}
type ListViewsOutput struct {
// If present, indicates that more output is available than is included in the
// current response. Use this value in the NextToken request parameter in a
// subsequent call to the operation to get the next part of the output. You should
// repeat this until the NextToken response element comes back as null .
NextToken *string
// The list of views available in the Amazon Web Services Region in which you
// called this operation.
Views []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListViewsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListViews{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListViews{}, 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_opListViews(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
}
// ListViewsAPIClient is a client that implements the ListViews operation.
type ListViewsAPIClient interface {
ListViews(context.Context, *ListViewsInput, ...func(*Options)) (*ListViewsOutput, error)
}
var _ ListViewsAPIClient = (*Client)(nil)
// ListViewsPaginatorOptions is the paginator options for ListViews
type ListViewsPaginatorOptions struct {
// The maximum number of results that you want included on each page of the
// response. If you do not include this parameter, it defaults to a value
// appropriate to the operation. If additional items exist beyond those included in
// the current response, the NextToken response element is present and has a value
// (is not null). Include that value as the NextToken request parameter in the
// next call to the operation to get the next part of the results. An API operation
// can return fewer results than the maximum even when there are more results
// available. You should check NextToken after every operation to ensure that you
// receive all of the results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListViewsPaginator is a paginator for ListViews
type ListViewsPaginator struct {
options ListViewsPaginatorOptions
client ListViewsAPIClient
params *ListViewsInput
nextToken *string
firstPage bool
}
// NewListViewsPaginator returns a new ListViewsPaginator
func NewListViewsPaginator(client ListViewsAPIClient, params *ListViewsInput, optFns ...func(*ListViewsPaginatorOptions)) *ListViewsPaginator {
if params == nil {
params = &ListViewsInput{}
}
options := ListViewsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListViewsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListViewsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListViews page.
func (p *ListViewsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListViewsOutput, 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.ListViews(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_opListViews(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "ListViews",
}
}
| 243 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Searches for resources and displays details about all resources that match the
// specified criteria. You must specify a query string. All search queries must use
// a view. If you don't explicitly specify a view, then Amazon Web Services
// Resource Explorer uses the default view for the Amazon Web Services Region in
// which you call this operation. The results are the logical intersection of the
// results that match both the QueryString parameter supplied to this operation
// and the SearchFilter parameter attached to the view. For the complete syntax
// supported by the QueryString parameter, see Search query syntax reference for
// Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/APIReference/about-query-syntax.html)
// . If your search results are empty, or are missing results that you think should
// be there, see Troubleshooting Resource Explorer search (https://docs.aws.amazon.com/resource-explorer/latest/userguide/troubleshooting_search.html)
// .
func (c *Client) Search(ctx context.Context, params *SearchInput, optFns ...func(*Options)) (*SearchOutput, error) {
if params == nil {
params = &SearchInput{}
}
result, metadata, err := c.invokeOperation(ctx, "Search", params, optFns, c.addOperationSearchMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchInput struct {
// A string that includes keywords and filters that specify the resources that you
// want to include in the results. For the complete syntax supported by the
// QueryString parameter, see Search query syntax reference for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html)
// . The search is completely case insensitive. You can specify an empty string to
// return all results up to the limit of 1,000 total results. The operation can
// return only the first 1,000 results. If the resource you want is not included,
// then use a different value for QueryString to refine the results.
//
// This member is required.
QueryString *string
// The maximum number of results that you want included on each page of the
// response. If you do not include this parameter, it defaults to a value
// appropriate to the operation. If additional items exist beyond those included in
// the current response, the NextToken response element is present and has a value
// (is not null). Include that value as the NextToken request parameter in the
// next call to the operation to get the next part of the results. An API operation
// can return fewer results than the maximum even when there are more results
// available. You should check NextToken after every operation to ensure that you
// receive all of the results.
MaxResults *int32
// The parameter for receiving additional results if you receive a NextToken
// response in a previous request. A NextToken response indicates that more output
// is available. Set this parameter to the value of the previous call's NextToken
// response to indicate where the output should continue from.
NextToken *string
// Specifies the Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view to use for the query. If you don't specify a value for this
// parameter, then the operation automatically uses the default view for the Amazon
// Web Services Region in which you called this operation. If the Region either
// doesn't have a default view or if you don't have permission to use the default
// view, then the operation fails with a 401 Unauthorized exception.
ViewArn *string
noSmithyDocumentSerde
}
type SearchOutput struct {
// The number of resources that match the query.
Count *types.ResourceCount
// If present, indicates that more output is available than is included in the
// current response. Use this value in the NextToken request parameter in a
// subsequent call to the operation to get the next part of the output. You should
// repeat this until the NextToken response element comes back as null .
NextToken *string
// The list of structures that describe the resources that match the query.
Resources []types.Resource
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the view that this operation used to perform the search.
ViewArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSearch{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearch{}, 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 = addOpSearchValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearch(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
}
// SearchAPIClient is a client that implements the Search operation.
type SearchAPIClient interface {
Search(context.Context, *SearchInput, ...func(*Options)) (*SearchOutput, error)
}
var _ SearchAPIClient = (*Client)(nil)
// SearchPaginatorOptions is the paginator options for Search
type SearchPaginatorOptions struct {
// The maximum number of results that you want included on each page of the
// response. If you do not include this parameter, it defaults to a value
// appropriate to the operation. If additional items exist beyond those included in
// the current response, the NextToken response element is present and has a value
// (is not null). Include that value as the NextToken request parameter in the
// next call to the operation to get the next part of the results. An API operation
// can return fewer results than the maximum even when there are more results
// available. You should check NextToken after every operation to ensure that you
// receive all of the results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// SearchPaginator is a paginator for Search
type SearchPaginator struct {
options SearchPaginatorOptions
client SearchAPIClient
params *SearchInput
nextToken *string
firstPage bool
}
// NewSearchPaginator returns a new SearchPaginator
func NewSearchPaginator(client SearchAPIClient, params *SearchInput, optFns ...func(*SearchPaginatorOptions)) *SearchPaginator {
if params == nil {
params = &SearchInput{}
}
options := SearchPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &SearchPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *SearchPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next Search page.
func (p *SearchPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchOutput, 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.Search(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_opSearch(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "Search",
}
}
| 278 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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 one or more tag key and value pairs to an Amazon Web Services Resource
// Explorer view or index.
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 view or index that you want to attach
// tags to.
//
// This member is required.
ResourceArn *string
// A list of tag key and value pairs that you want to attach to the specified view
// or index.
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: "resource-explorer-2",
OperationName: "TagResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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 one or more tag key and value pairs from an Amazon Web Services
// Resource Explorer view or index.
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 view or index that you want to remove
// tags from.
//
// This member is required.
ResourceArn *string
// A list of the keys for the tags that you want to remove from the specified view
// or index.
//
// 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: "resource-explorer-2",
OperationName: "UntagResource",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package resourceexplorer2
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/resourceexplorer2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Changes the type of the index from one of the following types to the other. For
// more information about indexes and the role they perform in Amazon Web Services
// Resource Explorer, see Turning on cross-Region search by creating an aggregator
// index (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html)
// in the Amazon Web Services Resource Explorer User Guide.
// - AGGREGATOR index type The index contains information about resources from
// all Amazon Web Services Regions in the Amazon Web Services account in which
// you've created a Resource Explorer index. Resource information from all other
// Regions is replicated to this Region's index. When you change the index type to
// AGGREGATOR , Resource Explorer turns on replication of all discovered resource
// information from the other Amazon Web Services Regions in your account to this
// index. You can then, from this Region only, perform resource search queries that
// span all Amazon Web Services Regions in the Amazon Web Services account. Turning
// on replication from all other Regions is performed by asynchronous background
// tasks. You can check the status of the asynchronous tasks by using the
// GetIndex operation. When the asynchronous tasks complete, the Status response
// of that operation changes from UPDATING to ACTIVE . After that, you can start
// to see results from other Amazon Web Services Regions in query results. However,
// it can take several hours for replication from all other Regions to complete.
// You can have only one aggregator index per Amazon Web Services account. Before
// you can promote a different index to be the aggregator index for the account,
// you must first demote the existing aggregator index to type LOCAL .
// - LOCAL index type The index contains information about resources in only the
// Amazon Web Services Region in which the index exists. If an aggregator index in
// another Region exists, then information in this local index is replicated to the
// aggregator index. When you change the index type to LOCAL , Resource Explorer
// turns off the replication of resource information from all other Amazon Web
// Services Regions in the Amazon Web Services account to this Region. The
// aggregator index remains in the UPDATING state until all replication with
// other Regions successfully stops. You can check the status of the asynchronous
// task by using the GetIndex operation. When Resource Explorer successfully
// stops all replication with other Regions, the Status response of that
// operation changes from UPDATING to ACTIVE . Separately, the resource
// information from other Regions that was previously stored in the index is
// deleted within 30 days by another background task. Until that asynchronous task
// completes, some results from other Regions can continue to appear in search
// results. After you demote an aggregator index to a local index, you must wait 24
// hours before you can promote another index to be the new aggregator index for
// the account.
func (c *Client) UpdateIndexType(ctx context.Context, params *UpdateIndexTypeInput, optFns ...func(*Options)) (*UpdateIndexTypeOutput, error) {
if params == nil {
params = &UpdateIndexTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateIndexType", params, optFns, c.addOperationUpdateIndexTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateIndexTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateIndexTypeInput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the index that you want to update.
//
// This member is required.
Arn *string
// The type of the index. To understand the difference between LOCAL and AGGREGATOR
// , see Turning on cross-Region search (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html)
// in the Amazon Web Services Resource Explorer User Guide.
//
// This member is required.
Type types.IndexType
noSmithyDocumentSerde
}
type UpdateIndexTypeOutput struct {
// The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the index that you updated.
Arn *string
// The date and timestamp when the index was last updated.
LastUpdatedAt *time.Time
// Indicates the state of the request to update the index. This operation is
// asynchronous. Call the GetIndex operation to check for changes.
State types.IndexState
// Specifies the type of the specified index after the operation completes.
Type types.IndexType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateIndexTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateIndexType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateIndexType{}, 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 = addOpUpdateIndexTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIndexType(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_opUpdateIndexType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "resource-explorer-2",
OperationName: "UpdateIndexType",
}
}
| 183 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.