diff --git a/.changelog/0b22af5cb7f84f518b1f805aff932653.json b/.changelog/0b22af5cb7f84f518b1f805aff932653.json new file mode 100644 index 00000000000..c27d3a3094a --- /dev/null +++ b/.changelog/0b22af5cb7f84f518b1f805aff932653.json @@ -0,0 +1,8 @@ +{ + "id": "0b22af5c-b7f8-4f51-8b1f-805aff932653", + "type": "feature", + "description": "Added APIs to support network replication and recovery using AWS Elastic Disaster Recovery.", + "modules": [ + "service/drs" + ] +} \ No newline at end of file diff --git a/.changelog/16b4d26b93824d1eb81a698bdbcdac3a.json b/.changelog/16b4d26b93824d1eb81a698bdbcdac3a.json new file mode 100644 index 00000000000..63e076de2e7 --- /dev/null +++ b/.changelog/16b4d26b93824d1eb81a698bdbcdac3a.json @@ -0,0 +1,8 @@ +{ + "id": "16b4d26b-9382-4d1e-b81a-698bdbcdac3a", + "type": "feature", + "description": "GA release of Amazon Verified Permissions.", + "modules": [ + "service/verifiedpermissions" + ] +} \ No newline at end of file diff --git a/.changelog/3c2d573a92fe4f089e9b7000e612669e.json b/.changelog/3c2d573a92fe4f089e9b7000e612669e.json new file mode 100644 index 00000000000..db1243f1d15 --- /dev/null +++ b/.changelog/3c2d573a92fe4f089e9b7000e612669e.json @@ -0,0 +1,8 @@ +{ + "id": "3c2d573a-92fe-4f08-9e9b-7000e612669e", + "type": "feature", + "description": "Initial release of Amazon CodeGuru Security APIs", + "modules": [ + "service/codegurusecurity" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..1add7bae7d9 --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,9 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/codegurusecurity", + "service/verifiedpermissions" + ] +} \ No newline at end of file diff --git a/.changelog/575617f6223d41ff8b964d32d9350f19.json b/.changelog/575617f6223d41ff8b964d32d9350f19.json new file mode 100644 index 00000000000..5520c44f005 --- /dev/null +++ b/.changelog/575617f6223d41ff8b964d32d9350f19.json @@ -0,0 +1,8 @@ +{ + "id": "575617f6-223d-41ff-8b96-4d32d9350f19", + "type": "feature", + "description": "This release fixes using aws-us-gov ARNs in API calls and adds documentation for snapshot APIs.", + "modules": [ + "service/simspaceweaver" + ] +} \ No newline at end of file diff --git a/.changelog/682a72f5b93b464c8f91b4bbba1cf8d1.json b/.changelog/682a72f5b93b464c8f91b4bbba1cf8d1.json new file mode 100644 index 00000000000..63a3b0589e7 --- /dev/null +++ b/.changelog/682a72f5b93b464c8f91b4bbba1cf8d1.json @@ -0,0 +1,8 @@ +{ + "id": "682a72f5-b93b-464c-8f91-b4bbba1cf8d1", + "type": "feature", + "description": "Integrate double encryption feature to SDKs.", + "modules": [ + "service/s3" + ] +} \ No newline at end of file diff --git a/.changelog/6e6b0c5649e6466b8e3613f90f6f42ca.json b/.changelog/6e6b0c5649e6466b8e3613f90f6f42ca.json new file mode 100644 index 00000000000..b06921cded8 --- /dev/null +++ b/.changelog/6e6b0c5649e6466b8e3613f90f6f42ca.json @@ -0,0 +1,8 @@ +{ + "id": "6e6b0c56-49e6-466b-8e36-13f90f6f42ca", + "type": "feature", + "description": "This release adds pagination for the Get Certificates API operation.", + "modules": [ + "service/lightsail" + ] +} \ No newline at end of file diff --git a/.changelog/7ab77d7ac9b74dbb8df1b723b3c1a907.json b/.changelog/7ab77d7ac9b74dbb8df1b723b3c1a907.json new file mode 100644 index 00000000000..3099acf5cb2 --- /dev/null +++ b/.changelog/7ab77d7ac9b74dbb8df1b723b3c1a907.json @@ -0,0 +1,8 @@ +{ + "id": "7ab77d7a-c9b7-4dbb-8df1-b723b3c1a907", + "type": "feature", + "description": "This release introduces a new feature, EC2 Instance Connect Endpoint, that enables you to connect to a resource over TCP, without requiring the resource to have a public IPv4 address.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/8879011aea45441f93f0bc69a9d134c4.json b/.changelog/8879011aea45441f93f0bc69a9d134c4.json new file mode 100644 index 00000000000..575c783c027 --- /dev/null +++ b/.changelog/8879011aea45441f93f0bc69a9d134c4.json @@ -0,0 +1,8 @@ +{ + "id": "8879011a-ea45-441f-93f0-bc69a9d134c4", + "type": "feature", + "description": "This feature allows users to view dashboards for CloudTrail Lake event data stores.", + "modules": [ + "service/cloudtrail" + ] +} \ No newline at end of file diff --git a/.changelog/93aeee3627fc447baf68885fedfced5d.json b/.changelog/93aeee3627fc447baf68885fedfced5d.json new file mode 100644 index 00000000000..444f6e6156b --- /dev/null +++ b/.changelog/93aeee3627fc447baf68885fedfced5d.json @@ -0,0 +1,8 @@ +{ + "id": "93aeee36-27fc-447b-af68-885fedfced5d", + "type": "feature", + "description": "Add support for Security Hub Automation Rules", + "modules": [ + "service/securityhub" + ] +} \ No newline at end of file diff --git a/.changelog/d13529c558c247f98426674a74205ef8.json b/.changelog/d13529c558c247f98426674a74205ef8.json new file mode 100644 index 00000000000..e4943df3554 --- /dev/null +++ b/.changelog/d13529c558c247f98426674a74205ef8.json @@ -0,0 +1,8 @@ +{ + "id": "d13529c5-58c2-47f9-8426-674a74205ef8", + "type": "feature", + "description": "You can now detect and block fraudulent account creation attempts with the new AWS WAF Fraud Control account creation fraud prevention (ACFP) managed rule group AWSManagedRulesACFPRuleSet.", + "modules": [ + "service/wafv2" + ] +} \ No newline at end of file diff --git a/.changelog/de77d9e9e66542099d0cd0bb67320fbd.json b/.changelog/de77d9e9e66542099d0cd0bb67320fbd.json new file mode 100644 index 00000000000..9b8daf9d613 --- /dev/null +++ b/.changelog/de77d9e9e66542099d0cd0bb67320fbd.json @@ -0,0 +1,8 @@ +{ + "id": "de77d9e9-e665-4209-9d0c-d0bb67320fbd", + "type": "documentation", + "description": "Change the Image Builder ImagePipeline dateNextRun field to more accurately describe the data.", + "modules": [ + "service/imagebuilder" + ] +} \ No newline at end of file diff --git a/.changelog/e1ffc743fdcb415cb82a2717d53a3415.json b/.changelog/e1ffc743fdcb415cb82a2717d53a3415.json new file mode 100644 index 00000000000..a79ddee137c --- /dev/null +++ b/.changelog/e1ffc743fdcb415cb82a2717d53a3415.json @@ -0,0 +1,8 @@ +{ + "id": "e1ffc743-fdcb-415c-b82a-2717d53a3415", + "type": "feature", + "description": "AWS Well-Architected now supports Profiles that help customers prioritize which questions to focus on first by providing a list of prioritized questions that are better aligned with their business goals and outcomes.", + "modules": [ + "service/wellarchitected" + ] +} \ No newline at end of file diff --git a/service/cloudtrail/api_op_CreateTrail.go b/service/cloudtrail/api_op_CreateTrail.go index ecb705d84a5..45830016edf 100644 --- a/service/cloudtrail/api_op_CreateTrail.go +++ b/service/cloudtrail/api_op_CreateTrail.go @@ -163,7 +163,7 @@ type CreateTrailOutput struct { // arn:aws:sns:us-east-2:123456789012:MyTopic SnsTopicARN *string - // This field is no longer in use. Use SnsTopicARN. + // This field is no longer in use. Use SnsTopicARN . // // Deprecated: This member has been deprecated. SnsTopicName *string diff --git a/service/cloudtrail/api_op_DescribeQuery.go b/service/cloudtrail/api_op_DescribeQuery.go index 9531cadf187..e637fbfc31e 100644 --- a/service/cloudtrail/api_op_DescribeQuery.go +++ b/service/cloudtrail/api_op_DescribeQuery.go @@ -12,8 +12,11 @@ import ( ) // Returns metadata about a query, including query run time in milliseconds, -// number of events scanned and matched, and query status. You must specify an ARN -// for EventDataStore , and a value for QueryID . +// number of events scanned and matched, and query status. If the query results +// were delivered to an S3 bucket, the response also provides the S3 URI and the +// delivery status. You must specify either a QueryID or a QueryAlias . Specifying +// the QueryAlias parameter returns information about the last query run for the +// alias. func (c *Client) DescribeQuery(ctx context.Context, params *DescribeQueryInput, optFns ...func(*Options)) (*DescribeQueryOutput, error) { if params == nil { params = &DescribeQueryInput{} @@ -31,17 +34,18 @@ func (c *Client) DescribeQuery(ctx context.Context, params *DescribeQueryInput, type DescribeQueryInput struct { - // The query ID. - // - // This member is required. - QueryId *string - // The ARN (or the ID suffix of the ARN) of an event data store on which the // specified query was run. // // Deprecated: EventDataStore is no longer required by DescribeQueryRequest EventDataStore *string + // The alias that identifies a query template. + QueryAlias *string + + // The query ID. + QueryId *string + noSmithyDocumentSerde } @@ -123,9 +127,6 @@ func (c *Client) addOperationDescribeQueryMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addOpDescribeQueryValidationMiddleware(stack); err != nil { - return err - } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeQuery(options.Region), middleware.Before); err != nil { return err } diff --git a/service/cloudtrail/api_op_GetQueryResults.go b/service/cloudtrail/api_op_GetQueryResults.go index 6d0853a2a8b..a8efc7d8351 100644 --- a/service/cloudtrail/api_op_GetQueryResults.go +++ b/service/cloudtrail/api_op_GetQueryResults.go @@ -13,7 +13,7 @@ import ( ) // Gets event data results of a query. You must specify the QueryID value returned -// by the StartQuery operation, and an ARN for EventDataStore . +// by the StartQuery operation. func (c *Client) GetQueryResults(ctx context.Context, params *GetQueryResultsInput, optFns ...func(*Options)) (*GetQueryResultsOutput, error) { if params == nil { params = &GetQueryResultsInput{} diff --git a/service/cloudtrail/api_op_StartQuery.go b/service/cloudtrail/api_op_StartQuery.go index 564456f47ab..e35f8395713 100644 --- a/service/cloudtrail/api_op_StartQuery.go +++ b/service/cloudtrail/api_op_StartQuery.go @@ -10,9 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Starts a CloudTrail Lake query. The required QueryStatement parameter provides +// Starts a CloudTrail Lake query. Use the QueryStatement parameter to provide // your SQL query, enclosed in single quotation marks. Use the optional -// DeliveryS3Uri parameter to deliver the query results to an S3 bucket. +// DeliveryS3Uri parameter to deliver the query results to an S3 bucket. StartQuery +// requires you specify either the QueryStatement parameter, or a QueryAlias and +// any QueryParameters . In the current release, the QueryAlias and QueryParameters +// parameters are used only for the queries that populate the CloudTrail Lake +// dashboards. func (c *Client) StartQuery(ctx context.Context, params *StartQueryInput, optFns ...func(*Options)) (*StartQueryOutput, error) { if params == nil { params = &StartQueryInput{} @@ -30,14 +34,18 @@ func (c *Client) StartQuery(ctx context.Context, params *StartQueryInput, optFns type StartQueryInput struct { - // The SQL code of your query. - // - // This member is required. - QueryStatement *string - // The URI for the S3 bucket where CloudTrail delivers the query results. DeliveryS3Uri *string + // The alias that identifies a query template. + QueryAlias *string + + // The query parameters for the specified QueryAlias . + QueryParameters []string + + // The SQL code of your query. + QueryStatement *string + noSmithyDocumentSerde } @@ -97,9 +105,6 @@ func (c *Client) addOperationStartQueryMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addOpStartQueryValidationMiddleware(stack); err != nil { - return err - } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartQuery(options.Region), middleware.Before); err != nil { return err } diff --git a/service/cloudtrail/api_op_UpdateEventDataStore.go b/service/cloudtrail/api_op_UpdateEventDataStore.go index 2fe4b6d4fd0..acaeafe0e6b 100644 --- a/service/cloudtrail/api_op_UpdateEventDataStore.go +++ b/service/cloudtrail/api_op_UpdateEventDataStore.go @@ -19,10 +19,10 @@ import ( // TerminationProtection is enabled. For event data stores for CloudTrail events, // AdvancedEventSelectors includes or excludes management and data events in your // event data store. For more information about AdvancedEventSelectors , see -// PutEventSelectorsRequest$AdvancedEventSelectors . For event data stores for -// Config configuration items, Audit Manager evidence, or non-Amazon Web Services -// events, AdvancedEventSelectors includes events of that type in your event data -// store. +// AdvancedEventSelectors (https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html) +// . For event data stores for Config configuration items, Audit Manager evidence, +// or non-Amazon Web Services events, AdvancedEventSelectors includes events of +// that type in your event data store. func (c *Client) UpdateEventDataStore(ctx context.Context, params *UpdateEventDataStoreInput, optFns ...func(*Options)) (*UpdateEventDataStoreOutput, error) { if params == nil { params = &UpdateEventDataStoreInput{} diff --git a/service/cloudtrail/api_op_UpdateTrail.go b/service/cloudtrail/api_op_UpdateTrail.go index 9417f219225..a97e1829b4b 100644 --- a/service/cloudtrail/api_op_UpdateTrail.go +++ b/service/cloudtrail/api_op_UpdateTrail.go @@ -172,7 +172,7 @@ type UpdateTrailOutput struct { // topic ARN. arn:aws:sns:us-east-2:123456789012:MyTopic SnsTopicARN *string - // This field is no longer in use. Use UpdateTrailResponse$SnsTopicARN . + // This field is no longer in use. Use SnsTopicARN . // // Deprecated: This member has been deprecated. SnsTopicName *string diff --git a/service/cloudtrail/deserializers.go b/service/cloudtrail/deserializers.go index b011c805d9d..a87b0b2cc81 100644 --- a/service/cloudtrail/deserializers.go +++ b/service/cloudtrail/deserializers.go @@ -6070,6 +6070,9 @@ func awsAwsjson11_deserializeOpErrorUpdateEventDataStore(response *smithyhttp.Re case strings.EqualFold("EventDataStoreARNInvalidException", errorCode): return awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response, errorBody) + case strings.EqualFold("EventDataStoreAlreadyExistsException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreAlreadyExistsException(response, errorBody) + case strings.EqualFold("EventDataStoreHasOngoingImportException", errorCode): return awsAwsjson11_deserializeErrorEventDataStoreHasOngoingImportException(response, errorBody) diff --git a/service/cloudtrail/doc.go b/service/cloudtrail/doc.go index 28d9d5d4bb9..3255cf64078 100644 --- a/service/cloudtrail/doc.go +++ b/service/cloudtrail/doc.go @@ -19,66 +19,5 @@ // on Amazon Web Services (http://aws.amazon.com/tools/) . See the CloudTrail User // Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html) // for information about the data that is included with each Amazon Web Services -// API call listed in the log files. Actions available for CloudTrail trails The -// following actions are available for CloudTrail trails. -// - AddTags -// - CreateTrail -// - DeleteTrail -// - DescribeTrails -// - GetEventSelectors -// - GetInsightSelectors -// - GetTrail -// - GetTrailStatus -// - ListTags -// - ListTrails -// - PutEventSelectors -// - PutInsightSelectors -// - RemoveTags -// - StartLogging -// - StopLogging -// - UpdateTrail -// -// Actions available for CloudTrail event data stores The following actions are -// available for CloudTrail event data stores. -// - AddTags -// - CancelQuery -// - CreateEventDataStore -// - DeleteEventDataStore -// - DescribeQuery -// - GetEventDataStore -// - GetQueryResults -// - ListEventDataStores -// - ListTags -// - ListQueries -// - RemoveTags -// - RestoreEventDataStore -// - StartEventDataStoreIngestion -// - StartImport The following additional actions are available for imports. -// - GetImport -// - ListImportFailures -// - ListImports -// - StopImport -// - StartQuery -// - StartEventDataStoreIngestion -// - UpdateEventDataStore -// -// Actions available for CloudTrail channels The following actions are available -// for CloudTrail channels. -// - AddTags -// - CreateChannel -// - DeleteChannel -// - DeleteResourcePolicy -// - GetChannel -// - GetResourcePolicy -// - ListChannels -// - ListTags -// - PutResourcePolicy -// - RemoveTags -// - UpdateChannel -// -// Actions available for managing delegated administrators The following actions -// are available for adding or a removing a delegated administrator to manage an -// Organizations organization’s CloudTrail resources. -// - DeregisterOrganizationDelegatedAdmin -// - RegisterOrganizationDelegatedAdmin +// API call listed in the log files. package cloudtrail diff --git a/service/cloudtrail/serializers.go b/service/cloudtrail/serializers.go index c197b8fc462..0847a423277 100644 --- a/service/cloudtrail/serializers.go +++ b/service/cloudtrail/serializers.go @@ -2863,6 +2863,17 @@ func awsAwsjson11_serializeDocumentOperator(v []string, value smithyjson.Value) return nil } +func awsAwsjson11_serializeDocumentQueryParameters(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_serializeDocumentResourceIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3198,6 +3209,11 @@ func awsAwsjson11_serializeOpDocumentDescribeQueryInput(v *DescribeQueryInput, v ok.String(*v.EventDataStore) } + if v.QueryAlias != nil { + ok := object.Key("QueryAlias") + ok.String(*v.QueryAlias) + } + if v.QueryId != nil { ok := object.Key("QueryId") ok.String(*v.QueryId) @@ -3734,6 +3750,18 @@ func awsAwsjson11_serializeOpDocumentStartQueryInput(v *StartQueryInput, value s ok.String(*v.DeliveryS3Uri) } + if v.QueryAlias != nil { + ok := object.Key("QueryAlias") + ok.String(*v.QueryAlias) + } + + if v.QueryParameters != nil { + ok := object.Key("QueryParameters") + if err := awsAwsjson11_serializeDocumentQueryParameters(v.QueryParameters, ok); err != nil { + return err + } + } + if v.QueryStatement != nil { ok := object.Key("QueryStatement") ok.String(*v.QueryStatement) diff --git a/service/cloudtrail/types/types.go b/service/cloudtrail/types/types.go index 48e109fa5b0..0f7da1bed87 100644 --- a/service/cloudtrail/types/types.go +++ b/service/cloudtrail/types/types.go @@ -65,9 +65,11 @@ type AdvancedFieldSelector struct { // - AWS::Lambda::Function // - AWS::S3::Object // - AWS::CloudTrail::Channel + // - AWS::CodeWhisperer::Profile // - AWS::Cognito::IdentityPool // - AWS::DynamoDB::Stream // - AWS::EC2::Snapshot + // - AWS::EMRWAL::Workspace // - AWS::FinSpace::Environment // - AWS::Glue::Table // - AWS::GuardDuty::Detector @@ -100,6 +102,9 @@ type AdvancedFieldSelector struct { // , and the operator is set to Equals or NotEquals , the ARN must be in the // following format: // - arn::cloudtrail:::channel/ When resources.type equals + // AWS::CodeWhisperer::Profile , and the operator is set to Equals or NotEquals , + // the ARN must be in the following format: + // - arn::codewhisperer:::profile/ When resources.type equals // AWS::Cognito::IdentityPool , and the operator is set to Equals or NotEquals , // the ARN must be in the following format: // - arn::cognito-identity:::identitypool/ When resources.type equals @@ -108,9 +113,12 @@ type AdvancedFieldSelector struct { // - arn::dynamodb:::table//stream/ When resources.type equals AWS::EC2::Snapshot // , and the operator is set to Equals or NotEquals , the ARN must be in the // following format: - // - arn::ec2:::snapshot/ When resources.type equals AWS::FinSpace::Environment , - // and the operator is set to Equals or NotEquals , the ARN must be in the - // following format: + // - arn::ec2:::snapshot/ When resources.type equals AWS::EMRWAL::Workspace , and + // the operator is set to Equals or NotEquals , the ARN must be in the following + // format: + // - arn::emrwal:::workspace/ When resources.type equals + // AWS::FinSpace::Environment , and the operator is set to Equals or NotEquals , + // the ARN must be in the following format: // - arn::finspace:::environment/ When resources.type equals AWS::Glue::Table , // and the operator is set to Equals or NotEquals , the ARN must be in the // following format: @@ -234,11 +242,14 @@ type DataResource struct { // The following resource types are also available through advanced event // selectors. Basic event selector resource types are valid in advanced event // selectors, but advanced event selector resource types are not valid in basic - // event selectors. For more information, see AdvancedFieldSelector$Field . + // event selectors. For more information, see AdvancedFieldSelector (https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html) + // . // - AWS::CloudTrail::Channel + // - AWS::CodeWhisperer::Profile // - AWS::Cognito::IdentityPool // - AWS::DynamoDB::Stream // - AWS::EC2::Snapshot + // - AWS::EMRWAL::Workspace // - AWS::FinSpace::Environment // - AWS::Glue::Table // - AWS::GuardDuty::Detector @@ -795,7 +806,7 @@ type Trail struct { // topic ARN. arn:aws:sns:us-east-2:123456789012:MyTopic SnsTopicARN *string - // This field is no longer in use. Use SnsTopicARN. + // This field is no longer in use. Use SnsTopicARN . // // Deprecated: This member has been deprecated. SnsTopicName *string diff --git a/service/cloudtrail/validators.go b/service/cloudtrail/validators.go index ef1febf34ed..96eee335527 100644 --- a/service/cloudtrail/validators.go +++ b/service/cloudtrail/validators.go @@ -210,26 +210,6 @@ func (m *validateOpDeregisterOrganizationDelegatedAdmin) HandleInitialize(ctx co return next.HandleInitialize(ctx, in) } -type validateOpDescribeQuery struct { -} - -func (*validateOpDescribeQuery) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeQuery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeQueryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeQueryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - type validateOpGetChannel struct { } @@ -670,26 +650,6 @@ func (m *validateOpStartLogging) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } -type validateOpStartQuery struct { -} - -func (*validateOpStartQuery) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartQuery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartQueryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartQueryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - type validateOpStopEventDataStoreIngestion struct { } @@ -850,10 +810,6 @@ func addOpDeregisterOrganizationDelegatedAdminValidationMiddleware(stack *middle return stack.Initialize.Add(&validateOpDeregisterOrganizationDelegatedAdmin{}, middleware.After) } -func addOpDescribeQueryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeQuery{}, middleware.After) -} - func addOpGetChannelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetChannel{}, middleware.After) } @@ -942,10 +898,6 @@ func addOpStartLoggingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartLogging{}, middleware.After) } -func addOpStartQueryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartQuery{}, middleware.After) -} - func addOpStopEventDataStoreIngestionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopEventDataStoreIngestion{}, middleware.After) } @@ -1370,21 +1322,6 @@ func validateOpDeregisterOrganizationDelegatedAdminInput(v *DeregisterOrganizati } } -func validateOpDescribeQueryInput(v *DescribeQueryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeQueryInput"} - if v.QueryId == nil { - invalidParams.Add(smithy.NewErrParamRequired("QueryId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpGetChannelInput(v *GetChannelInput) error { if v == nil { return nil @@ -1737,21 +1674,6 @@ func validateOpStartLoggingInput(v *StartLoggingInput) error { } } -func validateOpStartQueryInput(v *StartQueryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartQueryInput"} - if v.QueryStatement == nil { - invalidParams.Add(smithy.NewErrParamRequired("QueryStatement")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpStopEventDataStoreIngestionInput(v *StopEventDataStoreIngestionInput) error { if v == nil { return nil diff --git a/service/codegurusecurity/LICENSE.txt b/service/codegurusecurity/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/codegurusecurity/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/codegurusecurity/api_client.go b/service/codegurusecurity/api_client.go new file mode 100644 index 00000000000..7b92d44aba4 --- /dev/null +++ b/service/codegurusecurity/api_client.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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 = "CodeGuru Security" +const ServiceAPIVersion = "2018-05-10" + +// Client provides the API client to make operations call for Amazon CodeGuru +// Security. +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, "codegurusecurity", 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) +} diff --git a/service/codegurusecurity/api_client_test.go b/service/codegurusecurity/api_client_test.go new file mode 100644 index 00000000000..8d38e7bcf7b --- /dev/null +++ b/service/codegurusecurity/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/codegurusecurity/api_op_BatchGetFindings.go b/service/codegurusecurity/api_op_BatchGetFindings.go new file mode 100644 index 00000000000..aa7059959c0 --- /dev/null +++ b/service/codegurusecurity/api_op_BatchGetFindings.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of all requested findings. +func (c *Client) BatchGetFindings(ctx context.Context, params *BatchGetFindingsInput, optFns ...func(*Options)) (*BatchGetFindingsOutput, error) { + if params == nil { + params = &BatchGetFindingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetFindings", params, optFns, c.addOperationBatchGetFindingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetFindingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetFindingsInput struct { + + // A list of finding identifiers. Each identifier consists of a scanName and a + // findingId . You retrieve the findingId when you call GetFindings . + // + // This member is required. + FindingIdentifiers []types.FindingIdentifier + + noSmithyDocumentSerde +} + +type BatchGetFindingsOutput struct { + + // A list of errors for individual findings which were not fetched. Each + // BatchGetFindingsError contains the scanName , findingId , errorCode and error + // message . + // + // This member is required. + FailedFindings []types.BatchGetFindingsError + + // A list of all requested findings. + // + // This member is required. + Findings []types.Finding + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetFindings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetFindings{}, 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 = addOpBatchGetFindingsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetFindings(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_opBatchGetFindings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "BatchGetFindings", + } +} diff --git a/service/codegurusecurity/api_op_CreateScan.go b/service/codegurusecurity/api_op_CreateScan.go new file mode 100644 index 00000000000..a661dd41d7f --- /dev/null +++ b/service/codegurusecurity/api_op_CreateScan.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use to create a scan using code uploaded to an S3 bucket. +func (c *Client) CreateScan(ctx context.Context, params *CreateScanInput, optFns ...func(*Options)) (*CreateScanOutput, error) { + if params == nil { + params = &CreateScanInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateScan", params, optFns, c.addOperationCreateScanMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateScanOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateScanInput struct { + + // The identifier for an input resource used to create a scan. + // + // This member is required. + ResourceId types.ResourceId + + // The unique name that CodeGuru Security uses to track revisions across multiple + // scans of the same resource. Only allowed for a STANDARD scan type. If not + // specified, it will be auto generated. + // + // This member is required. + ScanName *string + + // The type of analysis you want CodeGuru Security to perform in the scan, either + // Security or All . The Secuirty type only generates findings related to + // security. The All type generates both security findings and quality findings. + // Defaults to Security type if missing. + AnalysisType types.AnalysisType + + // The idempotency token for the request. Amazon CodeGuru Security uses this value + // to prevent the accidental creation of duplicate scans if there are failures and + // retries. + ClientToken *string + + // The type of scan, either Standard or Express . Defaults to Standard type if + // missing. Express scans run on limited resources and use a limited set of + // detectors to analyze your code in near-real time. Standard scans have standard + // resource limits and use the full set of detectors to analyze your code. + ScanType types.ScanType + + // An array of key-value pairs used to tag a scan. A tag is a custom attribute + // label with two parts: + // - A tag key. For example, CostCenter , Environment , or Secret . Tag keys are + // case sensitive. + // - An optional tag value field. For example, 111122223333 , Production , or a + // team name. Omitting the tag value is the same as using an empty string. Tag + // values are case sensitive. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateScanOutput struct { + + // The identifier for the resource object that contains resources that were + // scanned. + // + // This member is required. + ResourceId types.ResourceId + + // UUID that identifies the individual scan run. + // + // This member is required. + RunId *string + + // The name of the scan. + // + // This member is required. + ScanName *string + + // The current state of the scan. Returns either InProgress , Successful , or + // Failed . + // + // This member is required. + ScanState types.ScanState + + // The ARN for the scan name. + ScanNameArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateScanMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateScan{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateScan{}, 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_opCreateScanMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateScanValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateScan(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_initializeOpCreateScan struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateScan) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateScan) 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.(*CreateScanInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateScanInput ") + } + + 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_opCreateScanMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateScan{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateScan(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "CreateScan", + } +} diff --git a/service/codegurusecurity/api_op_CreateUploadUrl.go b/service/codegurusecurity/api_op_CreateUploadUrl.go new file mode 100644 index 00000000000..06390fb6a86 --- /dev/null +++ b/service/codegurusecurity/api_op_CreateUploadUrl.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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" +) + +// Generates a pre-signed URL and request headers used to upload a code resource. +// You can upload your code resource to the URL and add the request headers using +// any HTTP client. +func (c *Client) CreateUploadUrl(ctx context.Context, params *CreateUploadUrlInput, optFns ...func(*Options)) (*CreateUploadUrlOutput, error) { + if params == nil { + params = &CreateUploadUrlInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateUploadUrl", params, optFns, c.addOperationCreateUploadUrlMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateUploadUrlOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateUploadUrlInput struct { + + // The name of the scan that will use the uploaded resource. CodeGuru Security + // uses the unique scan name to track revisions across multiple scans of the same + // resource. Use this scanName when you call CreateScan on the code resource you + // upload to this URL. + // + // This member is required. + ScanName *string + + noSmithyDocumentSerde +} + +type CreateUploadUrlOutput struct { + + // The identifier for the uploaded code resource. + // + // This member is required. + CodeArtifactId *string + + // A set of key-value pairs that contain the required headers when uploading your + // resource. + // + // This member is required. + RequestHeaders map[string]string + + // A pre-signed S3 URL. You can upload the code file you want to scan and add the + // required requestHeaders using any HTTP client. + // + // This member is required. + S3Url *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateUploadUrlMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateUploadUrl{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateUploadUrl{}, 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 = addOpCreateUploadUrlValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateUploadUrl(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_opCreateUploadUrl(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "CreateUploadUrl", + } +} diff --git a/service/codegurusecurity/api_op_GetAccountConfiguration.go b/service/codegurusecurity/api_op_GetAccountConfiguration.go new file mode 100644 index 00000000000..8297e287938 --- /dev/null +++ b/service/codegurusecurity/api_op_GetAccountConfiguration.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use to get account level configuration. +func (c *Client) GetAccountConfiguration(ctx context.Context, params *GetAccountConfigurationInput, optFns ...func(*Options)) (*GetAccountConfigurationOutput, error) { + if params == nil { + params = &GetAccountConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccountConfiguration", params, optFns, c.addOperationGetAccountConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccountConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccountConfigurationInput struct { + noSmithyDocumentSerde +} + +type GetAccountConfigurationOutput struct { + + // An EncryptionConfig object that contains the KMS key ARN to use for encryption. + // By default, CodeGuru Security uses an AWS-managed key for encryption. To specify + // your own key, call UpdateAccountConfiguration . + // + // This member is required. + EncryptionConfig *types.EncryptionConfig + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccountConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAccountConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAccountConfiguration{}, 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_opGetAccountConfiguration(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_opGetAccountConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "GetAccountConfiguration", + } +} diff --git a/service/codegurusecurity/api_op_GetFindings.go b/service/codegurusecurity/api_op_GetFindings.go new file mode 100644 index 00000000000..95813ed750e --- /dev/null +++ b/service/codegurusecurity/api_op_GetFindings.go @@ -0,0 +1,236 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of all findings generated by a particular scan. +func (c *Client) GetFindings(ctx context.Context, params *GetFindingsInput, optFns ...func(*Options)) (*GetFindingsOutput, error) { + if params == nil { + params = &GetFindingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFindings", params, optFns, c.addOperationGetFindingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFindingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetFindingsInput struct { + + // The name of the scan you want to retrieve findings from. + // + // This member is required. + ScanName *string + + // The maximum number of results to return in the response. Use this parameter + // when paginating results. If additional results exist beyond the number you + // specify, the nextToken element is returned in the response. Use nextToken in a + // subsequent request to retrieve additional results. + MaxResults *int32 + + // A token to use for paginating results that are returned in the response. Set + // the value of this parameter to null for the first request. For subsequent calls, + // use the nextToken value returned from the previous request to continue listing + // results after the first page. + NextToken *string + + // The status of the findings you want to get. Pass either Open , Closed , or All . + Status types.Status + + noSmithyDocumentSerde +} + +type GetFindingsOutput struct { + + // A list of findings generated by the specified scan. + Findings []types.Finding + + // A pagination token. You can use this in future calls to GetFindings to continue + // listing results after the current page. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFindings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFindings{}, 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 = addOpGetFindingsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFindings(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 +} + +// GetFindingsAPIClient is a client that implements the GetFindings operation. +type GetFindingsAPIClient interface { + GetFindings(context.Context, *GetFindingsInput, ...func(*Options)) (*GetFindingsOutput, error) +} + +var _ GetFindingsAPIClient = (*Client)(nil) + +// GetFindingsPaginatorOptions is the paginator options for GetFindings +type GetFindingsPaginatorOptions struct { + // The maximum number of results to return in the response. Use this parameter + // when paginating results. If additional results exist beyond the number you + // specify, the nextToken element is returned in the response. Use nextToken in a + // subsequent request to retrieve additional 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 +} + +// GetFindingsPaginator is a paginator for GetFindings +type GetFindingsPaginator struct { + options GetFindingsPaginatorOptions + client GetFindingsAPIClient + params *GetFindingsInput + nextToken *string + firstPage bool +} + +// NewGetFindingsPaginator returns a new GetFindingsPaginator +func NewGetFindingsPaginator(client GetFindingsAPIClient, params *GetFindingsInput, optFns ...func(*GetFindingsPaginatorOptions)) *GetFindingsPaginator { + if params == nil { + params = &GetFindingsInput{} + } + + options := GetFindingsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFindingsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetFindings page. +func (p *GetFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFindingsOutput, 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.GetFindings(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_opGetFindings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "GetFindings", + } +} diff --git a/service/codegurusecurity/api_op_GetMetricsSummary.go b/service/codegurusecurity/api_op_GetMetricsSummary.go new file mode 100644 index 00000000000..eb5c8d24c4f --- /dev/null +++ b/service/codegurusecurity/api_op_GetMetricsSummary.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns top level metrics about an account from a specified date, including +// number of open findings, the categories with most findings, the scans with most +// open findings, and scans with most open critical findings. +func (c *Client) GetMetricsSummary(ctx context.Context, params *GetMetricsSummaryInput, optFns ...func(*Options)) (*GetMetricsSummaryOutput, error) { + if params == nil { + params = &GetMetricsSummaryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetMetricsSummary", params, optFns, c.addOperationGetMetricsSummaryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetMetricsSummaryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetMetricsSummaryInput struct { + + // The date you want to retrieve summary metrics from, rounded to the nearest day. + // The date must be within the past two years since metrics data is only stored for + // two years. If a date outside of this range is passed, the response will be + // empty. + // + // This member is required. + Date *time.Time + + noSmithyDocumentSerde +} + +type GetMetricsSummaryOutput struct { + + // The summary metrics from the specified date. + MetricsSummary *types.MetricsSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetMetricsSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMetricsSummary{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMetricsSummary{}, 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 = addOpGetMetricsSummaryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMetricsSummary(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_opGetMetricsSummary(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "GetMetricsSummary", + } +} diff --git a/service/codegurusecurity/api_op_GetScan.go b/service/codegurusecurity/api_op_GetScan.go new file mode 100644 index 00000000000..e79b4ae17e7 --- /dev/null +++ b/service/codegurusecurity/api_op_GetScan.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns details about a scan, including whether or not a scan has completed. +func (c *Client) GetScan(ctx context.Context, params *GetScanInput, optFns ...func(*Options)) (*GetScanOutput, error) { + if params == nil { + params = &GetScanInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetScan", params, optFns, c.addOperationGetScanMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetScanOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetScanInput struct { + + // The name of the scan you want to view details about. + // + // This member is required. + ScanName *string + + // UUID that identifies the individual scan run you want to view details about. + // You retrieve this when you call the CreateScan operation. Defaults to the + // latest scan run if missing. + RunId *string + + noSmithyDocumentSerde +} + +type GetScanOutput struct { + + // The type of analysis CodeGuru Security performed in the scan, either Security + // or All . The Security type only generates findings related to security. The All + // type generates both security findings and quality findings. + // + // This member is required. + AnalysisType types.AnalysisType + + // The time the scan was created. + // + // This member is required. + CreatedAt *time.Time + + // UUID that identifies the individual scan run. + // + // This member is required. + RunId *string + + // The name of the scan. + // + // This member is required. + ScanName *string + + // The current state of the scan. Pass either InProgress , Successful , or Failed . + // + // This member is required. + ScanState types.ScanState + + // The number of times a scan has been re-run on a revised resource. + NumberOfRevisions *int64 + + // The ARN for the scan name. + ScanNameArn *string + + // The time when the scan was last updated. Only available for STANDARD scan types. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetScanMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetScan{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetScan{}, 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 = addOpGetScanValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetScan(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_opGetScan(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "GetScan", + } +} diff --git a/service/codegurusecurity/api_op_ListFindingsMetrics.go b/service/codegurusecurity/api_op_ListFindingsMetrics.go new file mode 100644 index 00000000000..8d8c7695be2 --- /dev/null +++ b/service/codegurusecurity/api_op_ListFindingsMetrics.go @@ -0,0 +1,242 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns metrics about all findings in an account within a specified time range. +func (c *Client) ListFindingsMetrics(ctx context.Context, params *ListFindingsMetricsInput, optFns ...func(*Options)) (*ListFindingsMetricsOutput, error) { + if params == nil { + params = &ListFindingsMetricsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFindingsMetrics", params, optFns, c.addOperationListFindingsMetricsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFindingsMetricsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFindingsMetricsInput struct { + + // The end date of the interval which you want to retrieve metrics from. + // + // This member is required. + EndDate *time.Time + + // The start date of the interval which you want to retrieve metrics from. + // + // This member is required. + StartDate *time.Time + + // The maximum number of results to return in the response. Use this parameter + // when paginating results. If additional results exist beyond the number you + // specify, the nextToken element is returned in the response. Use nextToken in a + // subsequent request to retrieve additional results. + MaxResults *int32 + + // A token to use for paginating results that are returned in the response. Set + // the value of this parameter to null for the first request. For subsequent calls, + // use the nextToken value returned from the previous request to continue listing + // results after the first page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListFindingsMetricsOutput struct { + + // A list of AccountFindingsMetric objects retrieved from the specified time + // interval. + FindingsMetrics []types.AccountFindingsMetric + + // A pagination token. You can use this in future calls to ListFindingMetrics to + // continue listing results after the current page. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFindingsMetricsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListFindingsMetrics{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFindingsMetrics{}, 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 = addOpListFindingsMetricsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFindingsMetrics(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 +} + +// ListFindingsMetricsAPIClient is a client that implements the +// ListFindingsMetrics operation. +type ListFindingsMetricsAPIClient interface { + ListFindingsMetrics(context.Context, *ListFindingsMetricsInput, ...func(*Options)) (*ListFindingsMetricsOutput, error) +} + +var _ ListFindingsMetricsAPIClient = (*Client)(nil) + +// ListFindingsMetricsPaginatorOptions is the paginator options for +// ListFindingsMetrics +type ListFindingsMetricsPaginatorOptions struct { + // The maximum number of results to return in the response. Use this parameter + // when paginating results. If additional results exist beyond the number you + // specify, the nextToken element is returned in the response. Use nextToken in a + // subsequent request to retrieve additional 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 +} + +// ListFindingsMetricsPaginator is a paginator for ListFindingsMetrics +type ListFindingsMetricsPaginator struct { + options ListFindingsMetricsPaginatorOptions + client ListFindingsMetricsAPIClient + params *ListFindingsMetricsInput + nextToken *string + firstPage bool +} + +// NewListFindingsMetricsPaginator returns a new ListFindingsMetricsPaginator +func NewListFindingsMetricsPaginator(client ListFindingsMetricsAPIClient, params *ListFindingsMetricsInput, optFns ...func(*ListFindingsMetricsPaginatorOptions)) *ListFindingsMetricsPaginator { + if params == nil { + params = &ListFindingsMetricsInput{} + } + + options := ListFindingsMetricsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFindingsMetricsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsMetricsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListFindingsMetrics page. +func (p *ListFindingsMetricsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsMetricsOutput, 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.ListFindingsMetrics(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_opListFindingsMetrics(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "ListFindingsMetrics", + } +} diff --git a/service/codegurusecurity/api_op_ListScans.go b/service/codegurusecurity/api_op_ListScans.go new file mode 100644 index 00000000000..5de53c43c85 --- /dev/null +++ b/service/codegurusecurity/api_op_ListScans.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of all the scans in an account. +func (c *Client) ListScans(ctx context.Context, params *ListScansInput, optFns ...func(*Options)) (*ListScansOutput, error) { + if params == nil { + params = &ListScansInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListScans", params, optFns, c.addOperationListScansMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListScansOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListScansInput struct { + + // The maximum number of results to return in the response. Use this parameter + // when paginating results. If additional results exist beyond the number you + // specify, the nextToken element is returned in the response. Use nextToken in a + // subsequent request to retrieve additional results. + MaxResults *int32 + + // A token to use for paginating results that are returned in the response. Set + // the value of this parameter to null for the first request. For subsequent calls, + // use the nextToken value returned from the previous request to continue listing + // results after the first page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListScansOutput struct { + + // A pagination token. You can use this in future calls to ListScans to continue + // listing results after the current page. + NextToken *string + + // A list of ScanSummary objects with information about all scans in an account. + Summaries []types.ScanSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListScansMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListScans{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListScans{}, 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_opListScans(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 +} + +// ListScansAPIClient is a client that implements the ListScans operation. +type ListScansAPIClient interface { + ListScans(context.Context, *ListScansInput, ...func(*Options)) (*ListScansOutput, error) +} + +var _ ListScansAPIClient = (*Client)(nil) + +// ListScansPaginatorOptions is the paginator options for ListScans +type ListScansPaginatorOptions struct { + // The maximum number of results to return in the response. Use this parameter + // when paginating results. If additional results exist beyond the number you + // specify, the nextToken element is returned in the response. Use nextToken in a + // subsequent request to retrieve additional 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 +} + +// ListScansPaginator is a paginator for ListScans +type ListScansPaginator struct { + options ListScansPaginatorOptions + client ListScansAPIClient + params *ListScansInput + nextToken *string + firstPage bool +} + +// NewListScansPaginator returns a new ListScansPaginator +func NewListScansPaginator(client ListScansAPIClient, params *ListScansInput, optFns ...func(*ListScansPaginatorOptions)) *ListScansPaginator { + if params == nil { + params = &ListScansInput{} + } + + options := ListScansPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListScansPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScansPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListScans page. +func (p *ListScansPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScansOutput, 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.ListScans(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_opListScans(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "ListScans", + } +} diff --git a/service/codegurusecurity/api_op_ListTagsForResource.go b/service/codegurusecurity/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..f314cdd4caa --- /dev/null +++ b/service/codegurusecurity/api_op_ListTagsForResource.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of all tags associated with a scan. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the ScanName object. You can retrieve this ARN by calling ListScans + // or GetScan . + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // An array of key-value pairs used to tag an existing scan. A tag is a custom + // attribute label with two parts: + // - A tag key. For example, CostCenter , Environment , or Secret . Tag keys are + // case sensitive. + // - An optional tag value field. For example, 111122223333 , Production , or a + // team name. Omitting the tag value is the same as using an empty string. Tag + // values are case sensitive. + 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: "codeguru-security", + OperationName: "ListTagsForResource", + } +} diff --git a/service/codegurusecurity/api_op_TagResource.go b/service/codegurusecurity/api_op_TagResource.go new file mode 100644 index 00000000000..d352d4e19f0 --- /dev/null +++ b/service/codegurusecurity/api_op_TagResource.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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" +) + +// Use to add one or more tags to an existing scan. +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 ARN of the ScanName object. You can retrieve this ARN by calling ListScans + // or GetScan . + // + // This member is required. + ResourceArn *string + + // An array of key-value pairs used to tag an existing scan. A tag is a custom + // attribute label with two parts: + // - A tag key. For example, CostCenter , Environment , or Secret . Tag keys are + // case sensitive. + // - An optional tag value field. For example, 111122223333 , Production , or a + // team name. Omitting the tag value is the same as using an empty string. Tag + // values are case sensitive. + // + // 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: "codeguru-security", + OperationName: "TagResource", + } +} diff --git a/service/codegurusecurity/api_op_UntagResource.go b/service/codegurusecurity/api_op_UntagResource.go new file mode 100644 index 00000000000..9df460e31b9 --- /dev/null +++ b/service/codegurusecurity/api_op_UntagResource.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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" +) + +// Use to remove one or more tags from an existing scan. +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 ARN of the ScanName object. You can retrieve this ARN by calling ListScans + // or GetScan . + // + // This member is required. + ResourceArn *string + + // A list of keys for each tag you want to remove from a scan. + // + // 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: "codeguru-security", + OperationName: "UntagResource", + } +} diff --git a/service/codegurusecurity/api_op_UpdateAccountConfiguration.go b/service/codegurusecurity/api_op_UpdateAccountConfiguration.go new file mode 100644 index 00000000000..9923ea6d6f8 --- /dev/null +++ b/service/codegurusecurity/api_op_UpdateAccountConfiguration.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use to update account-level configuration with an encryption key. +func (c *Client) UpdateAccountConfiguration(ctx context.Context, params *UpdateAccountConfigurationInput, optFns ...func(*Options)) (*UpdateAccountConfigurationOutput, error) { + if params == nil { + params = &UpdateAccountConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAccountConfiguration", params, optFns, c.addOperationUpdateAccountConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAccountConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAccountConfigurationInput struct { + + // The KMS key ARN you want to use for encryption. Defaults to service-side + // encryption if missing. + // + // This member is required. + EncryptionConfig *types.EncryptionConfig + + noSmithyDocumentSerde +} + +type UpdateAccountConfigurationOutput struct { + + // An EncryptionConfig object that contains the KMS key ARN to use for encryption. + // + // This member is required. + EncryptionConfig *types.EncryptionConfig + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAccountConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAccountConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAccountConfiguration{}, 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 = addOpUpdateAccountConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccountConfiguration(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_opUpdateAccountConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "codeguru-security", + OperationName: "UpdateAccountConfiguration", + } +} diff --git a/service/codegurusecurity/deserializers.go b/service/codegurusecurity/deserializers.go new file mode 100644 index 00000000000..1da51432f56 --- /dev/null +++ b/service/codegurusecurity/deserializers.go @@ -0,0 +1,4541 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/codegurusecurity/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_deserializeOpBatchGetFindings struct { +} + +func (*awsRestjson1_deserializeOpBatchGetFindings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchGetFindings) HandleDeserialize(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_deserializeOpErrorBatchGetFindings(response, &metadata) + } + output := &BatchGetFindingsOutput{} + 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_deserializeOpDocumentBatchGetFindingsOutput(&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_deserializeOpErrorBatchGetFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentBatchGetFindingsOutput(v **BatchGetFindingsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchGetFindingsOutput + if *v == nil { + sv = &BatchGetFindingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failedFindings": + if err := awsRestjson1_deserializeDocumentBatchGetFindingsErrors(&sv.FailedFindings, value); err != nil { + return err + } + + case "findings": + if err := awsRestjson1_deserializeDocumentFindings(&sv.Findings, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateScan struct { +} + +func (*awsRestjson1_deserializeOpCreateScan) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateScan) HandleDeserialize(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_deserializeOpErrorCreateScan(response, &metadata) + } + output := &CreateScanOutput{} + 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_deserializeOpDocumentCreateScanOutput(&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_deserializeOpErrorCreateScan(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentCreateScanOutput(v **CreateScanOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateScanOutput + if *v == nil { + sv = &CreateScanOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "resourceId": + if err := awsRestjson1_deserializeDocumentResourceId(&sv.ResourceId, value); err != nil { + return err + } + + case "runId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.RunId = ptr.String(jtv) + } + + case "scanName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanName to be of type string, got %T instead", value) + } + sv.ScanName = ptr.String(jtv) + } + + case "scanNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanNameArn to be of type string, got %T instead", value) + } + sv.ScanNameArn = ptr.String(jtv) + } + + case "scanState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanState to be of type string, got %T instead", value) + } + sv.ScanState = types.ScanState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateUploadUrl struct { +} + +func (*awsRestjson1_deserializeOpCreateUploadUrl) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateUploadUrl) HandleDeserialize(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_deserializeOpErrorCreateUploadUrl(response, &metadata) + } + output := &CreateUploadUrlOutput{} + 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_deserializeOpDocumentCreateUploadUrlOutput(&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_deserializeOpErrorCreateUploadUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentCreateUploadUrlOutput(v **CreateUploadUrlOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateUploadUrlOutput + if *v == nil { + sv = &CreateUploadUrlOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "codeArtifactId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.CodeArtifactId = ptr.String(jtv) + } + + case "requestHeaders": + if err := awsRestjson1_deserializeDocumentRequestHeaderMap(&sv.RequestHeaders, value); err != nil { + return err + } + + case "s3Url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) + } + sv.S3Url = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetAccountConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetAccountConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAccountConfiguration) HandleDeserialize(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_deserializeOpErrorGetAccountConfiguration(response, &metadata) + } + output := &GetAccountConfigurationOutput{} + 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_deserializeOpDocumentGetAccountConfigurationOutput(&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_deserializeOpErrorGetAccountConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentGetAccountConfigurationOutput(v **GetAccountConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetAccountConfigurationOutput + if *v == nil { + sv = &GetAccountConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "encryptionConfig": + if err := awsRestjson1_deserializeDocumentEncryptionConfig(&sv.EncryptionConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetFindings struct { +} + +func (*awsRestjson1_deserializeOpGetFindings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetFindings) HandleDeserialize(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_deserializeOpErrorGetFindings(response, &metadata) + } + output := &GetFindingsOutput{} + 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_deserializeOpDocumentGetFindingsOutput(&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_deserializeOpErrorGetFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentGetFindingsOutput(v **GetFindingsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetFindingsOutput + if *v == nil { + sv = &GetFindingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "findings": + if err := awsRestjson1_deserializeDocumentFindings(&sv.Findings, 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_deserializeOpGetMetricsSummary struct { +} + +func (*awsRestjson1_deserializeOpGetMetricsSummary) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetMetricsSummary) HandleDeserialize(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_deserializeOpErrorGetMetricsSummary(response, &metadata) + } + output := &GetMetricsSummaryOutput{} + 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_deserializeOpDocumentGetMetricsSummaryOutput(&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_deserializeOpErrorGetMetricsSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentGetMetricsSummaryOutput(v **GetMetricsSummaryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetMetricsSummaryOutput + if *v == nil { + sv = &GetMetricsSummaryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "metricsSummary": + if err := awsRestjson1_deserializeDocumentMetricsSummary(&sv.MetricsSummary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetScan struct { +} + +func (*awsRestjson1_deserializeOpGetScan) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetScan) HandleDeserialize(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_deserializeOpErrorGetScan(response, &metadata) + } + output := &GetScanOutput{} + 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_deserializeOpDocumentGetScanOutput(&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_deserializeOpErrorGetScan(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetScanOutput(v **GetScanOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetScanOutput + if *v == nil { + sv = &GetScanOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "analysisType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnalysisType to be of type string, got %T instead", value) + } + sv.AnalysisType = types.AnalysisType(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "numberOfRevisions": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfRevisions = ptr.Int64(i64) + } + + case "runId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.RunId = ptr.String(jtv) + } + + case "scanName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanName to be of type string, got %T instead", value) + } + sv.ScanName = ptr.String(jtv) + } + + case "scanNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanNameArn to be of type string, got %T instead", value) + } + sv.ScanNameArn = ptr.String(jtv) + } + + case "scanState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanState to be of type string, got %T instead", value) + } + sv.ScanState = types.ScanState(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListFindingsMetrics struct { +} + +func (*awsRestjson1_deserializeOpListFindingsMetrics) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListFindingsMetrics) HandleDeserialize(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_deserializeOpErrorListFindingsMetrics(response, &metadata) + } + output := &ListFindingsMetricsOutput{} + 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_deserializeOpDocumentListFindingsMetricsOutput(&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_deserializeOpErrorListFindingsMetrics(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentListFindingsMetricsOutput(v **ListFindingsMetricsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFindingsMetricsOutput + if *v == nil { + sv = &ListFindingsMetricsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "findingsMetrics": + if err := awsRestjson1_deserializeDocumentFindingsMetricList(&sv.FindingsMetrics, 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_deserializeOpListScans struct { +} + +func (*awsRestjson1_deserializeOpListScans) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListScans) HandleDeserialize(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_deserializeOpErrorListScans(response, &metadata) + } + output := &ListScansOutput{} + 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_deserializeOpDocumentListScansOutput(&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_deserializeOpErrorListScans(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentListScansOutput(v **ListScansOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListScansOutput + if *v == nil { + sv = &ListScansOutput{} + } 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 "summaries": + if err := awsRestjson1_deserializeDocumentScanSummaries(&sv.Summaries, 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("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_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_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("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 + + } +} + +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("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 + + } +} + +type awsRestjson1_deserializeOpUpdateAccountConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateAccountConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAccountConfiguration) HandleDeserialize(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_deserializeOpErrorUpdateAccountConfiguration(response, &metadata) + } + output := &UpdateAccountConfigurationOutput{} + 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_deserializeOpDocumentUpdateAccountConfigurationOutput(&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_deserializeOpErrorUpdateAccountConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentUpdateAccountConfigurationOutput(v **UpdateAccountConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAccountConfigurationOutput + if *v == nil { + sv = &UpdateAccountConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "encryptionConfig": + if err := awsRestjson1_deserializeDocumentEncryptionConfig(&sv.EncryptionConfig, 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_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 "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountFindingsMetric(v **types.AccountFindingsMetric, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AccountFindingsMetric + if *v == nil { + sv = &types.AccountFindingsMetric{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "closedFindings": + if err := awsRestjson1_deserializeDocumentFindingMetricsValuePerSeverity(&sv.ClosedFindings, value); err != nil { + return err + } + + case "date": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "meanTimeToClose": + if err := awsRestjson1_deserializeDocumentFindingMetricsValuePerSeverity(&sv.MeanTimeToClose, value); err != nil { + return err + } + + case "newFindings": + if err := awsRestjson1_deserializeDocumentFindingMetricsValuePerSeverity(&sv.NewFindings, value); err != nil { + return err + } + + case "openFindings": + if err := awsRestjson1_deserializeDocumentFindingMetricsValuePerSeverity(&sv.OpenFindings, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchGetFindingsError(v **types.BatchGetFindingsError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.BatchGetFindingsError + if *v == nil { + sv = &types.BatchGetFindingsError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.ErrorCode(jtv) + } + + case "findingId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FindingId = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "scanName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanName to be of type string, got %T instead", value) + } + sv.ScanName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchGetFindingsErrors(v *[]types.BatchGetFindingsError, 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.BatchGetFindingsError + if *v == nil { + cv = []types.BatchGetFindingsError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchGetFindingsError + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchGetFindingsError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCategoriesWithMostFindings(v *[]types.CategoryWithFindingNum, 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.CategoryWithFindingNum + if *v == nil { + cv = []types.CategoryWithFindingNum{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CategoryWithFindingNum + destAddr := &col + if err := awsRestjson1_deserializeDocumentCategoryWithFindingNum(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCategoryWithFindingNum(v **types.CategoryWithFindingNum, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CategoryWithFindingNum + if *v == nil { + sv = &types.CategoryWithFindingNum{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "categoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CategoryName = ptr.String(jtv) + } + + case "findingNumber": + 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.FindingNumber = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCodeLine(v **types.CodeLine, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CodeLine + if *v == nil { + sv = &types.CodeLine{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "content": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Content = ptr.String(jtv) + } + + case "number": + 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.Number = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCodeSnippet(v *[]types.CodeLine, 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.CodeLine + if *v == nil { + cv = []types.CodeLine{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CodeLine + destAddr := &col + if err := awsRestjson1_deserializeDocumentCodeLine(&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 "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDetectorTags(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEncryptionConfig(v **types.EncryptionConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EncryptionConfig + if *v == nil { + sv = &types.EncryptionConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "kmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFilePath(v **types.FilePath, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FilePath + if *v == nil { + sv = &types.FilePath{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "codeSnippet": + if err := awsRestjson1_deserializeDocumentCodeSnippet(&sv.CodeSnippet, value); err != nil { + return err + } + + case "endLine": + 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.EndLine = ptr.Int32(int32(i64)) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "path": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Path = ptr.String(jtv) + } + + case "startLine": + 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.StartLine = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFinding(v **types.Finding, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Finding + if *v == nil { + sv = &types.Finding{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "detectorId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DetectorId = ptr.String(jtv) + } + + case "detectorName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DetectorName = ptr.String(jtv) + } + + case "detectorTags": + if err := awsRestjson1_deserializeDocumentDetectorTags(&sv.DetectorTags, value); err != nil { + return err + } + + case "generatorId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.GeneratorId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "remediation": + if err := awsRestjson1_deserializeDocumentRemediation(&sv.Remediation, value); err != nil { + return err + } + + case "resource": + if err := awsRestjson1_deserializeDocumentResource(&sv.Resource, value); err != nil { + return err + } + + case "ruleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RuleId = ptr.String(jtv) + } + + case "severity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Severity to be of type string, got %T instead", value) + } + sv.Severity = types.Severity(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Status to be of type string, got %T instead", value) + } + sv.Status = types.Status(jtv) + } + + case "title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "vulnerability": + if err := awsRestjson1_deserializeDocumentVulnerability(&sv.Vulnerability, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFindingMetricsValuePerSeverity(v **types.FindingMetricsValuePerSeverity, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FindingMetricsValuePerSeverity + if *v == nil { + sv = &types.FindingMetricsValuePerSeverity{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "critical": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Critical = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Critical = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "high": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.High = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.High = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "info": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Info = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Info = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "low": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Low = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Low = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "medium": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Medium = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Medium = ptr.Float64(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_deserializeDocumentFindings(v *[]types.Finding, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Finding + if *v == nil { + cv = []types.Finding{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Finding + destAddr := &col + if err := awsRestjson1_deserializeDocumentFinding(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFindingsMetricList(v *[]types.AccountFindingsMetric, 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.AccountFindingsMetric + if *v == nil { + cv = []types.AccountFindingsMetric{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountFindingsMetric + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccountFindingsMetric(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMetricsSummary(v **types.MetricsSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.MetricsSummary + if *v == nil { + sv = &types.MetricsSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "categoriesWithMostFindings": + if err := awsRestjson1_deserializeDocumentCategoriesWithMostFindings(&sv.CategoriesWithMostFindings, value); err != nil { + return err + } + + case "date": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "openFindings": + if err := awsRestjson1_deserializeDocumentFindingMetricsValuePerSeverity(&sv.OpenFindings, value); err != nil { + return err + } + + case "scansWithMostOpenCriticalFindings": + if err := awsRestjson1_deserializeDocumentScansWithMostOpenCriticalFindings(&sv.ScansWithMostOpenCriticalFindings, value); err != nil { + return err + } + + case "scansWithMostOpenFindings": + if err := awsRestjson1_deserializeDocumentScansWithMostOpenFindings(&sv.ScansWithMostOpenFindings, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Recommendation + if *v == nil { + sv = &types.Recommendation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentReferenceUrls(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRelatedVulnerabilities(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRemediation(v **types.Remediation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Remediation + if *v == nil { + sv = &types.Remediation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "recommendation": + if err := awsRestjson1_deserializeDocumentRecommendation(&sv.Recommendation, value); err != nil { + return err + } + + case "suggestedFixes": + if err := awsRestjson1_deserializeDocumentSuggestedFixes(&sv.SuggestedFixes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRequestHeaderMap(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 HeaderValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentResource(v **types.Resource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Resource + if *v == nil { + sv = &types.Resource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "subResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceId(v *types.ResourceId, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.ResourceId +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "codeArtifactId": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.ResourceIdMemberCodeArtifactId{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + 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 "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentScanNameWithFindingNum(v **types.ScanNameWithFindingNum, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ScanNameWithFindingNum + if *v == nil { + sv = &types.ScanNameWithFindingNum{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "findingNumber": + 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.FindingNumber = ptr.Int32(int32(i64)) + } + + case "scanName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ScanName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentScanSummaries(v *[]types.ScanSummary, 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.ScanSummary + if *v == nil { + cv = []types.ScanSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ScanSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentScanSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentScanSummary(v **types.ScanSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ScanSummary + if *v == nil { + sv = &types.ScanSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "runId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.RunId = ptr.String(jtv) + } + + case "scanName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanName to be of type string, got %T instead", value) + } + sv.ScanName = ptr.String(jtv) + } + + case "scanNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanNameArn to be of type string, got %T instead", value) + } + sv.ScanNameArn = ptr.String(jtv) + } + + case "scanState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScanState to be of type string, got %T instead", value) + } + sv.ScanState = types.ScanState(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentScansWithMostOpenCriticalFindings(v *[]types.ScanNameWithFindingNum, 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.ScanNameWithFindingNum + if *v == nil { + cv = []types.ScanNameWithFindingNum{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ScanNameWithFindingNum + destAddr := &col + if err := awsRestjson1_deserializeDocumentScanNameWithFindingNum(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentScansWithMostOpenFindings(v *[]types.ScanNameWithFindingNum, 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.ScanNameWithFindingNum + if *v == nil { + cv = []types.ScanNameWithFindingNum{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ScanNameWithFindingNum + destAddr := &col + if err := awsRestjson1_deserializeDocumentScanNameWithFindingNum(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSuggestedFix(v **types.SuggestedFix, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SuggestedFix + if *v == nil { + sv = &types.SuggestedFix{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuggestedFixes(v *[]types.SuggestedFix, 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.SuggestedFix + if *v == nil { + cv = []types.SuggestedFix{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SuggestedFix + destAddr := &col + if err := awsRestjson1_deserializeDocumentSuggestedFix(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVulnerability(v **types.Vulnerability, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Vulnerability + if *v == nil { + sv = &types.Vulnerability{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "filePath": + if err := awsRestjson1_deserializeDocumentFilePath(&sv.FilePath, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "itemCount": + 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.ItemCount = ptr.Int32(int32(i64)) + } + + case "referenceUrls": + if err := awsRestjson1_deserializeDocumentReferenceUrls(&sv.ReferenceUrls, value); err != nil { + return err + } + + case "relatedVulnerabilities": + if err := awsRestjson1_deserializeDocumentRelatedVulnerabilities(&sv.RelatedVulnerabilities, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/codegurusecurity/doc.go b/service/codegurusecurity/doc.go new file mode 100644 index 00000000000..62952651a1d --- /dev/null +++ b/service/codegurusecurity/doc.go @@ -0,0 +1,14 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package codegurusecurity provides the API client, operations, and parameter +// types for Amazon CodeGuru Security. +// +// This section provides documentation for the Amazon CodeGuru Security (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/codeguru/latest/security-ug/what-is-codeguru-security.html) +// API operations. CodeGuru Security is a service that uses program analysis and +// machine learning to detect security policy violations and vulnerabilities, and +// recommends ways to address these security risks. By proactively detecting and +// providing recommendations for addressing security risks, CodeGuru Security +// improves the overall security of your application code. For more information +// about CodeGuru Security, see the Amazon CodeGuru Security User Guide (https://docs.aws.amazon.com/codeguru/latest/security-ug/what-is-codeguru-security.html) +// . +package codegurusecurity diff --git a/service/codegurusecurity/endpoints.go b/service/codegurusecurity/endpoints.go new file mode 100644 index 00000000000..3c41601654a --- /dev/null +++ b/service/codegurusecurity/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +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/codegurusecurity/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 = "codeguru-security" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} diff --git a/service/codegurusecurity/generated.json b/service/codegurusecurity/generated.json new file mode 100644 index 00000000000..ab0d423eb6f --- /dev/null +++ b/service/codegurusecurity/generated.json @@ -0,0 +1,41 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_BatchGetFindings.go", + "api_op_CreateScan.go", + "api_op_CreateUploadUrl.go", + "api_op_GetAccountConfiguration.go", + "api_op_GetFindings.go", + "api_op_GetMetricsSummary.go", + "api_op_GetScan.go", + "api_op_ListFindingsMetrics.go", + "api_op_ListScans.go", + "api_op_ListTagsForResource.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateAccountConfiguration.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "types/types_exported_test.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/codegurusecurity", + "unstable": false +} diff --git a/service/codegurusecurity/go.mod b/service/codegurusecurity/go.mod new file mode 100644 index 00000000000..4e9a2f2da61 --- /dev/null +++ b/service/codegurusecurity/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/codegurusecurity + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.18.0 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 + github.com/aws/smithy-go v1.13.5 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/codegurusecurity/go.sum b/service/codegurusecurity/go.sum new file mode 100644 index 00000000000..6f859610e44 --- /dev/null +++ b/service/codegurusecurity/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= +github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/codegurusecurity/go_module_metadata.go b/service/codegurusecurity/go_module_metadata.go new file mode 100644 index 00000000000..e8eafcce849 --- /dev/null +++ b/service/codegurusecurity/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package codegurusecurity + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/codegurusecurity/internal/endpoints/endpoints.go b/service/codegurusecurity/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..a452fac1de8 --- /dev/null +++ b/service/codegurusecurity/internal/endpoints/endpoints.go @@ -0,0 +1,273 @@ +// 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 CodeGuru Security 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 + 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+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "codeguru-security.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "codeguru-security-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "codeguru-security-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codeguru-security.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "codeguru-security.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "codeguru-security-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "codeguru-security-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codeguru-security.{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: "codeguru-security-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codeguru-security.{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: "codeguru-security-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codeguru-security.{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: "codeguru-security-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codeguru-security.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "codeguru-security.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "codeguru-security-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "codeguru-security-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codeguru-security.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/codegurusecurity/internal/endpoints/endpoints_test.go b/service/codegurusecurity/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/codegurusecurity/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/codegurusecurity/protocol_test.go b/service/codegurusecurity/protocol_test.go new file mode 100644 index 00000000000..6655f54d5a2 --- /dev/null +++ b/service/codegurusecurity/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity diff --git a/service/codegurusecurity/serializers.go b/service/codegurusecurity/serializers.go new file mode 100644 index 00000000000..7b0f73b4158 --- /dev/null +++ b/service/codegurusecurity/serializers.go @@ -0,0 +1,947 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/codegurusecurity/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpBatchGetFindings struct { +} + +func (*awsRestjson1_serializeOpBatchGetFindings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchGetFindings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetFindingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/batchGetFindings") + 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_serializeOpDocumentBatchGetFindingsInput(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_serializeOpHttpBindingsBatchGetFindingsInput(v *BatchGetFindingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchGetFindingsInput(v *BatchGetFindingsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FindingIdentifiers != nil { + ok := object.Key("findingIdentifiers") + if err := awsRestjson1_serializeDocumentFindingIdentifiers(v.FindingIdentifiers, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateScan struct { +} + +func (*awsRestjson1_serializeOpCreateScan) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateScan) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateScanInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scans") + 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_serializeOpDocumentCreateScanInput(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_serializeOpHttpBindingsCreateScanInput(v *CreateScanInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateScanInput(v *CreateScanInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AnalysisType) > 0 { + ok := object.Key("analysisType") + ok.String(string(v.AnalysisType)) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.ResourceId != nil { + ok := object.Key("resourceId") + if err := awsRestjson1_serializeDocumentResourceId(v.ResourceId, ok); err != nil { + return err + } + } + + if v.ScanName != nil { + ok := object.Key("scanName") + ok.String(*v.ScanName) + } + + if len(v.ScanType) > 0 { + ok := object.Key("scanType") + ok.String(string(v.ScanType)) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateUploadUrl struct { +} + +func (*awsRestjson1_serializeOpCreateUploadUrl) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateUploadUrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateUploadUrlInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/uploadUrl") + 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_serializeOpDocumentCreateUploadUrlInput(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_serializeOpHttpBindingsCreateUploadUrlInput(v *CreateUploadUrlInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateUploadUrlInput(v *CreateUploadUrlInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ScanName != nil { + ok := object.Key("scanName") + ok.String(*v.ScanName) + } + + return nil +} + +type awsRestjson1_serializeOpGetAccountConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetAccountConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAccountConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAccountConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accountConfiguration/get") + 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 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_serializeOpHttpBindingsGetAccountConfigurationInput(v *GetAccountConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpGetFindings struct { +} + +func (*awsRestjson1_serializeOpGetFindings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetFindings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetFindingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/findings/{scanName}") + 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_serializeOpHttpBindingsGetFindingsInput(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_serializeOpHttpBindingsGetFindingsInput(v *GetFindingsInput, 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.ScanName == nil || len(*v.ScanName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member scanName must not be empty")} + } + if v.ScanName != nil { + if err := encoder.SetURI("scanName").String(*v.ScanName); err != nil { + return err + } + } + + if len(v.Status) > 0 { + encoder.SetQuery("status").String(string(v.Status)) + } + + return nil +} + +type awsRestjson1_serializeOpGetMetricsSummary struct { +} + +func (*awsRestjson1_serializeOpGetMetricsSummary) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetMetricsSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetMetricsSummaryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/metrics/summary") + 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_serializeOpHttpBindingsGetMetricsSummaryInput(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_serializeOpHttpBindingsGetMetricsSummaryInput(v *GetMetricsSummaryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Date != nil { + encoder.SetQuery("date").String(smithytime.FormatDateTime(*v.Date)) + } + + return nil +} + +type awsRestjson1_serializeOpGetScan struct { +} + +func (*awsRestjson1_serializeOpGetScan) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetScan) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetScanInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scans/{scanName}") + 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_serializeOpHttpBindingsGetScanInput(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_serializeOpHttpBindingsGetScanInput(v *GetScanInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RunId != nil { + encoder.SetQuery("runId").String(*v.RunId) + } + + if v.ScanName == nil || len(*v.ScanName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member scanName must not be empty")} + } + if v.ScanName != nil { + if err := encoder.SetURI("scanName").String(*v.ScanName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListFindingsMetrics struct { +} + +func (*awsRestjson1_serializeOpListFindingsMetrics) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListFindingsMetrics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFindingsMetricsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/metrics/findings") + 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_serializeOpHttpBindingsListFindingsMetricsInput(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_serializeOpHttpBindingsListFindingsMetricsInput(v *ListFindingsMetricsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.EndDate != nil { + encoder.SetQuery("endDate").String(smithytime.FormatDateTime(*v.EndDate)) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.StartDate != nil { + encoder.SetQuery("startDate").String(smithytime.FormatDateTime(*v.StartDate)) + } + + return nil +} + +type awsRestjson1_serializeOpListScans struct { +} + +func (*awsRestjson1_serializeOpListScans) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListScans) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListScansInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scans") + 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_serializeOpHttpBindingsListScansInput(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_serializeOpHttpBindingsListScansInput(v *ListScansInput, 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_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_serializeOpUpdateAccountConfiguration struct { +} + +func (*awsRestjson1_serializeOpUpdateAccountConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAccountConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAccountConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/updateAccountConfiguration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAccountConfigurationInput(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_serializeOpHttpBindingsUpdateAccountConfigurationInput(v *UpdateAccountConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAccountConfigurationInput(v *UpdateAccountConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EncryptionConfig != nil { + ok := object.Key("encryptionConfig") + if err := awsRestjson1_serializeDocumentEncryptionConfig(v.EncryptionConfig, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEncryptionConfig(v *types.EncryptionConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyArn != nil { + ok := object.Key("kmsKeyArn") + ok.String(*v.KmsKeyArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentFindingIdentifier(v *types.FindingIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FindingId != nil { + ok := object.Key("findingId") + ok.String(*v.FindingId) + } + + if v.ScanName != nil { + ok := object.Key("scanName") + ok.String(*v.ScanName) + } + + return nil +} + +func awsRestjson1_serializeDocumentFindingIdentifiers(v []types.FindingIdentifier, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFindingIdentifier(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentResourceId(v types.ResourceId, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ResourceIdMemberCodeArtifactId: + av := object.Key("codeArtifactId") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + 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 +} diff --git a/service/codegurusecurity/types/enums.go b/service/codegurusecurity/types/enums.go new file mode 100644 index 00000000000..c33bf7d30bb --- /dev/null +++ b/service/codegurusecurity/types/enums.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AnalysisType string + +// Enum values for AnalysisType +const ( + AnalysisTypeSecurity AnalysisType = "Security" + AnalysisTypeAll AnalysisType = "All" +) + +// Values returns all known values for AnalysisType. 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 (AnalysisType) Values() []AnalysisType { + return []AnalysisType{ + "Security", + "All", + } +} + +type ErrorCode string + +// Enum values for ErrorCode +const ( + ErrorCodeDuplicateIdentifier ErrorCode = "DUPLICATE_IDENTIFIER" + ErrorCodeItemDoesNotExist ErrorCode = "ITEM_DOES_NOT_EXIST" + ErrorCodeInternalError ErrorCode = "INTERNAL_ERROR" + ErrorCodeInvalidFindingId ErrorCode = "INVALID_FINDING_ID" + ErrorCodeInvalidScanName ErrorCode = "INVALID_SCAN_NAME" +) + +// Values returns all known values for ErrorCode. 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 (ErrorCode) Values() []ErrorCode { + return []ErrorCode{ + "DUPLICATE_IDENTIFIER", + "ITEM_DOES_NOT_EXIST", + "INTERNAL_ERROR", + "INVALID_FINDING_ID", + "INVALID_SCAN_NAME", + } +} + +type ScanState string + +// Enum values for ScanState +const ( + ScanStateInProgress ScanState = "InProgress" + ScanStateSuccessful ScanState = "Successful" + ScanStateFailed ScanState = "Failed" +) + +// Values returns all known values for ScanState. 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 (ScanState) Values() []ScanState { + return []ScanState{ + "InProgress", + "Successful", + "Failed", + } +} + +type ScanType string + +// Enum values for ScanType +const ( + ScanTypeStandard ScanType = "Standard" + ScanTypeExpress ScanType = "Express" +) + +// Values returns all known values for ScanType. 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 (ScanType) Values() []ScanType { + return []ScanType{ + "Standard", + "Express", + } +} + +type Severity string + +// Enum values for Severity +const ( + SeverityCritical Severity = "Critical" + SeverityHigh Severity = "High" + SeverityMedium Severity = "Medium" + SeverityLow Severity = "Low" + SeverityInfo Severity = "Info" +) + +// Values returns all known values for Severity. Note that this can be expanded in +// the future, and so it is only as up to date as the client. The ordering of this +// slice is not guaranteed to be stable across updates. +func (Severity) Values() []Severity { + return []Severity{ + "Critical", + "High", + "Medium", + "Low", + "Info", + } +} + +type Status string + +// Enum values for Status +const ( + StatusClosed Status = "Closed" + StatusOpen Status = "Open" + StatusAll Status = "All" +) + +// Values returns all known values for Status. 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 (Status) Values() []Status { + return []Status{ + "Closed", + "Open", + "All", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "unknownOperation" + ValidationExceptionReasonCannotParse ValidationExceptionReason = "cannotParse" + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" + ValidationExceptionReasonOther ValidationExceptionReason = "other" + ValidationExceptionReasonLambdaCodeShaMismatch ValidationExceptionReason = "lambdaCodeShaMisMatch" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "unknownOperation", + "cannotParse", + "fieldValidationFailed", + "other", + "lambdaCodeShaMisMatch", + } +} diff --git a/service/codegurusecurity/types/errors.go b/service/codegurusecurity/types/errors.go new file mode 100644 index 00000000000..ae472fcc678 --- /dev/null +++ b/service/codegurusecurity/types/errors.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *string + ResourceId *string + ResourceType *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 } + +// The requested operation would cause a conflict with the current state of a +// service resource associated with the request. Resolve the conflict before +// retrying this request. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *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 } + +// The server encountered an internal error and is unable to complete the request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *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 } + +// The resource specified in the request was not found. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *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 } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *string + ServiceCode *string + QuotaCode *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.FaultClient } + +// The input fails to satisfy the specified constraints. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *string + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + 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 } diff --git a/service/codegurusecurity/types/types.go b/service/codegurusecurity/types/types.go new file mode 100644 index 00000000000..eb06b1f4825 --- /dev/null +++ b/service/codegurusecurity/types/types.go @@ -0,0 +1,411 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// A summary of findings metrics in an account. +type AccountFindingsMetric struct { + + // The number of closed findings of each severity in an account on the specified + // date. + ClosedFindings *FindingMetricsValuePerSeverity + + // The date from which the finding metrics were retrieved. + Date *time.Time + + // The average time it takes to close findings of each severity in days. + MeanTimeToClose *FindingMetricsValuePerSeverity + + // The number of new findings of each severity in account on the specified date. + NewFindings *FindingMetricsValuePerSeverity + + // The number of open findings of each severity in an account as of the specified + // date. + OpenFindings *FindingMetricsValuePerSeverity + + noSmithyDocumentSerde +} + +// Contains information about the error that caused a finding to fail to be +// retrieved. +type BatchGetFindingsError struct { + + // A code associated with the type of error. + // + // This member is required. + ErrorCode ErrorCode + + // The finding ID of the finding that was not fetched. + // + // This member is required. + FindingId *string + + // Describes the error. + // + // This member is required. + Message *string + + // The name of the scan that generated the finding. + // + // This member is required. + ScanName *string + + noSmithyDocumentSerde +} + +// Information about a finding category with open findings. +type CategoryWithFindingNum struct { + + // The name of the finding category. A finding category is determined by the + // detector that detected the finding. + CategoryName *string + + // The number of open findings in the category. + FindingNumber *int32 + + noSmithyDocumentSerde +} + +// The line of code where a finding was detected. +type CodeLine struct { + + // The code that contains a vulnerability. + Content *string + + // The code line number. + Number *int32 + + noSmithyDocumentSerde +} + +// Information about account-level configuration. +type EncryptionConfig struct { + + // The KMS key ARN to use for encryption. This must be provided as a header when + // uploading your code resource. + KmsKeyArn *string + + noSmithyDocumentSerde +} + +// Information about the location of security vulnerabilities that Amazon CodeGuru +// Security detected in your code. +type FilePath struct { + + // A list of CodeLine objects that describe where the security vulnerability + // appears in your code. + CodeSnippet []CodeLine + + // The last line number of the code snippet where the security vulnerability + // appears in your code. + EndLine *int32 + + // The name of the file. + Name *string + + // The path to the resource with the security vulnerability. + Path *string + + // The first line number of the code snippet where the security vulnerability + // appears in your code. + StartLine *int32 + + noSmithyDocumentSerde +} + +// Information about a finding that was detected in your code. +type Finding struct { + + // The time when the finding was created. + CreatedAt *time.Time + + // A description of the finding. + Description *string + + // The identifier for the detector that detected the finding in your code. A + // detector is a defined rule based on industry standards and AWS best practices. + DetectorId *string + + // The name of the detector that identified the security vulnerability in your + // code. + DetectorName *string + + // One or more tags or categorizations that are associated with a detector. These + // tags are defined by type, programming language, or other classification such as + // maintainability or consistency. + DetectorTags []string + + // The identifier for the component that generated a finding such as + // AWSCodeGuruSecurity or AWSInspector. + GeneratorId *string + + // The identifier for a finding. + Id *string + + // An object that contains the details about how to remediate a finding. + Remediation *Remediation + + // The resource where Amazon CodeGuru Security detected a finding. + Resource *Resource + + // The identifier for the rule that generated the finding. + RuleId *string + + // The severity of the finding. + Severity Severity + + // The status of the finding. A finding status can be open or closed. + Status Status + + // The title of the finding. + Title *string + + // The type of finding. + Type *string + + // The time when the finding was last updated. Findings are updated when you + // remediate them or when the finding code location changes. + UpdatedAt *time.Time + + // An object that describes the detected security vulnerability. + Vulnerability *Vulnerability + + noSmithyDocumentSerde +} + +// An object that contains information about a finding and the scan that generated +// it. +type FindingIdentifier struct { + + // The identifier for a finding. + // + // This member is required. + FindingId *string + + // The name of the scan that generated the finding. + // + // This member is required. + ScanName *string + + noSmithyDocumentSerde +} + +// The severity of the issue in the code that generated a finding. +type FindingMetricsValuePerSeverity struct { + + // The severity of the finding is critical and should be addressed immediately. + Critical *float64 + + // The severity of the finding is high and should be addressed as a near-term + // priority. + High *float64 + + // The finding is related to quality or readability improvements and not + // considered actionable. + Info *float64 + + // The severity of the finding is low and does require action on its own. + Low *float64 + + // The severity of the finding is medium and should be addressed as a mid-term + // priority. + Medium *float64 + + noSmithyDocumentSerde +} + +// Information about summary metrics in an account. +type MetricsSummary struct { + + // A list of CategoryWithFindingNum objects for the top 5 finding categories with + // the most open findings in an account. + CategoriesWithMostFindings []CategoryWithFindingNum + + // The date from which the metrics summary information was retrieved. + Date *time.Time + + // The number of open findings of each severity in an account. + OpenFindings *FindingMetricsValuePerSeverity + + // A list of ScanNameWithFindingNum objects for the top 3 scans with the most + // number of open findings in an account. + ScansWithMostOpenCriticalFindings []ScanNameWithFindingNum + + // A list of ScanNameWithFindingNum objects for the top 3 scans with the most + // number of open critical findings in an account. + ScansWithMostOpenFindings []ScanNameWithFindingNum + + noSmithyDocumentSerde +} + +// Information about the recommended course of action to remediate a finding. +type Recommendation struct { + + // The recommended course of action to remediate the finding. + Text *string + + // The URL address to the recommendation for remediating the finding. + Url *string + + noSmithyDocumentSerde +} + +// Information about how to remediate a finding. +type Remediation struct { + + // An object that contains information about the recommended course of action to + // remediate a finding. + Recommendation *Recommendation + + // A list of SuggestedFix objects. Each object contains information about a + // suggested code fix to remediate the finding. + SuggestedFixes []SuggestedFix + + noSmithyDocumentSerde +} + +// Information about a resource, such as an Amazon S3 bucket or AWS Lambda +// function, that contains a finding. +type Resource struct { + + // The identifier for the resource. + Id *string + + // The identifier for a section of the resource, such as an AWS Lambda layer. + SubResourceId *string + + noSmithyDocumentSerde +} + +// The identifier for a resource object that contains resources where a finding +// was detected. +// +// The following types satisfy this interface: +// +// ResourceIdMemberCodeArtifactId +type ResourceId interface { + isResourceId() +} + +// The identifier for the code file uploaded to the resource where a finding was +// detected. +type ResourceIdMemberCodeArtifactId struct { + Value string + + noSmithyDocumentSerde +} + +func (*ResourceIdMemberCodeArtifactId) isResourceId() {} + +// Information about a scan with open findings. +type ScanNameWithFindingNum struct { + + // The number of open findings generated by a scan. + FindingNumber *int32 + + // The name of the scan. + ScanName *string + + noSmithyDocumentSerde +} + +// Information about a scan. +type ScanSummary struct { + + // The time when the scan was created. + // + // This member is required. + CreatedAt *time.Time + + // The identifier for the scan run. + // + // This member is required. + RunId *string + + // The name of the scan. + // + // This member is required. + ScanName *string + + // The state of the scan. A scan can be In Progress , Complete , or Failed . + // + // This member is required. + ScanState ScanState + + // The ARN for the scan name. + ScanNameArn *string + + // The time the scan was last updated. A scan is updated when it is re-run. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Information about the suggested code fix to remediate a finding. +type SuggestedFix struct { + + // The suggested code to add to your file. + Code *string + + // A description of the suggested code fix and why it is being suggested. + Description *string + + noSmithyDocumentSerde +} + +// Information about a validation exception. +type ValidationExceptionField struct { + + // Describes the exception. + // + // This member is required. + Message *string + + // The name of the exception. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Information about a security vulnerability that Amazon CodeGuru Security +// detected. +type Vulnerability struct { + + // An object that describes the location of the detected security vulnerability in + // your code. + FilePath *FilePath + + // The identifier for the vulnerability. + Id *string + + // The number of times the vulnerability appears in your code. + ItemCount *int32 + + // One or more URL addresses that contain details about a vulnerability. + ReferenceUrls []string + + // One or more vulnerabilities that are related to the vulnerability being + // described. + RelatedVulnerabilities []string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isResourceId() {} diff --git a/service/codegurusecurity/types/types_exported_test.go b/service/codegurusecurity/types/types_exported_test.go new file mode 100644 index 00000000000..f68ead0d849 --- /dev/null +++ b/service/codegurusecurity/types/types_exported_test.go @@ -0,0 +1,26 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/codegurusecurity/types" +) + +func ExampleResourceId_outputUsage() { + var union types.ResourceId + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ResourceIdMemberCodeArtifactId: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string diff --git a/service/codegurusecurity/validators.go b/service/codegurusecurity/validators.go new file mode 100644 index 00000000000..52ae74cedcd --- /dev/null +++ b/service/codegurusecurity/validators.go @@ -0,0 +1,491 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/codegurusecurity/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpBatchGetFindings struct { +} + +func (*validateOpBatchGetFindings) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchGetFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchGetFindingsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchGetFindingsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateScan struct { +} + +func (*validateOpCreateScan) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateScan) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateScanInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateScanInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateUploadUrl struct { +} + +func (*validateOpCreateUploadUrl) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateUploadUrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateUploadUrlInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateUploadUrlInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetFindings struct { +} + +func (*validateOpGetFindings) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFindingsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFindingsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetMetricsSummary struct { +} + +func (*validateOpGetMetricsSummary) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetMetricsSummary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetMetricsSummaryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetMetricsSummaryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetScan struct { +} + +func (*validateOpGetScan) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetScan) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetScanInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetScanInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListFindingsMetrics struct { +} + +func (*validateOpListFindingsMetrics) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListFindingsMetrics) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListFindingsMetricsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListFindingsMetricsInput(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 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 validateOpUpdateAccountConfiguration struct { +} + +func (*validateOpUpdateAccountConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAccountConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAccountConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAccountConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpBatchGetFindingsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchGetFindings{}, middleware.After) +} + +func addOpCreateScanValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateScan{}, middleware.After) +} + +func addOpCreateUploadUrlValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateUploadUrl{}, middleware.After) +} + +func addOpGetFindingsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFindings{}, middleware.After) +} + +func addOpGetMetricsSummaryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetMetricsSummary{}, middleware.After) +} + +func addOpGetScanValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetScan{}, middleware.After) +} + +func addOpListFindingsMetricsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListFindingsMetrics{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, 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 addOpUpdateAccountConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAccountConfiguration{}, middleware.After) +} + +func validateFindingIdentifier(v *types.FindingIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FindingIdentifier"} + if v.ScanName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanName")) + } + if v.FindingId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FindingId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFindingIdentifiers(v []types.FindingIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FindingIdentifiers"} + for i := range v { + if err := validateFindingIdentifier(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchGetFindingsInput(v *BatchGetFindingsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetFindingsInput"} + if v.FindingIdentifiers == nil { + invalidParams.Add(smithy.NewErrParamRequired("FindingIdentifiers")) + } else if v.FindingIdentifiers != nil { + if err := validateFindingIdentifiers(v.FindingIdentifiers); err != nil { + invalidParams.AddNested("FindingIdentifiers", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateScanInput(v *CreateScanInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateScanInput"} + if v.ResourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) + } + if v.ScanName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateUploadUrlInput(v *CreateUploadUrlInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateUploadUrlInput"} + if v.ScanName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetFindingsInput(v *GetFindingsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFindingsInput"} + if v.ScanName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetMetricsSummaryInput(v *GetMetricsSummaryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetMetricsSummaryInput"} + if v.Date == nil { + invalidParams.Add(smithy.NewErrParamRequired("Date")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetScanInput(v *GetScanInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetScanInput"} + if v.ScanName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScanName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListFindingsMetricsInput(v *ListFindingsMetricsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListFindingsMetricsInput"} + if v.StartDate == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartDate")) + } + if v.EndDate == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndDate")) + } + 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 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 validateOpUpdateAccountConfigurationInput(v *UpdateAccountConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAccountConfigurationInput"} + if v.EncryptionConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("EncryptionConfig")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/drs/api_op_AssociateSourceNetworkStack.go b/service/drs/api_op_AssociateSourceNetworkStack.go new file mode 100644 index 00000000000..1f57f6a06a3 --- /dev/null +++ b/service/drs/api_op_AssociateSourceNetworkStack.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +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/drs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associate a Source Network to an existing CloudFormation Stack and modify +// launch templates to use this network. Can be used for reverting to previously +// deployed CloudFormation stacks. +func (c *Client) AssociateSourceNetworkStack(ctx context.Context, params *AssociateSourceNetworkStackInput, optFns ...func(*Options)) (*AssociateSourceNetworkStackOutput, error) { + if params == nil { + params = &AssociateSourceNetworkStackInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateSourceNetworkStack", params, optFns, c.addOperationAssociateSourceNetworkStackMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateSourceNetworkStackOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateSourceNetworkStackInput struct { + + // CloudFormation template to associate with a Source Network. + // + // This member is required. + CfnStackName *string + + // The Source Network ID to associate with CloudFormation template. + // + // This member is required. + SourceNetworkID *string + + noSmithyDocumentSerde +} + +type AssociateSourceNetworkStackOutput struct { + + // The Source Network association Job. + Job *types.Job + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateSourceNetworkStackMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateSourceNetworkStack{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateSourceNetworkStack{}, 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 = addOpAssociateSourceNetworkStackValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateSourceNetworkStack(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_opAssociateSourceNetworkStack(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "drs", + OperationName: "AssociateSourceNetworkStack", + } +} diff --git a/service/drs/api_op_CreateLaunchConfigurationTemplate.go b/service/drs/api_op_CreateLaunchConfigurationTemplate.go index 71aac7bceb8..12853a3daf8 100644 --- a/service/drs/api_op_CreateLaunchConfigurationTemplate.go +++ b/service/drs/api_op_CreateLaunchConfigurationTemplate.go @@ -35,6 +35,9 @@ type CreateLaunchConfigurationTemplateInput struct { // Copy tags. CopyTags *bool + // S3 bucket ARN to export Source Network templates. + ExportBucketArn *string + // Launch disposition. LaunchDisposition types.LaunchDisposition diff --git a/service/drs/api_op_CreateSourceNetwork.go b/service/drs/api_op_CreateSourceNetwork.go new file mode 100644 index 00000000000..4045f34f510 --- /dev/null +++ b/service/drs/api_op_CreateSourceNetwork.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +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" +) + +// Create a new Source Network resource for a provided VPC ID. +func (c *Client) CreateSourceNetwork(ctx context.Context, params *CreateSourceNetworkInput, optFns ...func(*Options)) (*CreateSourceNetworkOutput, error) { + if params == nil { + params = &CreateSourceNetworkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSourceNetwork", params, optFns, c.addOperationCreateSourceNetworkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSourceNetworkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSourceNetworkInput struct { + + // Account containing the VPC to protect. + // + // This member is required. + OriginAccountID *string + + // Region containing the VPC to protect. + // + // This member is required. + OriginRegion *string + + // Which VPC ID to protect. + // + // This member is required. + VpcID *string + + // A set of tags to be associated with the Source Network resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateSourceNetworkOutput struct { + + // ID of the created Source Network. + SourceNetworkID *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSourceNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSourceNetwork{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSourceNetwork{}, 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 = addOpCreateSourceNetworkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSourceNetwork(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_opCreateSourceNetwork(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "drs", + OperationName: "CreateSourceNetwork", + } +} diff --git a/service/drs/api_op_DeleteSourceNetwork.go b/service/drs/api_op_DeleteSourceNetwork.go new file mode 100644 index 00000000000..07490deb6d6 --- /dev/null +++ b/service/drs/api_op_DeleteSourceNetwork.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +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" +) + +// Delete Source Network resource. +func (c *Client) DeleteSourceNetwork(ctx context.Context, params *DeleteSourceNetworkInput, optFns ...func(*Options)) (*DeleteSourceNetworkOutput, error) { + if params == nil { + params = &DeleteSourceNetworkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSourceNetwork", params, optFns, c.addOperationDeleteSourceNetworkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSourceNetworkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSourceNetworkInput struct { + + // ID of the Source Network to delete. + // + // This member is required. + SourceNetworkID *string + + noSmithyDocumentSerde +} + +type DeleteSourceNetworkOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSourceNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSourceNetwork{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSourceNetwork{}, 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 = addOpDeleteSourceNetworkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSourceNetwork(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_opDeleteSourceNetwork(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "drs", + OperationName: "DeleteSourceNetwork", + } +} diff --git a/service/drs/api_op_DescribeSourceNetworks.go b/service/drs/api_op_DescribeSourceNetworks.go new file mode 100644 index 00000000000..b60364b8a17 --- /dev/null +++ b/service/drs/api_op_DescribeSourceNetworks.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +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/drs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all Source Networks or multiple Source Networks filtered by ID. +func (c *Client) DescribeSourceNetworks(ctx context.Context, params *DescribeSourceNetworksInput, optFns ...func(*Options)) (*DescribeSourceNetworksOutput, error) { + if params == nil { + params = &DescribeSourceNetworksInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeSourceNetworks", params, optFns, c.addOperationDescribeSourceNetworksMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeSourceNetworksOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeSourceNetworksInput struct { + + // A set of filters by which to return Source Networks. + Filters *types.DescribeSourceNetworksRequestFilters + + // Maximum number of Source Networks to retrieve. + MaxResults int32 + + // The token of the next Source Networks to retrieve. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeSourceNetworksOutput struct { + + // An array of Source Networks. + Items []types.SourceNetwork + + // The token of the next Source Networks to retrieve. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeSourceNetworksMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSourceNetworks{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSourceNetworks{}, 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_opDescribeSourceNetworks(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 +} + +// DescribeSourceNetworksAPIClient is a client that implements the +// DescribeSourceNetworks operation. +type DescribeSourceNetworksAPIClient interface { + DescribeSourceNetworks(context.Context, *DescribeSourceNetworksInput, ...func(*Options)) (*DescribeSourceNetworksOutput, error) +} + +var _ DescribeSourceNetworksAPIClient = (*Client)(nil) + +// DescribeSourceNetworksPaginatorOptions is the paginator options for +// DescribeSourceNetworks +type DescribeSourceNetworksPaginatorOptions struct { + // Maximum number of Source Networks to retrieve. + 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 +} + +// DescribeSourceNetworksPaginator is a paginator for DescribeSourceNetworks +type DescribeSourceNetworksPaginator struct { + options DescribeSourceNetworksPaginatorOptions + client DescribeSourceNetworksAPIClient + params *DescribeSourceNetworksInput + nextToken *string + firstPage bool +} + +// NewDescribeSourceNetworksPaginator returns a new DescribeSourceNetworksPaginator +func NewDescribeSourceNetworksPaginator(client DescribeSourceNetworksAPIClient, params *DescribeSourceNetworksInput, optFns ...func(*DescribeSourceNetworksPaginatorOptions)) *DescribeSourceNetworksPaginator { + if params == nil { + params = &DescribeSourceNetworksInput{} + } + + options := DescribeSourceNetworksPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeSourceNetworksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSourceNetworksPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeSourceNetworks page. +func (p *DescribeSourceNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSourceNetworksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.DescribeSourceNetworks(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_opDescribeSourceNetworks(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "drs", + OperationName: "DescribeSourceNetworks", + } +} diff --git a/service/drs/api_op_DisconnectSourceServer.go b/service/drs/api_op_DisconnectSourceServer.go index ece2a0373ce..9033151391f 100644 --- a/service/drs/api_op_DisconnectSourceServer.go +++ b/service/drs/api_op_DisconnectSourceServer.go @@ -76,6 +76,9 @@ type DisconnectSourceServerOutput struct { // Source cloud properties of the Source Server. SourceCloudProperties *types.SourceCloudProperties + // ID of the Source Network which is protecting this Source Server's network. + SourceNetworkID *string + // The source properties of the Source Server. SourceProperties *types.SourceProperties diff --git a/service/drs/api_op_ExportSourceNetworkCfnTemplate.go b/service/drs/api_op_ExportSourceNetworkCfnTemplate.go new file mode 100644 index 00000000000..037771e50c2 --- /dev/null +++ b/service/drs/api_op_ExportSourceNetworkCfnTemplate.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +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" +) + +// Export the Source Network CloudFormation template to an S3 bucket. +func (c *Client) ExportSourceNetworkCfnTemplate(ctx context.Context, params *ExportSourceNetworkCfnTemplateInput, optFns ...func(*Options)) (*ExportSourceNetworkCfnTemplateOutput, error) { + if params == nil { + params = &ExportSourceNetworkCfnTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ExportSourceNetworkCfnTemplate", params, optFns, c.addOperationExportSourceNetworkCfnTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ExportSourceNetworkCfnTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ExportSourceNetworkCfnTemplateInput struct { + + // The Source Network ID to export its CloudFormation template to an S3 bucket. + // + // This member is required. + SourceNetworkID *string + + noSmithyDocumentSerde +} + +type ExportSourceNetworkCfnTemplateOutput struct { + + // S3 bucket URL where the Source Network CloudFormation template was exported to. + S3DestinationUrl *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationExportSourceNetworkCfnTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpExportSourceNetworkCfnTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpExportSourceNetworkCfnTemplate{}, 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 = addOpExportSourceNetworkCfnTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportSourceNetworkCfnTemplate(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_opExportSourceNetworkCfnTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "drs", + OperationName: "ExportSourceNetworkCfnTemplate", + } +} diff --git a/service/drs/api_op_RetryDataReplication.go b/service/drs/api_op_RetryDataReplication.go index 6c07b57b352..9b894409f3d 100644 --- a/service/drs/api_op_RetryDataReplication.go +++ b/service/drs/api_op_RetryDataReplication.go @@ -71,6 +71,9 @@ type RetryDataReplicationOutput struct { // Source cloud properties of the Source Server. SourceCloudProperties *types.SourceCloudProperties + // ID of the Source Network which is protecting this Source Server's network. + SourceNetworkID *string + // The source properties of the Source Server. SourceProperties *types.SourceProperties diff --git a/service/drs/api_op_StartSourceNetworkRecovery.go b/service/drs/api_op_StartSourceNetworkRecovery.go new file mode 100644 index 00000000000..2e0e64d3a43 --- /dev/null +++ b/service/drs/api_op_StartSourceNetworkRecovery.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +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/drs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deploy VPC for the specified Source Network and modify launch templates to use +// this network. The VPC will be deployed using a dedicated CloudFormation stack. +func (c *Client) StartSourceNetworkRecovery(ctx context.Context, params *StartSourceNetworkRecoveryInput, optFns ...func(*Options)) (*StartSourceNetworkRecoveryOutput, error) { + if params == nil { + params = &StartSourceNetworkRecoveryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartSourceNetworkRecovery", params, optFns, c.addOperationStartSourceNetworkRecoveryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartSourceNetworkRecoveryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartSourceNetworkRecoveryInput struct { + + // The Source Networks that we want to start a Recovery Job for. + // + // This member is required. + SourceNetworks []types.StartSourceNetworkRecoveryRequestNetworkEntry + + // Don't update existing CloudFormation Stack, recover the network using a new + // stack. + DeployAsNew *bool + + // The tags to be associated with the Source Network recovery Job. + Tags map[string]string + + noSmithyDocumentSerde +} + +type StartSourceNetworkRecoveryOutput struct { + + // The Source Network recovery Job. + Job *types.Job + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartSourceNetworkRecoveryMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartSourceNetworkRecovery{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartSourceNetworkRecovery{}, 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 = addOpStartSourceNetworkRecoveryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSourceNetworkRecovery(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_opStartSourceNetworkRecovery(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "drs", + OperationName: "StartSourceNetworkRecovery", + } +} diff --git a/service/drs/api_op_StartSourceNetworkReplication.go b/service/drs/api_op_StartSourceNetworkReplication.go new file mode 100644 index 00000000000..9c6d20c756e --- /dev/null +++ b/service/drs/api_op_StartSourceNetworkReplication.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +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/drs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts replication for a Source Network. This action would make the Source +// Network protected. +func (c *Client) StartSourceNetworkReplication(ctx context.Context, params *StartSourceNetworkReplicationInput, optFns ...func(*Options)) (*StartSourceNetworkReplicationOutput, error) { + if params == nil { + params = &StartSourceNetworkReplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartSourceNetworkReplication", params, optFns, c.addOperationStartSourceNetworkReplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartSourceNetworkReplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartSourceNetworkReplicationInput struct { + + // ID of the Source Network to replicate. + // + // This member is required. + SourceNetworkID *string + + noSmithyDocumentSerde +} + +type StartSourceNetworkReplicationOutput struct { + + // Source Network which was requested for replication. + SourceNetwork *types.SourceNetwork + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartSourceNetworkReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartSourceNetworkReplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartSourceNetworkReplication{}, 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 = addOpStartSourceNetworkReplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSourceNetworkReplication(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_opStartSourceNetworkReplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "drs", + OperationName: "StartSourceNetworkReplication", + } +} diff --git a/service/drs/api_op_StopSourceNetworkReplication.go b/service/drs/api_op_StopSourceNetworkReplication.go new file mode 100644 index 00000000000..e3bb9005ed7 --- /dev/null +++ b/service/drs/api_op_StopSourceNetworkReplication.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +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/drs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stops replication for a Source Network. This action would make the Source +// Network unprotected. +func (c *Client) StopSourceNetworkReplication(ctx context.Context, params *StopSourceNetworkReplicationInput, optFns ...func(*Options)) (*StopSourceNetworkReplicationOutput, error) { + if params == nil { + params = &StopSourceNetworkReplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopSourceNetworkReplication", params, optFns, c.addOperationStopSourceNetworkReplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopSourceNetworkReplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopSourceNetworkReplicationInput struct { + + // ID of the Source Network to stop replication. + // + // This member is required. + SourceNetworkID *string + + noSmithyDocumentSerde +} + +type StopSourceNetworkReplicationOutput struct { + + // Source Network which was requested to stop replication. + SourceNetwork *types.SourceNetwork + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopSourceNetworkReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStopSourceNetworkReplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopSourceNetworkReplication{}, 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 = addOpStopSourceNetworkReplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopSourceNetworkReplication(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_opStopSourceNetworkReplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "drs", + OperationName: "StopSourceNetworkReplication", + } +} diff --git a/service/drs/api_op_UpdateLaunchConfigurationTemplate.go b/service/drs/api_op_UpdateLaunchConfigurationTemplate.go index 7cc9053bb78..29baef779b8 100644 --- a/service/drs/api_op_UpdateLaunchConfigurationTemplate.go +++ b/service/drs/api_op_UpdateLaunchConfigurationTemplate.go @@ -40,6 +40,9 @@ type UpdateLaunchConfigurationTemplateInput struct { // Copy tags. CopyTags *bool + // S3 bucket ARN to export Source Network templates. + ExportBucketArn *string + // Launch disposition. LaunchDisposition types.LaunchDisposition diff --git a/service/drs/deserializers.go b/service/drs/deserializers.go index cc16edec7a0..2b97117d24f 100644 --- a/service/drs/deserializers.go +++ b/service/drs/deserializers.go @@ -13,6 +13,7 @@ import ( smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" @@ -20,6 +21,171 @@ import ( "strings" ) +type awsRestjson1_deserializeOpAssociateSourceNetworkStack struct { +} + +func (*awsRestjson1_deserializeOpAssociateSourceNetworkStack) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateSourceNetworkStack) HandleDeserialize(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_deserializeOpErrorAssociateSourceNetworkStack(response, &metadata) + } + output := &AssociateSourceNetworkStackOutput{} + 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_deserializeOpDocumentAssociateSourceNetworkStackOutput(&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_deserializeOpErrorAssociateSourceNetworkStack(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UninitializedAccountException", errorCode): + return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAssociateSourceNetworkStackOutput(v **AssociateSourceNetworkStackOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AssociateSourceNetworkStackOutput + if *v == nil { + sv = &AssociateSourceNetworkStackOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "job": + if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateExtendedSourceServer struct { } @@ -645,14 +811,14 @@ func awsRestjson1_deserializeOpDocumentCreateReplicationConfigurationTemplateOut return nil } -type awsRestjson1_deserializeOpDeleteJob struct { +type awsRestjson1_deserializeOpCreateSourceNetwork struct { } -func (*awsRestjson1_deserializeOpDeleteJob) ID() string { +func (*awsRestjson1_deserializeOpCreateSourceNetwork) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateSourceNetwork) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -666,15 +832,43 @@ func (m *awsRestjson1_deserializeOpDeleteJob) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateSourceNetwork(response, &metadata) } - output := &DeleteJobOutput{} + output := &CreateSourceNetworkOutput{} 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_deserializeOpDocumentCreateSourceNetworkOutput(&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_deserializeOpErrorDeleteJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateSourceNetwork(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -724,12 +918,18 @@ func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, met case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -740,14 +940,54 @@ func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, met } } -type awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate struct { +func awsRestjson1_deserializeOpDocumentCreateSourceNetworkOutput(v **CreateSourceNetworkOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateSourceNetworkOutput + if *v == nil { + sv = &CreateSourceNetworkOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sourceNetworkID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceNetworkID to be of type string, got %T instead", value) + } + sv.SourceNetworkID = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) ID() string { +type awsRestjson1_deserializeOpDeleteJob struct { +} + +func (*awsRestjson1_deserializeOpDeleteJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -761,15 +1001,15 @@ func (m *awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteLaunchConfigurationTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteJob(response, &metadata) } - output := &DeleteLaunchConfigurationTemplateOutput{} + output := &DeleteJobOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteLaunchConfigurationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -835,14 +1075,14 @@ func awsRestjson1_deserializeOpErrorDeleteLaunchConfigurationTemplate(response * } } -type awsRestjson1_deserializeOpDeleteRecoveryInstance struct { +type awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate struct { } -func (*awsRestjson1_deserializeOpDeleteRecoveryInstance) ID() string { +func (*awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteRecoveryInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -856,17 +1096,112 @@ func (m *awsRestjson1_deserializeOpDeleteRecoveryInstance) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteRecoveryInstance(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteLaunchConfigurationTemplate(response, &metadata) } - output := &DeleteRecoveryInstanceOutput{} + output := &DeleteLaunchConfigurationTemplateOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteLaunchConfigurationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("UninitializedAccountException", errorCode): + return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteRecoveryInstance struct { +} + +func (*awsRestjson1_deserializeOpDeleteRecoveryInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteRecoveryInstance) HandleDeserialize(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_deserializeOpErrorDeleteRecoveryInstance(response, &metadata) + } + output := &DeleteRecoveryInstanceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + return out, metadata, err } @@ -1031,6 +1366,101 @@ func awsRestjson1_deserializeOpErrorDeleteReplicationConfigurationTemplate(respo } } +type awsRestjson1_deserializeOpDeleteSourceNetwork struct { +} + +func (*awsRestjson1_deserializeOpDeleteSourceNetwork) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSourceNetwork) HandleDeserialize(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_deserializeOpErrorDeleteSourceNetwork(response, &metadata) + } + output := &DeleteSourceNetworkOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSourceNetwork(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("UninitializedAccountException", errorCode): + return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDeleteSourceServer struct { } @@ -2125,14 +2555,14 @@ func awsRestjson1_deserializeOpDocumentDescribeReplicationConfigurationTemplates return nil } -type awsRestjson1_deserializeOpDescribeSourceServers struct { +type awsRestjson1_deserializeOpDescribeSourceNetworks struct { } -func (*awsRestjson1_deserializeOpDescribeSourceServers) ID() string { +func (*awsRestjson1_deserializeOpDescribeSourceNetworks) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeSourceServers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeSourceNetworks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2146,9 +2576,9 @@ func (m *awsRestjson1_deserializeOpDescribeSourceServers) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeSourceServers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeSourceNetworks(response, &metadata) } - output := &DescribeSourceServersOutput{} + output := &DescribeSourceNetworksOutput{} out.Result = output var buff [1024]byte @@ -2169,7 +2599,7 @@ func (m *awsRestjson1_deserializeOpDescribeSourceServers) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeSourceNetworksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2182,7 +2612,7 @@ func (m *awsRestjson1_deserializeOpDescribeSourceServers) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeSourceServers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeSourceNetworks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2245,7 +2675,7 @@ func awsRestjson1_deserializeOpErrorDescribeSourceServers(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(v **DescribeSourceServersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeSourceNetworksOutput(v **DescribeSourceNetworksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2258,9 +2688,9 @@ func awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(v **DescribeS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeSourceServersOutput + var sv *DescribeSourceNetworksOutput if *v == nil { - sv = &DescribeSourceServersOutput{} + sv = &DescribeSourceNetworksOutput{} } else { sv = *v } @@ -2268,7 +2698,7 @@ func awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(v **DescribeS for key, value := range shape { switch key { case "items": - if err := awsRestjson1_deserializeDocumentSourceServersList(&sv.Items, value); err != nil { + if err := awsRestjson1_deserializeDocumentSourceNetworksList(&sv.Items, value); err != nil { return err } @@ -2290,14 +2720,14 @@ func awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(v **DescribeS return nil } -type awsRestjson1_deserializeOpDisconnectRecoveryInstance struct { +type awsRestjson1_deserializeOpDescribeSourceServers struct { } -func (*awsRestjson1_deserializeOpDisconnectRecoveryInstance) ID() string { +func (*awsRestjson1_deserializeOpDescribeSourceServers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisconnectRecoveryInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeSourceServers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2311,21 +2741,43 @@ func (m *awsRestjson1_deserializeOpDisconnectRecoveryInstance) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisconnectRecoveryInstance(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeSourceServers(response, &metadata) } - output := &DisconnectRecoveryInstanceOutput{} + output := &DescribeSourceServersOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentDescribeSourceServersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisconnectRecoveryInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeSourceServers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2366,24 +2818,18 @@ func awsRestjson1_deserializeOpErrorDisconnectRecoveryInstance(response *smithyh } 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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2394,11 +2840,160 @@ func awsRestjson1_deserializeOpErrorDisconnectRecoveryInstance(response *smithyh } } -type awsRestjson1_deserializeOpDisconnectSourceServer struct { -} - -func (*awsRestjson1_deserializeOpDisconnectSourceServer) ID() string { - return "OperationDeserializer" +func awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(v **DescribeSourceServersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeSourceServersOutput + if *v == nil { + sv = &DescribeSourceServersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentSourceServersList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDisconnectRecoveryInstance struct { +} + +func (*awsRestjson1_deserializeOpDisconnectRecoveryInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisconnectRecoveryInstance) HandleDeserialize(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_deserializeOpErrorDisconnectRecoveryInstance(response, &metadata) + } + output := &DisconnectRecoveryInstanceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisconnectRecoveryInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("UninitializedAccountException", errorCode): + return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisconnectSourceServer struct { +} + +func (*awsRestjson1_deserializeOpDisconnectSourceServer) ID() string { + return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisconnectSourceServer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( @@ -2599,6 +3194,15 @@ func awsRestjson1_deserializeOpDocumentDisconnectSourceServerOutput(v **Disconne return err } + case "sourceNetworkID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceNetworkID to be of type string, got %T instead", value) + } + sv.SourceNetworkID = ptr.String(jtv) + } + case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err @@ -2632,14 +3236,14 @@ func awsRestjson1_deserializeOpDocumentDisconnectSourceServerOutput(v **Disconne return nil } -type awsRestjson1_deserializeOpGetFailbackReplicationConfiguration struct { +type awsRestjson1_deserializeOpExportSourceNetworkCfnTemplate struct { } -func (*awsRestjson1_deserializeOpGetFailbackReplicationConfiguration) ID() string { +func (*awsRestjson1_deserializeOpExportSourceNetworkCfnTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetFailbackReplicationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpExportSourceNetworkCfnTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2653,9 +3257,9 @@ func (m *awsRestjson1_deserializeOpGetFailbackReplicationConfiguration) HandleDe } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetFailbackReplicationConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorExportSourceNetworkCfnTemplate(response, &metadata) } - output := &GetFailbackReplicationConfigurationOutput{} + output := &ExportSourceNetworkCfnTemplateOutput{} out.Result = output var buff [1024]byte @@ -2676,7 +3280,7 @@ func (m *awsRestjson1_deserializeOpGetFailbackReplicationConfiguration) HandleDe return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetFailbackReplicationConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentExportSourceNetworkCfnTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2689,7 +3293,7 @@ func (m *awsRestjson1_deserializeOpGetFailbackReplicationConfiguration) HandleDe return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetFailbackReplicationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorExportSourceNetworkCfnTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2730,6 +3334,9 @@ func awsRestjson1_deserializeOpErrorGetFailbackReplicationConfiguration(response } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2742,6 +3349,9 @@ func awsRestjson1_deserializeOpErrorGetFailbackReplicationConfiguration(response case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2752,7 +3362,7 @@ func awsRestjson1_deserializeOpErrorGetFailbackReplicationConfiguration(response } } -func awsRestjson1_deserializeOpDocumentGetFailbackReplicationConfigurationOutput(v **GetFailbackReplicationConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentExportSourceNetworkCfnTemplateOutput(v **ExportSourceNetworkCfnTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2765,53 +3375,22 @@ func awsRestjson1_deserializeOpDocumentGetFailbackReplicationConfigurationOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetFailbackReplicationConfigurationOutput + var sv *ExportSourceNetworkCfnTemplateOutput if *v == nil { - sv = &GetFailbackReplicationConfigurationOutput{} + sv = &ExportSourceNetworkCfnTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "bandwidthThrottling": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.BandwidthThrottling = i64 - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "recoveryInstanceID": + case "s3DestinationUrl": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RecoveryInstanceID to be of type string, got %T instead", value) - } - sv.RecoveryInstanceID = ptr.String(jtv) - } - - case "usePrivateIP": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } - sv.UsePrivateIP = ptr.Bool(jtv) + sv.S3DestinationUrl = ptr.String(jtv) } default: @@ -2823,14 +3402,14 @@ func awsRestjson1_deserializeOpDocumentGetFailbackReplicationConfigurationOutput return nil } -type awsRestjson1_deserializeOpGetLaunchConfiguration struct { +type awsRestjson1_deserializeOpGetFailbackReplicationConfiguration struct { } -func (*awsRestjson1_deserializeOpGetLaunchConfiguration) ID() string { +func (*awsRestjson1_deserializeOpGetFailbackReplicationConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetLaunchConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFailbackReplicationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2844,9 +3423,9 @@ func (m *awsRestjson1_deserializeOpGetLaunchConfiguration) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetLaunchConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFailbackReplicationConfiguration(response, &metadata) } - output := &GetLaunchConfigurationOutput{} + output := &GetFailbackReplicationConfigurationOutput{} out.Result = output var buff [1024]byte @@ -2867,7 +3446,7 @@ func (m *awsRestjson1_deserializeOpGetLaunchConfiguration) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetLaunchConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFailbackReplicationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2880,7 +3459,7 @@ func (m *awsRestjson1_deserializeOpGetLaunchConfiguration) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetLaunchConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFailbackReplicationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2943,7 +3522,7 @@ func awsRestjson1_deserializeOpErrorGetLaunchConfiguration(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentGetLaunchConfigurationOutput(v **GetLaunchConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFailbackReplicationConfigurationOutput(v **GetFailbackReplicationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2956,43 +3535,234 @@ func awsRestjson1_deserializeOpDocumentGetLaunchConfigurationOutput(v **GetLaunc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetLaunchConfigurationOutput + var sv *GetFailbackReplicationConfigurationOutput if *v == nil { - sv = &GetLaunchConfigurationOutput{} + sv = &GetFailbackReplicationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "copyPrivateIp": + case "bandwidthThrottling": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } - sv.CopyPrivateIp = ptr.Bool(jtv) - } - - case "copyTags": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.CopyTags = ptr.Bool(jtv) + sv.BandwidthThrottling = i64 } - case "ec2LaunchTemplateID": + case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } - sv.Ec2LaunchTemplateID = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "launchDisposition": + case "recoveryInstanceID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecoveryInstanceID to be of type string, got %T instead", value) + } + sv.RecoveryInstanceID = ptr.String(jtv) + } + + case "usePrivateIP": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.UsePrivateIP = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetLaunchConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetLaunchConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetLaunchConfiguration) HandleDeserialize(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_deserializeOpErrorGetLaunchConfiguration(response, &metadata) + } + output := &GetLaunchConfigurationOutput{} + 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_deserializeOpDocumentGetLaunchConfigurationOutput(&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_deserializeOpErrorGetLaunchConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("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("UninitializedAccountException", errorCode): + return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetLaunchConfigurationOutput(v **GetLaunchConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetLaunchConfigurationOutput + if *v == nil { + sv = &GetLaunchConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "copyPrivateIp": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.CopyPrivateIp = ptr.Bool(jtv) + } + + case "copyTags": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.CopyTags = ptr.Bool(jtv) + } + + case "ec2LaunchTemplateID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) + } + sv.Ec2LaunchTemplateID = ptr.String(jtv) + } + + case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { @@ -3747,13 +4517,588 @@ func awsRestjson1_deserializeOpDocumentListStagingAccountsOutput(v **ListStaging return err } - case "nextToken": + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRetryDataReplication struct { +} + +func (*awsRestjson1_deserializeOpRetryDataReplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRetryDataReplication) HandleDeserialize(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_deserializeOpErrorRetryDataReplication(response, &metadata) + } + output := &RetryDataReplicationOutput{} + 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_deserializeOpDocumentRetryDataReplicationOutput(&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_deserializeOpErrorRetryDataReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("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("UninitializedAccountException", errorCode): + return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRetryDataReplicationOutput(v **RetryDataReplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RetryDataReplicationOutput + if *v == nil { + sv = &RetryDataReplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "dataReplicationInfo": + if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { + return err + } + + case "lastLaunchResult": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LastLaunchResult to be of type string, got %T instead", value) + } + sv.LastLaunchResult = types.LastLaunchResult(jtv) + } + + case "lifeCycle": + if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { + return err + } + + case "recoveryInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecoveryInstanceID to be of type string, got %T instead", value) + } + sv.RecoveryInstanceId = ptr.String(jtv) + } + + case "replicationDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReplicationDirection to be of type string, got %T instead", value) + } + sv.ReplicationDirection = types.ReplicationDirection(jtv) + } + + case "reversedDirectionSourceServerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceServerARN to be of type string, got %T instead", value) + } + sv.ReversedDirectionSourceServerArn = ptr.String(jtv) + } + + case "sourceCloudProperties": + if err := awsRestjson1_deserializeDocumentSourceCloudProperties(&sv.SourceCloudProperties, value); err != nil { + return err + } + + case "sourceNetworkID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceNetworkID to be of type string, got %T instead", value) + } + sv.SourceNetworkID = ptr.String(jtv) + } + + case "sourceProperties": + if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { + return err + } + + case "sourceServerID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) + } + sv.SourceServerID = ptr.String(jtv) + } + + case "stagingArea": + if err := awsRestjson1_deserializeDocumentStagingArea(&sv.StagingArea, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpReverseReplication struct { +} + +func (*awsRestjson1_deserializeOpReverseReplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpReverseReplication) HandleDeserialize(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_deserializeOpErrorReverseReplication(response, &metadata) + } + output := &ReverseReplicationOutput{} + 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_deserializeOpDocumentReverseReplicationOutput(&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_deserializeOpErrorReverseReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("UninitializedAccountException", errorCode): + return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentReverseReplicationOutput(v **ReverseReplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ReverseReplicationOutput + if *v == nil { + sv = &ReverseReplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "reversedDirectionSourceServerArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected SourceServerARN to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ReversedDirectionSourceServerArn = ptr.String(jtv) } default: @@ -3765,14 +5110,14 @@ func awsRestjson1_deserializeOpDocumentListStagingAccountsOutput(v **ListStaging return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpStartFailbackLaunch struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpStartFailbackLaunch) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartFailbackLaunch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3786,9 +5131,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartFailbackLaunch(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &StartFailbackLaunchOutput{} out.Result = output var buff [1024]byte @@ -3809,7 +5154,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartFailbackLaunchOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3822,7 +5167,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartFailbackLaunch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3863,18 +5208,21 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } 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("UninitializedAccountException", errorCode): + return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3888,7 +5236,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartFailbackLaunchOutput(v **StartFailbackLaunchOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3901,17 +5249,17 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *StartFailbackLaunchOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &StartFailbackLaunchOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + case "job": + if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { return err } @@ -3924,14 +5272,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpRetryDataReplication struct { +type awsRestjson1_deserializeOpStartRecovery struct { } -func (*awsRestjson1_deserializeOpRetryDataReplication) ID() string { +func (*awsRestjson1_deserializeOpStartRecovery) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRetryDataReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartRecovery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3945,9 +5293,9 @@ func (m *awsRestjson1_deserializeOpRetryDataReplication) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRetryDataReplication(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartRecovery(response, &metadata) } - output := &RetryDataReplicationOutput{} + output := &StartRecoveryOutput{} out.Result = output var buff [1024]byte @@ -3968,7 +5316,7 @@ func (m *awsRestjson1_deserializeOpRetryDataReplication) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentRetryDataReplicationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartRecoveryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3981,7 +5329,7 @@ func (m *awsRestjson1_deserializeOpRetryDataReplication) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorRetryDataReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartRecovery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4022,11 +5370,14 @@ func awsRestjson1_deserializeOpErrorRetryDataReplication(response *smithyhttp.Re } 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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4034,9 +5385,6 @@ func awsRestjson1_deserializeOpErrorRetryDataReplication(response *smithyhttp.Re case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4047,7 +5395,7 @@ func awsRestjson1_deserializeOpErrorRetryDataReplication(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentRetryDataReplicationOutput(v **RetryDataReplicationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartRecoveryOutput(v **StartRecoveryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4060,96 +5408,17 @@ func awsRestjson1_deserializeOpDocumentRetryDataReplicationOutput(v **RetryDataR return fmt.Errorf("unexpected JSON type %v", value) } - var sv *RetryDataReplicationOutput + var sv *StartRecoveryOutput if *v == nil { - sv = &RetryDataReplicationOutput{} + sv = &StartRecoveryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "dataReplicationInfo": - if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { - return err - } - - case "lastLaunchResult": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LastLaunchResult to be of type string, got %T instead", value) - } - sv.LastLaunchResult = types.LastLaunchResult(jtv) - } - - case "lifeCycle": - if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { - return err - } - - case "recoveryInstanceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RecoveryInstanceID to be of type string, got %T instead", value) - } - sv.RecoveryInstanceId = ptr.String(jtv) - } - - case "replicationDirection": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReplicationDirection to be of type string, got %T instead", value) - } - sv.ReplicationDirection = types.ReplicationDirection(jtv) - } - - case "reversedDirectionSourceServerArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SourceServerARN to be of type string, got %T instead", value) - } - sv.ReversedDirectionSourceServerArn = ptr.String(jtv) - } - - case "sourceCloudProperties": - if err := awsRestjson1_deserializeDocumentSourceCloudProperties(&sv.SourceCloudProperties, value); err != nil { - return err - } - - case "sourceProperties": - if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { - return err - } - - case "sourceServerID": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) - } - sv.SourceServerID = ptr.String(jtv) - } - - case "stagingArea": - if err := awsRestjson1_deserializeDocumentStagingArea(&sv.StagingArea, value); err != nil { - return err - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + case "job": + if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { return err } @@ -4162,14 +5431,14 @@ func awsRestjson1_deserializeOpDocumentRetryDataReplicationOutput(v **RetryDataR return nil } -type awsRestjson1_deserializeOpReverseReplication struct { +type awsRestjson1_deserializeOpStartReplication struct { } -func (*awsRestjson1_deserializeOpReverseReplication) ID() string { +func (*awsRestjson1_deserializeOpStartReplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpReverseReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4183,9 +5452,9 @@ func (m *awsRestjson1_deserializeOpReverseReplication) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorReverseReplication(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartReplication(response, &metadata) } - output := &ReverseReplicationOutput{} + output := &StartReplicationOutput{} out.Result = output var buff [1024]byte @@ -4206,7 +5475,7 @@ func (m *awsRestjson1_deserializeOpReverseReplication) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentReverseReplicationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4219,7 +5488,7 @@ func (m *awsRestjson1_deserializeOpReverseReplication) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorReverseReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4260,9 +5529,6 @@ func awsRestjson1_deserializeOpErrorReverseReplication(response *smithyhttp.Resp } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) @@ -4278,9 +5544,6 @@ func awsRestjson1_deserializeOpErrorReverseReplication(response *smithyhttp.Resp case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4291,7 +5554,7 @@ func awsRestjson1_deserializeOpErrorReverseReplication(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentReverseReplicationOutput(v **ReverseReplicationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartReplicationOutput(v **StartReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4304,22 +5567,18 @@ func awsRestjson1_deserializeOpDocumentReverseReplicationOutput(v **ReverseRepli return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ReverseReplicationOutput + var sv *StartReplicationOutput if *v == nil { - sv = &ReverseReplicationOutput{} + sv = &StartReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "reversedDirectionSourceServerArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SourceServerARN to be of type string, got %T instead", value) - } - sv.ReversedDirectionSourceServerArn = ptr.String(jtv) + case "sourceServer": + if err := awsRestjson1_deserializeDocumentSourceServer(&sv.SourceServer, value); err != nil { + return err } default: @@ -4331,14 +5590,14 @@ func awsRestjson1_deserializeOpDocumentReverseReplicationOutput(v **ReverseRepli return nil } -type awsRestjson1_deserializeOpStartFailbackLaunch struct { +type awsRestjson1_deserializeOpStartSourceNetworkRecovery struct { } -func (*awsRestjson1_deserializeOpStartFailbackLaunch) ID() string { +func (*awsRestjson1_deserializeOpStartSourceNetworkRecovery) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartFailbackLaunch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartSourceNetworkRecovery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4352,9 +5611,9 @@ func (m *awsRestjson1_deserializeOpStartFailbackLaunch) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartFailbackLaunch(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartSourceNetworkRecovery(response, &metadata) } - output := &StartFailbackLaunchOutput{} + output := &StartSourceNetworkRecoveryOutput{} out.Result = output var buff [1024]byte @@ -4375,7 +5634,7 @@ func (m *awsRestjson1_deserializeOpStartFailbackLaunch) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartFailbackLaunchOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartSourceNetworkRecoveryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4388,7 +5647,7 @@ func (m *awsRestjson1_deserializeOpStartFailbackLaunch) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartFailbackLaunch(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartSourceNetworkRecovery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4457,7 +5716,7 @@ func awsRestjson1_deserializeOpErrorStartFailbackLaunch(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentStartFailbackLaunchOutput(v **StartFailbackLaunchOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartSourceNetworkRecoveryOutput(v **StartSourceNetworkRecoveryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4470,9 +5729,9 @@ func awsRestjson1_deserializeOpDocumentStartFailbackLaunchOutput(v **StartFailba return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartFailbackLaunchOutput + var sv *StartSourceNetworkRecoveryOutput if *v == nil { - sv = &StartFailbackLaunchOutput{} + sv = &StartSourceNetworkRecoveryOutput{} } else { sv = *v } @@ -4493,14 +5752,14 @@ func awsRestjson1_deserializeOpDocumentStartFailbackLaunchOutput(v **StartFailba return nil } -type awsRestjson1_deserializeOpStartRecovery struct { +type awsRestjson1_deserializeOpStartSourceNetworkReplication struct { } -func (*awsRestjson1_deserializeOpStartRecovery) ID() string { +func (*awsRestjson1_deserializeOpStartSourceNetworkReplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartRecovery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartSourceNetworkReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4514,9 +5773,9 @@ func (m *awsRestjson1_deserializeOpStartRecovery) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartRecovery(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartSourceNetworkReplication(response, &metadata) } - output := &StartRecoveryOutput{} + output := &StartSourceNetworkReplicationOutput{} out.Result = output var buff [1024]byte @@ -4537,7 +5796,7 @@ func (m *awsRestjson1_deserializeOpStartRecovery) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartRecoveryOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartSourceNetworkReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4550,7 +5809,7 @@ func (m *awsRestjson1_deserializeOpStartRecovery) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartRecovery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartSourceNetworkReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4597,8 +5856,8 @@ func awsRestjson1_deserializeOpErrorStartRecovery(response *smithyhttp.Response, case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4616,7 +5875,7 @@ func awsRestjson1_deserializeOpErrorStartRecovery(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentStartRecoveryOutput(v **StartRecoveryOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartSourceNetworkReplicationOutput(v **StartSourceNetworkReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4629,17 +5888,17 @@ func awsRestjson1_deserializeOpDocumentStartRecoveryOutput(v **StartRecoveryOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartRecoveryOutput + var sv *StartSourceNetworkReplicationOutput if *v == nil { - sv = &StartRecoveryOutput{} + sv = &StartSourceNetworkReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "job": - if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { + case "sourceNetwork": + if err := awsRestjson1_deserializeDocumentSourceNetwork(&sv.SourceNetwork, value); err != nil { return err } @@ -4652,14 +5911,14 @@ func awsRestjson1_deserializeOpDocumentStartRecoveryOutput(v **StartRecoveryOutp return nil } -type awsRestjson1_deserializeOpStartReplication struct { +type awsRestjson1_deserializeOpStopFailback struct { } -func (*awsRestjson1_deserializeOpStartReplication) ID() string { +func (*awsRestjson1_deserializeOpStopFailback) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStopFailback) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4673,43 +5932,21 @@ func (m *awsRestjson1_deserializeOpStartReplication) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartReplication(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStopFailback(response, &metadata) } - output := &StartReplicationOutput{} + output := &StopFailbackOutput{} 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_deserializeOpDocumentStartReplicationOutput(&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(), + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStopFailback(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4750,9 +5987,6 @@ func awsRestjson1_deserializeOpErrorStartReplication(response *smithyhttp.Respon } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -4775,50 +6009,14 @@ func awsRestjson1_deserializeOpErrorStartReplication(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentStartReplicationOutput(v **StartReplicationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *StartReplicationOutput - if *v == nil { - sv = &StartReplicationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "sourceServer": - if err := awsRestjson1_deserializeDocumentSourceServer(&sv.SourceServer, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpStopFailback struct { +type awsRestjson1_deserializeOpStopReplication struct { } -func (*awsRestjson1_deserializeOpStopFailback) ID() string { +func (*awsRestjson1_deserializeOpStopReplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStopFailback) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStopReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4832,21 +6030,43 @@ func (m *awsRestjson1_deserializeOpStopFailback) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStopFailback(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStopReplication(response, &metadata) } - output := &StopFailbackOutput{} + output := &StopReplicationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentStopReplicationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorStopFailback(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStopReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4887,6 +6107,9 @@ func awsRestjson1_deserializeOpErrorStopFailback(response *smithyhttp.Response, } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -4909,14 +6132,50 @@ func awsRestjson1_deserializeOpErrorStopFailback(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpStopReplication struct { +func awsRestjson1_deserializeOpDocumentStopReplicationOutput(v **StopReplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StopReplicationOutput + if *v == nil { + sv = &StopReplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sourceServer": + if err := awsRestjson1_deserializeDocumentSourceServer(&sv.SourceServer, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpStopReplication) ID() string { +type awsRestjson1_deserializeOpStopSourceNetworkReplication struct { +} + +func (*awsRestjson1_deserializeOpStopSourceNetworkReplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStopReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStopSourceNetworkReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4930,9 +6189,9 @@ func (m *awsRestjson1_deserializeOpStopReplication) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStopReplication(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStopSourceNetworkReplication(response, &metadata) } - output := &StopReplicationOutput{} + output := &StopSourceNetworkReplicationOutput{} out.Result = output var buff [1024]byte @@ -4953,7 +6212,7 @@ func (m *awsRestjson1_deserializeOpStopReplication) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStopReplicationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStopSourceNetworkReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4966,7 +6225,7 @@ func (m *awsRestjson1_deserializeOpStopReplication) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorStopReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStopSourceNetworkReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5022,6 +6281,9 @@ func awsRestjson1_deserializeOpErrorStopReplication(response *smithyhttp.Respons case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5032,7 +6294,7 @@ func awsRestjson1_deserializeOpErrorStopReplication(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentStopReplicationOutput(v **StopReplicationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStopSourceNetworkReplicationOutput(v **StopSourceNetworkReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5045,17 +6307,17 @@ func awsRestjson1_deserializeOpDocumentStopReplicationOutput(v **StopReplication return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StopReplicationOutput + var sv *StopSourceNetworkReplicationOutput if *v == nil { - sv = &StopReplicationOutput{} + sv = &StopSourceNetworkReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "sourceServer": - if err := awsRestjson1_deserializeDocumentSourceServer(&sv.SourceServer, value); err != nil { + case "sourceNetwork": + if err := awsRestjson1_deserializeDocumentSourceNetwork(&sv.SourceNetwork, value); err != nil { return err } @@ -7772,6 +9034,46 @@ func awsRestjson1_deserializeDocumentEbsSnapshotsList(v *[]string, value interfa return nil } +func awsRestjson1_deserializeDocumentEventResourceData(v *types.EventResourceData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.EventResourceData +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "sourceNetworkData": + var mv types.SourceNetworkData + destAddr := &mv + if err := awsRestjson1_deserializeDocumentSourceNetworkData(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.EventResourceDataMemberSourceNetworkData{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + func awsRestjson1_deserializeDocumentIdentificationHints(v **types.IdentificationHints, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7995,6 +9297,11 @@ func awsRestjson1_deserializeDocumentJob(v **types.Job, value interface{}) error sv.JobID = ptr.String(jtv) } + case "participatingResources": + if err := awsRestjson1_deserializeDocumentParticipatingResources(&sv.ParticipatingResources, value); err != nil { + return err + } + case "participatingServers": if err := awsRestjson1_deserializeDocumentParticipatingServers(&sv.ParticipatingServers, value); err != nil { return err @@ -8122,6 +9429,11 @@ func awsRestjson1_deserializeDocumentJobLogEventData(v **types.JobLogEventData, sv.ConversionServerID = ptr.String(jtv) } + case "eventResourceData": + if err := awsRestjson1_deserializeDocumentEventResourceData(&sv.EventResourceData, value); err != nil { + return err + } + case "rawError": if value != nil { jtv, ok := value.(string) @@ -8275,6 +9587,15 @@ func awsRestjson1_deserializeDocumentLaunchConfigurationTemplate(v **types.Launc sv.CopyTags = ptr.Bool(jtv) } + case "exportBucketArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.ExportBucketArn = ptr.String(jtv) + } + case "launchConfigurationTemplateID": if value != nil { jtv, ok := value.(string) @@ -8689,12 +10010,133 @@ func awsRestjson1_deserializeDocumentOS(v **types.OS, value interface{}) error { sv.FullString = ptr.String(jtv) } - default: - _, _ = key, value + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParticipatingResource(v **types.ParticipatingResource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ParticipatingResource + if *v == nil { + sv = &types.ParticipatingResource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "launchStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LaunchStatus to be of type string, got %T instead", value) + } + sv.LaunchStatus = types.LaunchStatus(jtv) + } + + case "participatingResourceID": + if err := awsRestjson1_deserializeDocumentParticipatingResourceID(&sv.ParticipatingResourceID, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParticipatingResourceID(v *types.ParticipatingResourceID, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.ParticipatingResourceID +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "sourceNetworkID": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceNetworkID to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.ParticipatingResourceIDMemberSourceNetworkID{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentParticipatingResources(v *[]types.ParticipatingResource, 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.ParticipatingResource + if *v == nil { + cv = []types.ParticipatingResource{} + } else { + cv = *v + } + for _, value := range shape { + var col types.ParticipatingResource + destAddr := &col + if err := awsRestjson1_deserializeDocumentParticipatingResource(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } @@ -9733,6 +11175,68 @@ func awsRestjson1_deserializeDocumentRecoveryInstanceProperties(v **types.Recove return nil } +func awsRestjson1_deserializeDocumentRecoveryLifeCycle(v **types.RecoveryLifeCycle, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RecoveryLifeCycle + if *v == nil { + sv = &types.RecoveryLifeCycle{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "apiCallDateTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.ApiCallDateTime = ptr.Time(t) + } + + case "jobID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobID to be of type string, got %T instead", value) + } + sv.JobID = ptr.String(jtv) + } + + case "lastRecoveryResult": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecoveryResult to be of type string, got %T instead", value) + } + sv.LastRecoveryResult = types.RecoveryResult(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentRecoverySnapshot(v **types.RecoverySnapshot, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10418,6 +11922,229 @@ func awsRestjson1_deserializeDocumentSourceCloudProperties(v **types.SourceCloud return nil } +func awsRestjson1_deserializeDocumentSourceNetwork(v **types.SourceNetwork, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SourceNetwork + if *v == nil { + sv = &types.SourceNetwork{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "cfnStackName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CfnStackName to be of type string, got %T instead", value) + } + sv.CfnStackName = ptr.String(jtv) + } + + case "lastRecovery": + if err := awsRestjson1_deserializeDocumentRecoveryLifeCycle(&sv.LastRecovery, value); err != nil { + return err + } + + case "launchedVpcID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcID to be of type string, got %T instead", value) + } + sv.LaunchedVpcID = ptr.String(jtv) + } + + case "replicationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReplicationStatus to be of type string, got %T instead", value) + } + sv.ReplicationStatus = types.ReplicationStatus(jtv) + } + + case "replicationStatusDetails": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveBoundedString to be of type string, got %T instead", value) + } + sv.ReplicationStatusDetails = ptr.String(jtv) + } + + case "sourceAccountID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountID to be of type string, got %T instead", value) + } + sv.SourceAccountID = ptr.String(jtv) + } + + case "sourceNetworkID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceNetworkID to be of type string, got %T instead", value) + } + sv.SourceNetworkID = ptr.String(jtv) + } + + case "sourceRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsRegion to be of type string, got %T instead", value) + } + sv.SourceRegion = ptr.String(jtv) + } + + case "sourceVpcID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcID to be of type string, got %T instead", value) + } + sv.SourceVpcID = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSourceNetworkData(v **types.SourceNetworkData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SourceNetworkData + if *v == nil { + sv = &types.SourceNetworkData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sourceNetworkID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceNetworkID to be of type string, got %T instead", value) + } + sv.SourceNetworkID = ptr.String(jtv) + } + + case "sourceVpc": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcID to be of type string, got %T instead", value) + } + sv.SourceVpc = ptr.String(jtv) + } + + case "stackName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) + } + sv.StackName = ptr.String(jtv) + } + + case "targetVpc": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcID to be of type string, got %T instead", value) + } + sv.TargetVpc = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSourceNetworksList(v *[]types.SourceNetwork, 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.SourceNetwork + if *v == nil { + cv = []types.SourceNetwork{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SourceNetwork + destAddr := &col + if err := awsRestjson1_deserializeDocumentSourceNetwork(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentSourceProperties(v **types.SourceProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10596,6 +12323,15 @@ func awsRestjson1_deserializeDocumentSourceServer(v **types.SourceServer, value return err } + case "sourceNetworkID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceNetworkID to be of type string, got %T instead", value) + } + sv.SourceNetworkID = ptr.String(jtv) + } + case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err diff --git a/service/drs/generated.json b/service/drs/generated.json index 2f24b9a58bd..095d0998b7c 100644 --- a/service/drs/generated.json +++ b/service/drs/generated.json @@ -8,13 +8,16 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_AssociateSourceNetworkStack.go", "api_op_CreateExtendedSourceServer.go", "api_op_CreateLaunchConfigurationTemplate.go", "api_op_CreateReplicationConfigurationTemplate.go", + "api_op_CreateSourceNetwork.go", "api_op_DeleteJob.go", "api_op_DeleteLaunchConfigurationTemplate.go", "api_op_DeleteRecoveryInstance.go", "api_op_DeleteReplicationConfigurationTemplate.go", + "api_op_DeleteSourceNetwork.go", "api_op_DeleteSourceServer.go", "api_op_DescribeJobLogItems.go", "api_op_DescribeJobs.go", @@ -22,9 +25,11 @@ "api_op_DescribeRecoveryInstances.go", "api_op_DescribeRecoverySnapshots.go", "api_op_DescribeReplicationConfigurationTemplates.go", + "api_op_DescribeSourceNetworks.go", "api_op_DescribeSourceServers.go", "api_op_DisconnectRecoveryInstance.go", "api_op_DisconnectSourceServer.go", + "api_op_ExportSourceNetworkCfnTemplate.go", "api_op_GetFailbackReplicationConfiguration.go", "api_op_GetLaunchConfiguration.go", "api_op_GetReplicationConfiguration.go", @@ -37,8 +42,11 @@ "api_op_StartFailbackLaunch.go", "api_op_StartRecovery.go", "api_op_StartReplication.go", + "api_op_StartSourceNetworkRecovery.go", + "api_op_StartSourceNetworkReplication.go", "api_op_StopFailback.go", "api_op_StopReplication.go", + "api_op_StopSourceNetworkReplication.go", "api_op_TagResource.go", "api_op_TerminateRecoveryInstances.go", "api_op_UntagResource.go", @@ -58,6 +66,7 @@ "types/enums.go", "types/errors.go", "types/types.go", + "types/types_exported_test.go", "validators.go" ], "go": "1.15", diff --git a/service/drs/serializers.go b/service/drs/serializers.go index f06ad74ac76..ed618bc4c42 100644 --- a/service/drs/serializers.go +++ b/service/drs/serializers.go @@ -14,6 +14,79 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpAssociateSourceNetworkStack struct { +} + +func (*awsRestjson1_serializeOpAssociateSourceNetworkStack) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateSourceNetworkStack) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateSourceNetworkStackInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/AssociateSourceNetworkStack") + 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_serializeOpDocumentAssociateSourceNetworkStackInput(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_serializeOpHttpBindingsAssociateSourceNetworkStackInput(v *AssociateSourceNetworkStackInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateSourceNetworkStackInput(v *AssociateSourceNetworkStackInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CfnStackName != nil { + ok := object.Key("cfnStackName") + ok.String(*v.CfnStackName) + } + + if v.SourceNetworkID != nil { + ok := object.Key("sourceNetworkID") + ok.String(*v.SourceNetworkID) + } + + return nil +} + type awsRestjson1_serializeOpCreateExtendedSourceServer struct { } @@ -159,6 +232,11 @@ func awsRestjson1_serializeOpDocumentCreateLaunchConfigurationTemplateInput(v *C ok.Boolean(*v.CopyTags) } + if v.ExportBucketArn != nil { + ok := object.Key("exportBucketArn") + ok.String(*v.ExportBucketArn) + } + if len(v.LaunchDisposition) > 0 { ok := object.Key("launchDisposition") ok.String(string(v.LaunchDisposition)) @@ -332,6 +410,91 @@ func awsRestjson1_serializeOpDocumentCreateReplicationConfigurationTemplateInput return nil } +type awsRestjson1_serializeOpCreateSourceNetwork struct { +} + +func (*awsRestjson1_serializeOpCreateSourceNetwork) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSourceNetwork) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSourceNetworkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/CreateSourceNetwork") + 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_serializeOpDocumentCreateSourceNetworkInput(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_serializeOpHttpBindingsCreateSourceNetworkInput(v *CreateSourceNetworkInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSourceNetworkInput(v *CreateSourceNetworkInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OriginAccountID != nil { + ok := object.Key("originAccountID") + ok.String(*v.OriginAccountID) + } + + if v.OriginRegion != nil { + ok := object.Key("originRegion") + ok.String(*v.OriginRegion) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + return err + } + } + + if v.VpcID != nil { + ok := object.Key("vpcID") + ok.String(*v.VpcID) + } + + return nil +} + type awsRestjson1_serializeOpDeleteJob struct { } @@ -604,6 +767,74 @@ func awsRestjson1_serializeOpDocumentDeleteReplicationConfigurationTemplateInput return nil } +type awsRestjson1_serializeOpDeleteSourceNetwork struct { +} + +func (*awsRestjson1_serializeOpDeleteSourceNetwork) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSourceNetwork) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSourceNetworkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteSourceNetwork") + 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_serializeOpDocumentDeleteSourceNetworkInput(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_serializeOpHttpBindingsDeleteSourceNetworkInput(v *DeleteSourceNetworkInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteSourceNetworkInput(v *DeleteSourceNetworkInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SourceNetworkID != nil { + ok := object.Key("sourceNetworkID") + ok.String(*v.SourceNetworkID) + } + + return nil +} + type awsRestjson1_serializeOpDeleteSourceServer struct { } @@ -1160,6 +1391,86 @@ func awsRestjson1_serializeOpDocumentDescribeReplicationConfigurationTemplatesIn return nil } +type awsRestjson1_serializeOpDescribeSourceNetworks struct { +} + +func (*awsRestjson1_serializeOpDescribeSourceNetworks) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeSourceNetworks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeSourceNetworksInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DescribeSourceNetworks") + 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_serializeOpDocumentDescribeSourceNetworksInput(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_serializeOpHttpBindingsDescribeSourceNetworksInput(v *DescribeSourceNetworksInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDescribeSourceNetworksInput(v *DescribeSourceNetworksInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentDescribeSourceNetworksRequestFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != 0 { + ok := object.Key("maxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpDescribeSourceServers struct { } @@ -1255,13 +1566,81 @@ func (m *awsRestjson1_serializeOpDisconnectRecoveryInstance) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisconnectRecoveryInstanceInput) + input, ok := in.Parameters.(*DisconnectRecoveryInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DisconnectRecoveryInstance") + 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_serializeOpDocumentDisconnectRecoveryInstanceInput(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_serializeOpHttpBindingsDisconnectRecoveryInstanceInput(v *DisconnectRecoveryInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDisconnectRecoveryInstanceInput(v *DisconnectRecoveryInstanceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RecoveryInstanceID != nil { + ok := object.Key("recoveryInstanceID") + ok.String(*v.RecoveryInstanceID) + } + + return nil +} + +type awsRestjson1_serializeOpDisconnectSourceServer struct { +} + +func (*awsRestjson1_serializeOpDisconnectSourceServer) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisconnectSourceServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisconnectSourceServerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/DisconnectRecoveryInstance") + opPath, opQuery := httpbinding.SplitURI("/DisconnectSourceServer") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1273,7 +1652,7 @@ func (m *awsRestjson1_serializeOpDisconnectRecoveryInstance) HandleSerialize(ctx restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDisconnectRecoveryInstanceInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentDisconnectSourceServerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1288,7 +1667,7 @@ func (m *awsRestjson1_serializeOpDisconnectRecoveryInstance) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDisconnectRecoveryInstanceInput(v *DisconnectRecoveryInstanceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDisconnectSourceServerInput(v *DisconnectSourceServerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1296,26 +1675,26 @@ func awsRestjson1_serializeOpHttpBindingsDisconnectRecoveryInstanceInput(v *Disc return nil } -func awsRestjson1_serializeOpDocumentDisconnectRecoveryInstanceInput(v *DisconnectRecoveryInstanceInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentDisconnectSourceServerInput(v *DisconnectSourceServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.RecoveryInstanceID != nil { - ok := object.Key("recoveryInstanceID") - ok.String(*v.RecoveryInstanceID) + if v.SourceServerID != nil { + ok := object.Key("sourceServerID") + ok.String(*v.SourceServerID) } return nil } -type awsRestjson1_serializeOpDisconnectSourceServer struct { +type awsRestjson1_serializeOpExportSourceNetworkCfnTemplate struct { } -func (*awsRestjson1_serializeOpDisconnectSourceServer) ID() string { +func (*awsRestjson1_serializeOpExportSourceNetworkCfnTemplate) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDisconnectSourceServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpExportSourceNetworkCfnTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1323,13 +1702,13 @@ func (m *awsRestjson1_serializeOpDisconnectSourceServer) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisconnectSourceServerInput) + input, ok := in.Parameters.(*ExportSourceNetworkCfnTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/DisconnectSourceServer") + opPath, opQuery := httpbinding.SplitURI("/ExportSourceNetworkCfnTemplate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1341,7 +1720,7 @@ func (m *awsRestjson1_serializeOpDisconnectSourceServer) HandleSerialize(ctx con restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDisconnectSourceServerInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentExportSourceNetworkCfnTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1356,7 +1735,7 @@ func (m *awsRestjson1_serializeOpDisconnectSourceServer) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDisconnectSourceServerInput(v *DisconnectSourceServerInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsExportSourceNetworkCfnTemplateInput(v *ExportSourceNetworkCfnTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1364,13 +1743,13 @@ func awsRestjson1_serializeOpHttpBindingsDisconnectSourceServerInput(v *Disconne return nil } -func awsRestjson1_serializeOpDocumentDisconnectSourceServerInput(v *DisconnectSourceServerInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentExportSourceNetworkCfnTemplateInput(v *ExportSourceNetworkCfnTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.SourceServerID != nil { - ok := object.Key("sourceServerID") - ok.String(*v.SourceServerID) + if v.SourceNetworkID != nil { + ok := object.Key("sourceNetworkID") + ok.String(*v.SourceNetworkID) } return nil @@ -2181,6 +2560,156 @@ func awsRestjson1_serializeOpDocumentStartReplicationInput(v *StartReplicationIn return nil } +type awsRestjson1_serializeOpStartSourceNetworkRecovery struct { +} + +func (*awsRestjson1_serializeOpStartSourceNetworkRecovery) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartSourceNetworkRecovery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartSourceNetworkRecoveryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/StartSourceNetworkRecovery") + 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_serializeOpDocumentStartSourceNetworkRecoveryInput(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_serializeOpHttpBindingsStartSourceNetworkRecoveryInput(v *StartSourceNetworkRecoveryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartSourceNetworkRecoveryInput(v *StartSourceNetworkRecoveryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeployAsNew != nil { + ok := object.Key("deployAsNew") + ok.Boolean(*v.DeployAsNew) + } + + if v.SourceNetworks != nil { + ok := object.Key("sourceNetworks") + if err := awsRestjson1_serializeDocumentStartSourceNetworkRecoveryRequestNetworkEntries(v.SourceNetworks, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStartSourceNetworkReplication struct { +} + +func (*awsRestjson1_serializeOpStartSourceNetworkReplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartSourceNetworkReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartSourceNetworkReplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/StartSourceNetworkReplication") + 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_serializeOpDocumentStartSourceNetworkReplicationInput(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_serializeOpHttpBindingsStartSourceNetworkReplicationInput(v *StartSourceNetworkReplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartSourceNetworkReplicationInput(v *StartSourceNetworkReplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SourceNetworkID != nil { + ok := object.Key("sourceNetworkID") + ok.String(*v.SourceNetworkID) + } + + return nil +} + type awsRestjson1_serializeOpStopFailback struct { } @@ -2317,6 +2846,74 @@ func awsRestjson1_serializeOpDocumentStopReplicationInput(v *StopReplicationInpu return nil } +type awsRestjson1_serializeOpStopSourceNetworkReplication struct { +} + +func (*awsRestjson1_serializeOpStopSourceNetworkReplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStopSourceNetworkReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StopSourceNetworkReplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/StopSourceNetworkReplication") + 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_serializeOpDocumentStopSourceNetworkReplicationInput(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_serializeOpHttpBindingsStopSourceNetworkReplicationInput(v *StopSourceNetworkReplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStopSourceNetworkReplicationInput(v *StopSourceNetworkReplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SourceNetworkID != nil { + ok := object.Key("sourceNetworkID") + ok.String(*v.SourceNetworkID) + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } @@ -2787,6 +3384,11 @@ func awsRestjson1_serializeOpDocumentUpdateLaunchConfigurationTemplateInput(v *U ok.Boolean(*v.CopyTags) } + if v.ExportBucketArn != nil { + ok := object.Key("exportBucketArn") + ok.String(*v.ExportBucketArn) + } + if v.LaunchConfigurationTemplateID != nil { ok := object.Key("launchConfigurationTemplateID") ok.String(*v.LaunchConfigurationTemplateID) @@ -3201,6 +3803,41 @@ func awsRestjson1_serializeDocumentDescribeRecoverySnapshotsRequestFilters(v *ty return nil } +func awsRestjson1_serializeDocumentDescribeSourceNetworksRequestFilters(v *types.DescribeSourceNetworksRequestFilters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OriginAccountID != nil { + ok := object.Key("originAccountID") + ok.String(*v.OriginAccountID) + } + + if v.OriginRegion != nil { + ok := object.Key("originRegion") + ok.String(*v.OriginRegion) + } + + if v.SourceNetworkIDs != nil { + ok := object.Key("sourceNetworkIDs") + if err := awsRestjson1_serializeDocumentDescribeSourceNetworksRequestFiltersIDs(v.SourceNetworkIDs, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentDescribeSourceNetworksRequestFiltersIDs(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_serializeDocumentDescribeSourceServersRequestFilters(v *types.DescribeSourceServersRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3452,6 +4089,36 @@ func awsRestjson1_serializeDocumentStartRecoveryRequestSourceServers(v []types.S return nil } +func awsRestjson1_serializeDocumentStartSourceNetworkRecoveryRequestNetworkEntries(v []types.StartSourceNetworkRecoveryRequestNetworkEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentStartSourceNetworkRecoveryRequestNetworkEntry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentStartSourceNetworkRecoveryRequestNetworkEntry(v *types.StartSourceNetworkRecoveryRequestNetworkEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CfnStackName != nil { + ok := object.Key("cfnStackName") + ok.String(*v.CfnStackName) + } + + if v.SourceNetworkID != nil { + ok := object.Key("sourceNetworkID") + ok.String(*v.SourceNetworkID) + } + + return nil +} + func awsRestjson1_serializeDocumentTagsMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/drs/types/enums.go b/service/drs/types/enums.go index 7c73a6f77ba..170ae948ddd 100644 --- a/service/drs/types/enums.go +++ b/service/drs/types/enums.go @@ -300,6 +300,9 @@ const ( InitiatedByDiagnostic InitiatedBy = "DIAGNOSTIC" InitiatedByTerminateRecoveryInstances InitiatedBy = "TERMINATE_RECOVERY_INSTANCES" InitiatedByTargetAccount InitiatedBy = "TARGET_ACCOUNT" + InitiatedByCreateNetworkRecovery InitiatedBy = "CREATE_NETWORK_RECOVERY" + InitiatedByUpdateNetworkRecovery InitiatedBy = "UPDATE_NETWORK_RECOVERY" + InitiatedByAssociateNetworkRecovery InitiatedBy = "ASSOCIATE_NETWORK_RECOVERY" ) // Values returns all known values for InitiatedBy. Note that this can be expanded @@ -313,6 +316,9 @@ func (InitiatedBy) Values() []InitiatedBy { "DIAGNOSTIC", "TERMINATE_RECOVERY_INSTANCES", "TARGET_ACCOUNT", + "CREATE_NETWORK_RECOVERY", + "UPDATE_NETWORK_RECOVERY", + "ASSOCIATE_NETWORK_RECOVERY", } } @@ -320,23 +326,33 @@ type JobLogEvent string // Enum values for JobLogEvent const ( - JobLogEventJobStart JobLogEvent = "JOB_START" - JobLogEventServerSkipped JobLogEvent = "SERVER_SKIPPED" - JobLogEventCleanupStart JobLogEvent = "CLEANUP_START" - JobLogEventCleanupEnd JobLogEvent = "CLEANUP_END" - JobLogEventCleanupFail JobLogEvent = "CLEANUP_FAIL" - JobLogEventSnapshotStart JobLogEvent = "SNAPSHOT_START" - JobLogEventSnapshotEnd JobLogEvent = "SNAPSHOT_END" - JobLogEventSnapshotFail JobLogEvent = "SNAPSHOT_FAIL" - JobLogEventUsingPreviousSnapshot JobLogEvent = "USING_PREVIOUS_SNAPSHOT" - JobLogEventUsingPreviousSnapshotFailed JobLogEvent = "USING_PREVIOUS_SNAPSHOT_FAILED" - JobLogEventConversionStart JobLogEvent = "CONVERSION_START" - JobLogEventConversionEnd JobLogEvent = "CONVERSION_END" - JobLogEventConversionFail JobLogEvent = "CONVERSION_FAIL" - JobLogEventLaunchStart JobLogEvent = "LAUNCH_START" - JobLogEventLaunchFailed JobLogEvent = "LAUNCH_FAILED" - JobLogEventJobCancel JobLogEvent = "JOB_CANCEL" - JobLogEventJobEnd JobLogEvent = "JOB_END" + JobLogEventJobStart JobLogEvent = "JOB_START" + JobLogEventServerSkipped JobLogEvent = "SERVER_SKIPPED" + JobLogEventCleanupStart JobLogEvent = "CLEANUP_START" + JobLogEventCleanupEnd JobLogEvent = "CLEANUP_END" + JobLogEventCleanupFail JobLogEvent = "CLEANUP_FAIL" + JobLogEventSnapshotStart JobLogEvent = "SNAPSHOT_START" + JobLogEventSnapshotEnd JobLogEvent = "SNAPSHOT_END" + JobLogEventSnapshotFail JobLogEvent = "SNAPSHOT_FAIL" + JobLogEventUsingPreviousSnapshot JobLogEvent = "USING_PREVIOUS_SNAPSHOT" + JobLogEventUsingPreviousSnapshotFailed JobLogEvent = "USING_PREVIOUS_SNAPSHOT_FAILED" + JobLogEventConversionStart JobLogEvent = "CONVERSION_START" + JobLogEventConversionEnd JobLogEvent = "CONVERSION_END" + JobLogEventConversionFail JobLogEvent = "CONVERSION_FAIL" + JobLogEventLaunchStart JobLogEvent = "LAUNCH_START" + JobLogEventLaunchFailed JobLogEvent = "LAUNCH_FAILED" + JobLogEventJobCancel JobLogEvent = "JOB_CANCEL" + JobLogEventJobEnd JobLogEvent = "JOB_END" + JobLogEventDeployNetworkConfigurationStart JobLogEvent = "DEPLOY_NETWORK_CONFIGURATION_START" + JobLogEventDeployNetworkConfigurationEnd JobLogEvent = "DEPLOY_NETWORK_CONFIGURATION_END" + JobLogEventDeployNetworkConfigurationFailed JobLogEvent = "DEPLOY_NETWORK_CONFIGURATION_FAILED" + JobLogEventUpdateNetworkConfigurationStart JobLogEvent = "UPDATE_NETWORK_CONFIGURATION_START" + JobLogEventUpdateNetworkConfigurationEnd JobLogEvent = "UPDATE_NETWORK_CONFIGURATION_END" + JobLogEventUpdateNetworkConfigurationFailed JobLogEvent = "UPDATE_NETWORK_CONFIGURATION_FAILED" + JobLogEventUpdateLaunchTemplateStart JobLogEvent = "UPDATE_LAUNCH_TEMPLATE_START" + JobLogEventUpdateLaunchTemplateEnd JobLogEvent = "UPDATE_LAUNCH_TEMPLATE_END" + JobLogEventUpdateLaunchTemplateFailed JobLogEvent = "UPDATE_LAUNCH_TEMPLATE_FAILED" + JobLogEventNetworkRecoveryFail JobLogEvent = "NETWORK_RECOVERY_FAIL" ) // Values returns all known values for JobLogEvent. Note that this can be expanded @@ -361,6 +377,16 @@ func (JobLogEvent) Values() []JobLogEvent { "LAUNCH_FAILED", "JOB_CANCEL", "JOB_END", + "DEPLOY_NETWORK_CONFIGURATION_START", + "DEPLOY_NETWORK_CONFIGURATION_END", + "DEPLOY_NETWORK_CONFIGURATION_FAILED", + "UPDATE_NETWORK_CONFIGURATION_START", + "UPDATE_NETWORK_CONFIGURATION_END", + "UPDATE_NETWORK_CONFIGURATION_FAILED", + "UPDATE_LAUNCH_TEMPLATE_START", + "UPDATE_LAUNCH_TEMPLATE_END", + "UPDATE_LAUNCH_TEMPLATE_FAILED", + "NETWORK_RECOVERY_FAIL", } } @@ -639,6 +665,34 @@ func (RecoveryInstanceDataReplicationState) Values() []RecoveryInstanceDataRepli } } +type RecoveryResult string + +// Enum values for RecoveryResult +const ( + RecoveryResultNotStarted RecoveryResult = "NOT_STARTED" + RecoveryResultInProgress RecoveryResult = "IN_PROGRESS" + RecoveryResultSuccess RecoveryResult = "SUCCESS" + RecoveryResultFail RecoveryResult = "FAIL" + RecoveryResultPartialSuccess RecoveryResult = "PARTIAL_SUCCESS" + RecoveryResultAssociateSuccess RecoveryResult = "ASSOCIATE_SUCCESS" + RecoveryResultAssociateFail RecoveryResult = "ASSOCIATE_FAIL" +) + +// Values returns all known values for RecoveryResult. 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 (RecoveryResult) Values() []RecoveryResult { + return []RecoveryResult{ + "NOT_STARTED", + "IN_PROGRESS", + "SUCCESS", + "FAIL", + "PARTIAL_SUCCESS", + "ASSOCIATE_SUCCESS", + "ASSOCIATE_FAIL", + } +} + type RecoverySnapshotsOrder string // Enum values for RecoverySnapshotsOrder @@ -705,6 +759,7 @@ type ReplicationConfigurationEbsEncryption string const ( ReplicationConfigurationEbsEncryptionDefault ReplicationConfigurationEbsEncryption = "DEFAULT" ReplicationConfigurationEbsEncryptionCustom ReplicationConfigurationEbsEncryption = "CUSTOM" + ReplicationConfigurationEbsEncryptionNone ReplicationConfigurationEbsEncryption = "NONE" ) // Values returns all known values for ReplicationConfigurationEbsEncryption. Note @@ -715,6 +770,7 @@ func (ReplicationConfigurationEbsEncryption) Values() []ReplicationConfiguration return []ReplicationConfigurationEbsEncryption{ "DEFAULT", "CUSTOM", + "NONE", } } @@ -765,6 +821,28 @@ func (ReplicationDirection) Values() []ReplicationDirection { } } +type ReplicationStatus string + +// Enum values for ReplicationStatus +const ( + ReplicationStatusStopped ReplicationStatus = "STOPPED" + ReplicationStatusInProgress ReplicationStatus = "IN_PROGRESS" + ReplicationStatusProtected ReplicationStatus = "PROTECTED" + ReplicationStatusError ReplicationStatus = "ERROR" +) + +// Values returns all known values for ReplicationStatus. 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 (ReplicationStatus) Values() []ReplicationStatus { + return []ReplicationStatus{ + "STOPPED", + "IN_PROGRESS", + "PROTECTED", + "ERROR", + } +} + type TargetInstanceTypeRightSizingMethod string // Enum values for TargetInstanceTypeRightSizingMethod diff --git a/service/drs/types/types.go b/service/drs/types/types.go index 0014f7a5848..cb9cc584444 100644 --- a/service/drs/types/types.go +++ b/service/drs/types/types.go @@ -4,6 +4,7 @@ package types import ( smithydocument "github.com/aws/smithy-go/document" + "time" ) // AWS account. @@ -176,6 +177,22 @@ type DescribeRecoverySnapshotsRequestFilters struct { noSmithyDocumentSerde } +// A set of filters by which to return Source Networks. +type DescribeSourceNetworksRequestFilters struct { + + // Filter Source Networks by account ID containing the protected VPCs. + OriginAccountID *string + + // Filter Source Networks by the region containing the protected VPCs. + OriginRegion *string + + // An array of Source Network IDs that should be returned. An empty array means + // all Source Networks. + SourceNetworkIDs []string + + noSmithyDocumentSerde +} + // A set of filters by which to return Source Servers. type DescribeSourceServersRequestFilters struct { @@ -206,6 +223,24 @@ type Disk struct { noSmithyDocumentSerde } +// Properties of resource related to a job event. +// +// The following types satisfy this interface: +// +// EventResourceDataMemberSourceNetworkData +type EventResourceData interface { + isEventResourceData() +} + +// Source Network properties. +type EventResourceDataMemberSourceNetworkData struct { + Value SourceNetworkData + + noSmithyDocumentSerde +} + +func (*EventResourceDataMemberSourceNetworkData) isEventResourceData() {} + // Hints used to uniquely identify a machine. type IdentificationHints struct { @@ -244,6 +279,9 @@ type Job struct { // A string representing who initiated the Job. InitiatedBy InitiatedBy + // A list of resources that the Job is acting upon. + ParticipatingResources []ParticipatingResource + // A list of servers that the Job is acting upon. ParticipatingServers []ParticipatingServer @@ -283,6 +321,9 @@ type JobLogEventData struct { // The ID of a conversion server. ConversionServerID *string + // Properties of resource related to a job event. + EventResourceData EventResourceData + // A string representing a job error. RawError *string @@ -307,6 +348,9 @@ type LaunchConfigurationTemplate struct { // Copy tags. CopyTags *bool + // S3 bucket ARN to export Source Network templates. + ExportBucketArn *string + // ID of the Launch Configuration Template. LaunchConfigurationTemplateID *string @@ -408,6 +452,36 @@ type OS struct { noSmithyDocumentSerde } +// Represents a resource participating in an asynchronous Job. +type ParticipatingResource struct { + + // The launch status of a participating resource. + LaunchStatus LaunchStatus + + // The ID of a participating resource. + ParticipatingResourceID ParticipatingResourceID + + noSmithyDocumentSerde +} + +// ID of a resource participating in an asynchronous Job. +// +// The following types satisfy this interface: +// +// ParticipatingResourceIDMemberSourceNetworkID +type ParticipatingResourceID interface { + isParticipatingResourceID() +} + +// Source Network ID. +type ParticipatingResourceIDMemberSourceNetworkID struct { + Value string + + noSmithyDocumentSerde +} + +func (*ParticipatingResourceIDMemberSourceNetworkID) isParticipatingResourceID() {} + // Represents a server participating in an asynchronous Job. type ParticipatingServer struct { @@ -669,6 +743,21 @@ type RecoveryInstanceProperties struct { noSmithyDocumentSerde } +// An object representing the Source Network recovery Lifecycle. +type RecoveryLifeCycle struct { + + // The date and time the last Source Network recovery was initiated. + ApiCallDateTime *time.Time + + // The ID of the Job that was used to last recover the Source Network. + JobID *string + + // The status of the last recovery status of this Source Network. + LastRecoveryResult RecoveryResult + + noSmithyDocumentSerde +} + // A snapshot of a Source Server used during recovery. type RecoverySnapshot struct { @@ -800,6 +889,68 @@ type SourceCloudProperties struct { noSmithyDocumentSerde } +// The ARN of the Source Network. +type SourceNetwork struct { + + // The ARN of the Source Network. + Arn *string + + // CloudFormation stack name that was deployed for recovering the Source Network. + CfnStackName *string + + // An object containing information regarding the last recovery of the Source + // Network. + LastRecovery *RecoveryLifeCycle + + // ID of the recovered VPC following Source Network recovery. + LaunchedVpcID *string + + // Status of Source Network Replication. Possible values: (a) STOPPED - Source + // Network is not replicating. (b) IN_PROGRESS - Source Network is being + // replicated. (c) PROTECTED - Source Network was replicated successfully and is + // being synchronized for changes. (d) ERROR - Source Network replication has + // failed + ReplicationStatus ReplicationStatus + + // Error details in case Source Network replication status is ERROR. + ReplicationStatusDetails *string + + // Account ID containing the VPC protected by the Source Network. + SourceAccountID *string + + // Source Network ID. + SourceNetworkID *string + + // Region containing the VPC protected by the Source Network. + SourceRegion *string + + // VPC ID protected by the Source Network. + SourceVpcID *string + + // A list of tags associated with the Source Network. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Properties of Source Network related to a job event. +type SourceNetworkData struct { + + // Source Network ID. + SourceNetworkID *string + + // VPC ID protected by the Source Network. + SourceVpc *string + + // CloudFormation stack name that was deployed for recovering the Source Network. + StackName *string + + // ID of the recovered VPC following Source Network recovery. + TargetVpc *string + + noSmithyDocumentSerde +} + // Properties of the Source Server machine. type SourceProperties struct { @@ -862,6 +1013,9 @@ type SourceServer struct { // Source cloud properties of the Source Server. SourceCloudProperties *SourceCloudProperties + // ID of the Source Network which is protecting this Source Server's network. + SourceNetworkID *string + // The source properties of the Source Server. SourceProperties *SourceProperties @@ -933,6 +1087,20 @@ type StartRecoveryRequestSourceServer struct { noSmithyDocumentSerde } +// An object representing the Source Network to recover. +type StartSourceNetworkRecoveryRequestNetworkEntry struct { + + // The ID of the Source Network you want to recover. + // + // This member is required. + SourceNetworkID *string + + // CloudFormation stack name to be used for recovering the network. + CfnStackName *string + + noSmithyDocumentSerde +} + // Validate exception field. type ValidationExceptionField struct { @@ -946,3 +1114,15 @@ type ValidationExceptionField struct { } type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isEventResourceData() {} +func (*UnknownUnionMember) isParticipatingResourceID() {} diff --git a/service/drs/types/types_exported_test.go b/service/drs/types/types_exported_test.go new file mode 100644 index 00000000000..bbba8eaf4a3 --- /dev/null +++ b/service/drs/types/types_exported_test.go @@ -0,0 +1,44 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/drs/types" +) + +func ExampleEventResourceData_outputUsage() { + var union types.EventResourceData + // type switches can be used to check the union value + switch v := union.(type) { + case *types.EventResourceDataMemberSourceNetworkData: + _ = v.Value // Value is types.SourceNetworkData + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.SourceNetworkData + +func ExampleParticipatingResourceID_outputUsage() { + var union types.ParticipatingResourceID + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ParticipatingResourceIDMemberSourceNetworkID: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string diff --git a/service/drs/validators.go b/service/drs/validators.go index aaf53a08092..ed9c6b3751d 100644 --- a/service/drs/validators.go +++ b/service/drs/validators.go @@ -10,6 +10,26 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpAssociateSourceNetworkStack struct { +} + +func (*validateOpAssociateSourceNetworkStack) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateSourceNetworkStack) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateSourceNetworkStackInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateSourceNetworkStackInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateExtendedSourceServer struct { } @@ -50,6 +70,26 @@ func (m *validateOpCreateReplicationConfigurationTemplate) HandleInitialize(ctx return next.HandleInitialize(ctx, in) } +type validateOpCreateSourceNetwork struct { +} + +func (*validateOpCreateSourceNetwork) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSourceNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSourceNetworkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSourceNetworkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteJob struct { } @@ -130,6 +170,26 @@ func (m *validateOpDeleteReplicationConfigurationTemplate) HandleInitialize(ctx return next.HandleInitialize(ctx, in) } +type validateOpDeleteSourceNetwork struct { +} + +func (*validateOpDeleteSourceNetwork) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSourceNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSourceNetworkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSourceNetworkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteSourceServer struct { } @@ -230,6 +290,26 @@ func (m *validateOpDisconnectSourceServer) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpExportSourceNetworkCfnTemplate struct { +} + +func (*validateOpExportSourceNetworkCfnTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpExportSourceNetworkCfnTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ExportSourceNetworkCfnTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpExportSourceNetworkCfnTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetFailbackReplicationConfiguration struct { } @@ -430,6 +510,46 @@ func (m *validateOpStartReplication) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpStartSourceNetworkRecovery struct { +} + +func (*validateOpStartSourceNetworkRecovery) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartSourceNetworkRecovery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartSourceNetworkRecoveryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartSourceNetworkRecoveryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartSourceNetworkReplication struct { +} + +func (*validateOpStartSourceNetworkReplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartSourceNetworkReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartSourceNetworkReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartSourceNetworkReplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStopFailback struct { } @@ -470,6 +590,26 @@ func (m *validateOpStopReplication) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpStopSourceNetworkReplication struct { +} + +func (*validateOpStopSourceNetworkReplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopSourceNetworkReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopSourceNetworkReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopSourceNetworkReplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -630,6 +770,10 @@ func (m *validateOpUpdateReplicationConfigurationTemplate) HandleInitialize(ctx return next.HandleInitialize(ctx, in) } +func addOpAssociateSourceNetworkStackValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateSourceNetworkStack{}, middleware.After) +} + func addOpCreateExtendedSourceServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateExtendedSourceServer{}, middleware.After) } @@ -638,6 +782,10 @@ func addOpCreateReplicationConfigurationTemplateValidationMiddleware(stack *midd return stack.Initialize.Add(&validateOpCreateReplicationConfigurationTemplate{}, middleware.After) } +func addOpCreateSourceNetworkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSourceNetwork{}, middleware.After) +} + func addOpDeleteJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteJob{}, middleware.After) } @@ -654,6 +802,10 @@ func addOpDeleteReplicationConfigurationTemplateValidationMiddleware(stack *midd return stack.Initialize.Add(&validateOpDeleteReplicationConfigurationTemplate{}, middleware.After) } +func addOpDeleteSourceNetworkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSourceNetwork{}, middleware.After) +} + func addOpDeleteSourceServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSourceServer{}, middleware.After) } @@ -674,6 +826,10 @@ func addOpDisconnectSourceServerValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpDisconnectSourceServer{}, middleware.After) } +func addOpExportSourceNetworkCfnTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpExportSourceNetworkCfnTemplate{}, middleware.After) +} + func addOpGetFailbackReplicationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFailbackReplicationConfiguration{}, middleware.After) } @@ -714,6 +870,14 @@ func addOpStartReplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartReplication{}, middleware.After) } +func addOpStartSourceNetworkRecoveryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartSourceNetworkRecovery{}, middleware.After) +} + +func addOpStartSourceNetworkReplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartSourceNetworkReplication{}, middleware.After) +} + func addOpStopFailbackValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopFailback{}, middleware.After) } @@ -722,6 +886,10 @@ func addOpStopReplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopReplication{}, middleware.After) } +func addOpStopSourceNetworkReplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopSourceNetworkReplication{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -818,6 +986,56 @@ func validateStartRecoveryRequestSourceServers(v []types.StartRecoveryRequestSou } } +func validateStartSourceNetworkRecoveryRequestNetworkEntries(v []types.StartSourceNetworkRecoveryRequestNetworkEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartSourceNetworkRecoveryRequestNetworkEntries"} + for i := range v { + if err := validateStartSourceNetworkRecoveryRequestNetworkEntry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStartSourceNetworkRecoveryRequestNetworkEntry(v *types.StartSourceNetworkRecoveryRequestNetworkEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartSourceNetworkRecoveryRequestNetworkEntry"} + if v.SourceNetworkID == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceNetworkID")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociateSourceNetworkStackInput(v *AssociateSourceNetworkStackInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateSourceNetworkStackInput"} + if v.SourceNetworkID == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceNetworkID")) + } + if v.CfnStackName == nil { + invalidParams.Add(smithy.NewErrParamRequired("CfnStackName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateExtendedSourceServerInput(v *CreateExtendedSourceServerInput) error { if v == nil { return nil @@ -882,6 +1100,27 @@ func validateOpCreateReplicationConfigurationTemplateInput(v *CreateReplicationC } } +func validateOpCreateSourceNetworkInput(v *CreateSourceNetworkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSourceNetworkInput"} + if v.VpcID == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcID")) + } + if v.OriginAccountID == nil { + invalidParams.Add(smithy.NewErrParamRequired("OriginAccountID")) + } + if v.OriginRegion == nil { + invalidParams.Add(smithy.NewErrParamRequired("OriginRegion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteJobInput(v *DeleteJobInput) error { if v == nil { return nil @@ -942,6 +1181,21 @@ func validateOpDeleteReplicationConfigurationTemplateInput(v *DeleteReplicationC } } +func validateOpDeleteSourceNetworkInput(v *DeleteSourceNetworkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSourceNetworkInput"} + if v.SourceNetworkID == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceNetworkID")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteSourceServerInput(v *DeleteSourceServerInput) error { if v == nil { return nil @@ -1017,6 +1271,21 @@ func validateOpDisconnectSourceServerInput(v *DisconnectSourceServerInput) error } } +func validateOpExportSourceNetworkCfnTemplateInput(v *ExportSourceNetworkCfnTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExportSourceNetworkCfnTemplateInput"} + if v.SourceNetworkID == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceNetworkID")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetFailbackReplicationConfigurationInput(v *GetFailbackReplicationConfigurationInput) error { if v == nil { return nil @@ -1171,6 +1440,40 @@ func validateOpStartReplicationInput(v *StartReplicationInput) error { } } +func validateOpStartSourceNetworkRecoveryInput(v *StartSourceNetworkRecoveryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartSourceNetworkRecoveryInput"} + if v.SourceNetworks == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceNetworks")) + } else if v.SourceNetworks != nil { + if err := validateStartSourceNetworkRecoveryRequestNetworkEntries(v.SourceNetworks); err != nil { + invalidParams.AddNested("SourceNetworks", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartSourceNetworkReplicationInput(v *StartSourceNetworkReplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartSourceNetworkReplicationInput"} + if v.SourceNetworkID == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceNetworkID")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStopFailbackInput(v *StopFailbackInput) error { if v == nil { return nil @@ -1201,6 +1504,21 @@ func validateOpStopReplicationInput(v *StopReplicationInput) error { } } +func validateOpStopSourceNetworkReplicationInput(v *StopSourceNetworkReplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopSourceNetworkReplicationInput"} + if v.SourceNetworkID == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceNetworkID")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/ec2/api_op_AllocateAddress.go b/service/ec2/api_op_AllocateAddress.go index 1861c3ebb59..7528efc1340 100644 --- a/service/ec2/api_op_AllocateAddress.go +++ b/service/ec2/api_op_AllocateAddress.go @@ -20,22 +20,15 @@ import ( // you have brought to Amazon Web Services for use with your Amazon Web Services // resources using bring your own IP addresses (BYOIP). For more information, see // Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html) -// in the Amazon Elastic Compute Cloud User Guide. [EC2-VPC] If you release an -// Elastic IP address, you might be able to recover it. You cannot recover an -// Elastic IP address that you released after it is allocated to another Amazon Web -// Services account. You cannot recover an Elastic IP address for EC2-Classic. To -// attempt to recover an Elastic IP address that you released, specify it in this -// operation. An Elastic IP address is for use either in the EC2-Classic platform -// or in a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic -// per Region and 5 Elastic IP addresses for EC2-VPC per Region. For more -// information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) +// in the Amazon Elastic Compute Cloud User Guide. If you release an Elastic IP +// address, you might be able to recover it. You cannot recover an Elastic IP +// address that you released after it is allocated to another Amazon Web Services +// account. To attempt to recover an Elastic IP address that you released, specify +// it in this operation. For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) // in the Amazon Elastic Compute Cloud User Guide. You can allocate a carrier IP // address which is a public IP address from a telecommunication carrier, to a // network interface which resides in a subnet in a Wavelength Zone (for example an -// EC2 instance). We are retiring EC2-Classic. We recommend that you migrate from -// EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a -// VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html) in -// the Amazon Elastic Compute Cloud User Guide. +// EC2 instance). func (c *Client) AllocateAddress(ctx context.Context, params *AllocateAddressInput, optFns ...func(*Options)) (*AllocateAddressOutput, error) { if params == nil { params = &AllocateAddressInput{} @@ -53,8 +46,7 @@ func (c *Client) AllocateAddress(ctx context.Context, params *AllocateAddressInp type AllocateAddressInput struct { - // [EC2-VPC] The Elastic IP address to recover or an IPv4 address from an address - // pool. + // The Elastic IP address to recover or an IPv4 address from an address pool. Address *string // The ID of a customer-owned address pool. Use this parameter to let Amazon EC2 @@ -62,9 +54,7 @@ type AllocateAddressInput struct { // address from the address pool. CustomerOwnedIpv4Pool *string - // Indicates whether the Elastic IP address is for use with instances in a VPC or - // instances in EC2-Classic. Default: If the Region supports EC2-Classic, the - // default is standard . Otherwise, the default is vpc . + // The network ( vpc ). Domain types.DomainType // Checks whether you have the required permissions for the action, without @@ -95,12 +85,11 @@ type AllocateAddressInput struct { type AllocateAddressOutput struct { - // [EC2-VPC] The ID that Amazon Web Services assigns to represent the allocation - // of the Elastic IP address for use with instances in a VPC. + // The ID that represents the allocation of the Elastic IP address. AllocationId *string // The carrier IP address. This option is only available for network interfaces - // which reside in a subnet in a Wavelength Zone (for example an EC2 instance). + // that reside in a subnet in a Wavelength Zone. CarrierIp *string // The customer-owned IP address. @@ -109,8 +98,7 @@ type AllocateAddressOutput struct { // The ID of the customer-owned address pool. CustomerOwnedIpv4Pool *string - // Indicates whether the Elastic IP address is for use with instances in a VPC ( vpc - // ) or instances in EC2-Classic ( standard ). + // The network ( vpc ). Domain types.DomainType // The set of Availability Zones, Local Zones, or Wavelength Zones from which diff --git a/service/ec2/api_op_AllocateIpamPoolCidr.go b/service/ec2/api_op_AllocateIpamPoolCidr.go index a008072fd45..6ffb4188d82 100644 --- a/service/ec2/api_op_AllocateIpamPoolCidr.go +++ b/service/ec2/api_op_AllocateIpamPoolCidr.go @@ -12,9 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Allocate a CIDR from an IPAM pool. In IPAM, an allocation is a CIDR assignment -// from an IPAM pool to another IPAM pool or to a resource. For more information, -// see Allocate CIDRs (https://docs.aws.amazon.com/vpc/latest/ipam/allocate-cidrs-ipam.html) +// Allocate a CIDR from an IPAM pool. The Region you use should be the IPAM pool +// locale. The locale is the Amazon Web Services Region where this IPAM pool is +// available for allocations. In IPAM, an allocation is a CIDR assignment from an +// IPAM pool to another IPAM pool or to a resource. For more information, see +// Allocate CIDRs (https://docs.aws.amazon.com/vpc/latest/ipam/allocate-cidrs-ipam.html) // in the Amazon VPC IPAM User Guide. This action creates an allocation with strong // consistency. The returned CIDR will not overlap with any other allocations from // the same pool. diff --git a/service/ec2/api_op_AssociateAddress.go b/service/ec2/api_op_AssociateAddress.go index eddb7d34093..9eda1b94aa6 100644 --- a/service/ec2/api_op_AssociateAddress.go +++ b/service/ec2/api_op_AssociateAddress.go @@ -12,30 +12,19 @@ import ( // Associates an Elastic IP address, or carrier IP address (for instances that are // in subnets in Wavelength Zones) with an instance or a network interface. Before -// you can use an Elastic IP address, you must allocate it to your account. An -// Elastic IP address is for use in either the EC2-Classic platform or in a VPC. -// For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. [EC2-Classic, VPC in an -// EC2-VPC-only account] If the Elastic IP address is already associated with a -// different instance, it is disassociated from that instance and associated with -// the specified instance. If you associate an Elastic IP address with an instance -// that has an existing Elastic IP address, the existing address is disassociated -// from the instance, but remains allocated to your account. [VPC in an EC2-Classic -// account] If you don't specify a private IP address, the Elastic IP address is -// associated with the primary IP address. If the Elastic IP address is already -// associated with a different instance or a network interface, you get an error -// unless you allow reassociation. You cannot associate an Elastic IP address with -// an instance or network interface that has an existing Elastic IP address. -// [Subnets in Wavelength Zones] You can associate an IP address from the -// telecommunication carrier to the instance or network interface. You cannot -// associate an Elastic IP address with an interface in a different network border -// group. This is an idempotent operation. If you perform the operation more than -// once, Amazon EC2 doesn't return an error, and you may be charged for each time -// the Elastic IP address is remapped to the same instance. For more information, -// see the Elastic IP Addresses section of Amazon EC2 Pricing (http://aws.amazon.com/ec2/pricing/) -// . We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to -// a VPC. For more information, see Migrate from EC2-Classic to a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html) -// in the Amazon Elastic Compute Cloud User Guide. +// you can use an Elastic IP address, you must allocate it to your account. If the +// Elastic IP address is already associated with a different instance, it is +// disassociated from that instance and associated with the specified instance. If +// you associate an Elastic IP address with an instance that has an existing +// Elastic IP address, the existing address is disassociated from the instance, but +// remains allocated to your account. [Subnets in Wavelength Zones] You can +// associate an IP address from the telecommunication carrier to the instance or +// network interface. You cannot associate an Elastic IP address with an interface +// in a different network border group. This is an idempotent operation. If you +// perform the operation more than once, Amazon EC2 doesn't return an error, and +// you may be charged for each time the Elastic IP address is remapped to the same +// instance. For more information, see the Elastic IP Addresses section of Amazon +// EC2 Pricing (http://aws.amazon.com/ec2/pricing/) . func (c *Client) AssociateAddress(ctx context.Context, params *AssociateAddressInput, optFns ...func(*Options)) (*AssociateAddressOutput, error) { if params == nil { params = &AssociateAddressInput{} @@ -53,15 +42,11 @@ func (c *Client) AssociateAddress(ctx context.Context, params *AssociateAddressI type AssociateAddressInput struct { - // [EC2-VPC] The allocation ID. This is required for EC2-VPC. + // The allocation ID. This is required. AllocationId *string - // [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic - // IP address that is already associated with an instance or network interface to - // be reassociated with the specified instance or network interface. Otherwise, the - // operation fails. In a VPC in an EC2-VPC-only account, reassociation is - // automatic, therefore you can specify false to ensure the operation fails if the - // Elastic IP address is already associated with another resource. + // Reassociation is automatic, but you can specify false to ensure the operation + // fails if the Elastic IP address is already associated with another resource. AllowReassociation *bool // Checks whether you have the required permissions for the action, without @@ -71,23 +56,21 @@ type AssociateAddressInput struct { DryRun *bool // The ID of the instance. The instance must have exactly one attached network - // interface. For EC2-VPC, you can specify either the instance ID or the network - // interface ID, but not both. For EC2-Classic, you must specify an instance ID and - // the instance must be in the running state. + // interface. You can specify either the instance ID or the network interface ID, + // but not both. InstanceId *string - // [EC2-VPC] The ID of the network interface. If the instance has more than one - // network interface, you must specify a network interface ID. For EC2-VPC, you can - // specify either the instance ID or the network interface ID, but not both. + // The ID of the network interface. If the instance has more than one network + // interface, you must specify a network interface ID. You can specify either the + // instance ID or the network interface ID, but not both. NetworkInterfaceId *string - // [EC2-VPC] The primary or secondary private IP address to associate with the - // Elastic IP address. If no private IP address is specified, the Elastic IP - // address is associated with the primary private IP address. + // The primary or secondary private IP address to associate with the Elastic IP + // address. If no private IP address is specified, the Elastic IP address is + // associated with the primary private IP address. PrivateIpAddress *string - // [EC2-Classic] The Elastic IP address to associate with the instance. This is - // required for EC2-Classic. + // Deprecated. PublicIp *string noSmithyDocumentSerde @@ -95,8 +78,8 @@ type AssociateAddressInput struct { type AssociateAddressOutput struct { - // [EC2-VPC] The ID that represents the association of the Elastic IP address with - // an instance. + // The ID that represents the association of the Elastic IP address with an + // instance. AssociationId *string // Metadata pertaining to the operation's result. diff --git a/service/ec2/api_op_CreateInstanceConnectEndpoint.go b/service/ec2/api_op_CreateInstanceConnectEndpoint.go new file mode 100644 index 00000000000..2603dcb9c85 --- /dev/null +++ b/service/ec2/api_op_CreateInstanceConnectEndpoint.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an EC2 Instance Connect Endpoint. An EC2 Instance Connect Endpoint +// allows you to connect to a resource, without requiring the resource to have a +// public IPv4 address. For more information, see Connect to your resources +// without requiring a public IPv4 address using EC2 Instance Connect Endpoint (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect-Endpoint.html) +// in the Amazon EC2 User Guide. +func (c *Client) CreateInstanceConnectEndpoint(ctx context.Context, params *CreateInstanceConnectEndpointInput, optFns ...func(*Options)) (*CreateInstanceConnectEndpointOutput, error) { + if params == nil { + params = &CreateInstanceConnectEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateInstanceConnectEndpoint", params, optFns, c.addOperationCreateInstanceConnectEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateInstanceConnectEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateInstanceConnectEndpointInput struct { + + // The ID of the subnet in which to create the EC2 Instance Connect Endpoint. + // + // This member is required. + SubnetId *string + + // Unique, case-sensitive identifier that you provide to ensure the idempotency of + // the request. + ClientToken *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + // Indicates whether your client's IP address is preserved as the source. The + // value is true or false . + // - If true , your client's IP address is used when you connect to a resource. + // - If false , the elastic network interface IP address is used when you connect + // to a resource. + // Default: true + PreserveClientIp *bool + + // One or more security groups to associate with the endpoint. If you don't + // specify a security group, the default security group for your VPC will be + // associated with the endpoint. + SecurityGroupIds []string + + // The tags to apply to the EC2 Instance Connect Endpoint during creation. + TagSpecifications []types.TagSpecification + + noSmithyDocumentSerde +} + +type CreateInstanceConnectEndpointOutput struct { + + // Unique, case-sensitive idempotency token provided by the client in the the + // request. + ClientToken *string + + // Information about the EC2 Instance Connect Endpoint. + InstanceConnectEndpoint *types.Ec2InstanceConnectEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateInstanceConnectEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpCreateInstanceConnectEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateInstanceConnectEndpoint{}, 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_opCreateInstanceConnectEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateInstanceConnectEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInstanceConnectEndpoint(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_initializeOpCreateInstanceConnectEndpoint struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateInstanceConnectEndpoint) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateInstanceConnectEndpoint) 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.(*CreateInstanceConnectEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateInstanceConnectEndpointInput ") + } + + 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_opCreateInstanceConnectEndpointMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateInstanceConnectEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateInstanceConnectEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "CreateInstanceConnectEndpoint", + } +} diff --git a/service/ec2/api_op_CreateNetworkInterface.go b/service/ec2/api_op_CreateNetworkInterface.go index c5cdecfc0cd..9b155ba80fb 100644 --- a/service/ec2/api_op_CreateNetworkInterface.go +++ b/service/ec2/api_op_CreateNetworkInterface.go @@ -58,7 +58,7 @@ type CreateNetworkInterfaceInput struct { Groups []string // The type of network interface. The default is interface . The only supported - // values are efa and trunk . + // values are interface , efa , and trunk . InterfaceType types.NetworkInterfaceCreationType // The number of IPv4 prefixes that Amazon Web Services automatically assigns to diff --git a/service/ec2/api_op_DeleteInstanceConnectEndpoint.go b/service/ec2/api_op_DeleteInstanceConnectEndpoint.go new file mode 100644 index 00000000000..f2c4c816870 --- /dev/null +++ b/service/ec2/api_op_DeleteInstanceConnectEndpoint.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified EC2 Instance Connect Endpoint. +func (c *Client) DeleteInstanceConnectEndpoint(ctx context.Context, params *DeleteInstanceConnectEndpointInput, optFns ...func(*Options)) (*DeleteInstanceConnectEndpointOutput, error) { + if params == nil { + params = &DeleteInstanceConnectEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteInstanceConnectEndpoint", params, optFns, c.addOperationDeleteInstanceConnectEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteInstanceConnectEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteInstanceConnectEndpointInput struct { + + // The ID of the EC2 Instance Connect Endpoint to delete. + // + // This member is required. + InstanceConnectEndpointId *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type DeleteInstanceConnectEndpointOutput struct { + + // Information about the EC2 Instance Connect Endpoint. + InstanceConnectEndpoint *types.Ec2InstanceConnectEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteInstanceConnectEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteInstanceConnectEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteInstanceConnectEndpoint{}, 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 = addOpDeleteInstanceConnectEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInstanceConnectEndpoint(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_opDeleteInstanceConnectEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "DeleteInstanceConnectEndpoint", + } +} diff --git a/service/ec2/api_op_DescribeAddressTransfers.go b/service/ec2/api_op_DescribeAddressTransfers.go index 2fa206bf1eb..57439f92bc5 100644 --- a/service/ec2/api_op_DescribeAddressTransfers.go +++ b/service/ec2/api_op_DescribeAddressTransfers.go @@ -14,7 +14,14 @@ import ( // Describes an Elastic IP address transfer. For more information, see Transfer // Elastic IP addresses (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro) -// in the Amazon Virtual Private Cloud User Guide. +// in the Amazon Virtual Private Cloud User Guide. When you transfer an Elastic IP +// address, there is a two-step handshake between the source and transfer Amazon +// Web Services accounts. When the source account starts the transfer, the transfer +// account has seven days to accept the Elastic IP address transfer. During those +// seven days, the source account can view the pending transfer by using this +// action. After seven days, the transfer expires and ownership of the Elastic IP +// address returns to the source account. Accepted transfers are visible to the +// source account for three days after the transfers have been accepted. func (c *Client) DescribeAddressTransfers(ctx context.Context, params *DescribeAddressTransfersInput, optFns ...func(*Options)) (*DescribeAddressTransfersOutput, error) { if params == nil { params = &DescribeAddressTransfersInput{} diff --git a/service/ec2/api_op_DescribeAddresses.go b/service/ec2/api_op_DescribeAddresses.go index 103efa463e0..9e04faf53ef 100644 --- a/service/ec2/api_op_DescribeAddresses.go +++ b/service/ec2/api_op_DescribeAddresses.go @@ -12,12 +12,7 @@ import ( ) // Describes the specified Elastic IP addresses or all of your Elastic IP -// addresses. An Elastic IP address is for use in either the EC2-Classic platform -// or in a VPC. For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. We are retiring EC2-Classic. We -// recommend that you migrate from EC2-Classic to a VPC. For more information, see -// Migrate from EC2-Classic to a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html) -// in the Amazon Elastic Compute Cloud User Guide. +// addresses. func (c *Client) DescribeAddresses(ctx context.Context, params *DescribeAddressesInput, optFns ...func(*Options)) (*DescribeAddressesOutput, error) { if params == nil { params = &DescribeAddressesInput{} @@ -35,7 +30,7 @@ func (c *Client) DescribeAddresses(ctx context.Context, params *DescribeAddresse type DescribeAddressesInput struct { - // [EC2-VPC] Information about the allocation IDs. + // Information about the allocation IDs. AllocationIds []string // Checks whether you have the required permissions for the action, without @@ -45,19 +40,17 @@ type DescribeAddressesInput struct { DryRun *bool // One or more filters. Filter names and values are case-sensitive. - // - allocation-id - [EC2-VPC] The allocation ID for the address. - // - association-id - [EC2-VPC] The association ID for the address. - // - domain - Indicates whether the address is for use in EC2-Classic ( standard - // ) or in a VPC ( vpc ). + // - allocation-id - The allocation ID for the address. + // - association-id - The association ID for the address. // - instance-id - The ID of the instance the address is associated with, if any. // - network-border-group - A unique set of Availability Zones, Local Zones, or // Wavelength Zones from where Amazon Web Services advertises IP addresses. - // - network-interface-id - [EC2-VPC] The ID of the network interface that the - // address is associated with, if any. + // - network-interface-id - The ID of the network interface that the address is + // associated with, if any. // - network-interface-owner-id - The Amazon Web Services account ID of the // owner. - // - private-ip-address - [EC2-VPC] The private IP address associated with the - // Elastic IP address. + // - private-ip-address - The private IP address associated with the Elastic IP + // address. // - public-ip - The Elastic IP address, or the carrier IP address. // - tag : - The key/value combination of a tag assigned to the resource. Use the // tag key in the filter name and the tag value as the filter value. For example, diff --git a/service/ec2/api_op_DescribeInstanceConnectEndpoints.go b/service/ec2/api_op_DescribeInstanceConnectEndpoints.go new file mode 100644 index 00000000000..a147dbe49b4 --- /dev/null +++ b/service/ec2/api_op_DescribeInstanceConnectEndpoints.go @@ -0,0 +1,257 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified EC2 Instance Connect Endpoints or all EC2 Instance +// Connect Endpoints. +func (c *Client) DescribeInstanceConnectEndpoints(ctx context.Context, params *DescribeInstanceConnectEndpointsInput, optFns ...func(*Options)) (*DescribeInstanceConnectEndpointsOutput, error) { + if params == nil { + params = &DescribeInstanceConnectEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceConnectEndpoints", params, optFns, c.addOperationDescribeInstanceConnectEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeInstanceConnectEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeInstanceConnectEndpointsInput struct { + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + // One or more filters. + // - instance-connect-endpoint-id - The ID of the EC2 Instance Connect Endpoint. + // - state - The state of the EC2 Instance Connect Endpoint ( create-in-progress + // | create-complete | create-failed | delete-in-progress | delete-complete | + // delete-failed ). + // - subnet-id - The ID of the subnet in which the EC2 Instance Connect Endpoint + // was created. + // - tag : - The key/value combination of a tag assigned to the resource. Use the + // tag key in the filter name and the tag value as the filter value. For example, + // to find all resources that have a tag with the key Owner and the value TeamA , + // specify tag:Owner for the filter name and TeamA for the filter value. + // - tag-key - The key of a tag assigned to the resource. Use this filter to find + // all resources assigned a tag with a specific key, regardless of the tag value. + // - tag-value - The value of a tag assigned to the resource. Use this filter to + // find all resources that have a tag with a specific value, regardless of tag key. + // + // - vpc-id - The ID of the VPC in which the EC2 Instance Connect Endpoint was + // created. + Filters []types.Filter + + // One or more EC2 Instance Connect Endpoint IDs. + InstanceConnectEndpointIds []string + + // The maximum number of items to return for this request. To get the next page of + // items, make another request with the token returned in the output. For more + // information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination) + // . + MaxResults *int32 + + // The token returned from a previous paginated request. Pagination continues from + // the end of the items returned by the previous request. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeInstanceConnectEndpointsOutput struct { + + // Information about the EC2 Instance Connect Endpoints. + InstanceConnectEndpoints []types.Ec2InstanceConnectEndpoint + + // The token to include in another request to get the next page of items. This + // value is null when there are no more items to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeInstanceConnectEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceConnectEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceConnectEndpoints{}, 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_opDescribeInstanceConnectEndpoints(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 +} + +// DescribeInstanceConnectEndpointsAPIClient is a client that implements the +// DescribeInstanceConnectEndpoints operation. +type DescribeInstanceConnectEndpointsAPIClient interface { + DescribeInstanceConnectEndpoints(context.Context, *DescribeInstanceConnectEndpointsInput, ...func(*Options)) (*DescribeInstanceConnectEndpointsOutput, error) +} + +var _ DescribeInstanceConnectEndpointsAPIClient = (*Client)(nil) + +// DescribeInstanceConnectEndpointsPaginatorOptions is the paginator options for +// DescribeInstanceConnectEndpoints +type DescribeInstanceConnectEndpointsPaginatorOptions struct { + // The maximum number of items to return for this request. To get the next page of + // items, make another request with the token returned in the output. For more + // information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination) + // . + 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 +} + +// DescribeInstanceConnectEndpointsPaginator is a paginator for +// DescribeInstanceConnectEndpoints +type DescribeInstanceConnectEndpointsPaginator struct { + options DescribeInstanceConnectEndpointsPaginatorOptions + client DescribeInstanceConnectEndpointsAPIClient + params *DescribeInstanceConnectEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeInstanceConnectEndpointsPaginator returns a new +// DescribeInstanceConnectEndpointsPaginator +func NewDescribeInstanceConnectEndpointsPaginator(client DescribeInstanceConnectEndpointsAPIClient, params *DescribeInstanceConnectEndpointsInput, optFns ...func(*DescribeInstanceConnectEndpointsPaginatorOptions)) *DescribeInstanceConnectEndpointsPaginator { + if params == nil { + params = &DescribeInstanceConnectEndpointsInput{} + } + + options := DescribeInstanceConnectEndpointsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeInstanceConnectEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceConnectEndpointsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeInstanceConnectEndpoints page. +func (p *DescribeInstanceConnectEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceConnectEndpointsOutput, 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.DescribeInstanceConnectEndpoints(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_opDescribeInstanceConnectEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "DescribeInstanceConnectEndpoints", + } +} diff --git a/service/ec2/api_op_DescribeMovingAddresses.go b/service/ec2/api_op_DescribeMovingAddresses.go index de22eb96d3d..efed5ef0856 100644 --- a/service/ec2/api_op_DescribeMovingAddresses.go +++ b/service/ec2/api_op_DescribeMovingAddresses.go @@ -12,10 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes your Elastic IP addresses that are being moved to the EC2-VPC -// platform, or that are being restored to the EC2-Classic platform. This request -// does not return information about any other Elastic IP addresses in your -// account. +// This action is deprecated. Describes your Elastic IP addresses that are being +// moved from or being restored to the EC2-Classic platform. This request does not +// return information about any other Elastic IP addresses in your account. func (c *Client) DescribeMovingAddresses(ctx context.Context, params *DescribeMovingAddressesInput, optFns ...func(*Options)) (*DescribeMovingAddressesOutput, error) { if params == nil { params = &DescribeMovingAddressesInput{} diff --git a/service/ec2/api_op_DisassociateAddress.go b/service/ec2/api_op_DisassociateAddress.go index f8e1e91f91f..c3df5173291 100644 --- a/service/ec2/api_op_DisassociateAddress.go +++ b/service/ec2/api_op_DisassociateAddress.go @@ -11,13 +11,8 @@ import ( ) // Disassociates an Elastic IP address from the instance or network interface it's -// associated with. An Elastic IP address is for use in either the EC2-Classic -// platform or in a VPC. For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. We are retiring EC2-Classic. We -// recommend that you migrate from EC2-Classic to a VPC. For more information, see -// Migrate from EC2-Classic to a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html) -// in the Amazon Elastic Compute Cloud User Guide. This is an idempotent operation. -// If you perform the operation more than once, Amazon EC2 doesn't return an error. +// associated with. This is an idempotent operation. If you perform the operation +// more than once, Amazon EC2 doesn't return an error. func (c *Client) DisassociateAddress(ctx context.Context, params *DisassociateAddressInput, optFns ...func(*Options)) (*DisassociateAddressOutput, error) { if params == nil { params = &DisassociateAddressInput{} @@ -35,7 +30,7 @@ func (c *Client) DisassociateAddress(ctx context.Context, params *DisassociateAd type DisassociateAddressInput struct { - // [EC2-VPC] The association ID. Required for EC2-VPC. + // The association ID. This parameter is required. AssociationId *string // Checks whether you have the required permissions for the action, without @@ -44,7 +39,7 @@ type DisassociateAddressInput struct { // UnauthorizedOperation . DryRun *bool - // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. + // Deprecated. PublicIp *string noSmithyDocumentSerde diff --git a/service/ec2/api_op_GetIpamPoolAllocations.go b/service/ec2/api_op_GetIpamPoolAllocations.go index ce57fb9cf0b..b518e9293a7 100644 --- a/service/ec2/api_op_GetIpamPoolAllocations.go +++ b/service/ec2/api_op_GetIpamPoolAllocations.go @@ -12,8 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Get a list of all the CIDR allocations in an IPAM pool. If you use this action -// after AllocateIpamPoolCidr (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AllocateIpamPoolCidr.html) +// Get a list of all the CIDR allocations in an IPAM pool. The Region you use +// should be the IPAM pool locale. The locale is the Amazon Web Services Region +// where this IPAM pool is available for allocations. If you use this action after +// AllocateIpamPoolCidr (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AllocateIpamPoolCidr.html) // or ReleaseIpamPoolAllocation (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ReleaseIpamPoolAllocation.html) // , note that all EC2 API actions follow an eventual consistency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/query-api-troubleshooting.html#eventual-consistency) // model. diff --git a/service/ec2/api_op_MoveAddressToVpc.go b/service/ec2/api_op_MoveAddressToVpc.go index 99282d23618..4e984ef0929 100644 --- a/service/ec2/api_op_MoveAddressToVpc.go +++ b/service/ec2/api_op_MoveAddressToVpc.go @@ -11,16 +11,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC -// platform. The Elastic IP address must be allocated to your account for more than -// 24 hours, and it must not be associated with an instance. After the Elastic IP -// address is moved, it is no longer available for use in the EC2-Classic platform, -// unless you move it back using the RestoreAddressToClassic request. You cannot -// move an Elastic IP address that was originally allocated for use in the EC2-VPC -// platform to the EC2-Classic platform. We are retiring EC2-Classic. We recommend -// that you migrate from EC2-Classic to a VPC. For more information, see Migrate -// from EC2-Classic to a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html) -// in the Amazon Elastic Compute Cloud User Guide. +// This action is deprecated. Moves an Elastic IP address from the EC2-Classic +// platform to the EC2-VPC platform. The Elastic IP address must be allocated to +// your account for more than 24 hours, and it must not be associated with an +// instance. After the Elastic IP address is moved, it is no longer available for +// use in the EC2-Classic platform, unless you move it back using the +// RestoreAddressToClassic request. You cannot move an Elastic IP address that was +// originally allocated for use in the EC2-VPC platform to the EC2-Classic +// platform. func (c *Client) MoveAddressToVpc(ctx context.Context, params *MoveAddressToVpcInput, optFns ...func(*Options)) (*MoveAddressToVpcOutput, error) { if params == nil { params = &MoveAddressToVpcInput{} diff --git a/service/ec2/api_op_ReleaseAddress.go b/service/ec2/api_op_ReleaseAddress.go index 359875505c4..eebd18de587 100644 --- a/service/ec2/api_op_ReleaseAddress.go +++ b/service/ec2/api_op_ReleaseAddress.go @@ -10,24 +10,18 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Releases the specified Elastic IP address. [EC2-Classic, default VPC] Releasing -// an Elastic IP address automatically disassociates it from any instance that it's -// associated with. To disassociate an Elastic IP address without releasing it, use -// DisassociateAddress . We are retiring EC2-Classic. We recommend that you migrate -// from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic -// to a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html) -// in the Amazon Elastic Compute Cloud User Guide. [Nondefault VPC] You must use -// DisassociateAddress to disassociate the Elastic IP address before you can -// release it. Otherwise, Amazon EC2 returns an error ( InvalidIPAddress.InUse ). -// After releasing an Elastic IP address, it is released to the IP address pool. Be -// sure to update your DNS records and any servers or devices that communicate with -// the address. If you attempt to release an Elastic IP address that you already -// released, you'll get an AuthFailure error if the address is already allocated -// to another Amazon Web Services account. [EC2-VPC] After you release an Elastic -// IP address for use in a VPC, you might be able to recover it. For more -// information, see AllocateAddress . For more information, see Elastic IP -// Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Releases the specified Elastic IP address. [Default VPC] Releasing an Elastic +// IP address automatically disassociates it from any instance that it's associated +// with. To disassociate an Elastic IP address without releasing it, use +// DisassociateAddress . [Nondefault VPC] You must use DisassociateAddress to +// disassociate the Elastic IP address before you can release it. Otherwise, Amazon +// EC2 returns an error ( InvalidIPAddress.InUse ). After releasing an Elastic IP +// address, it is released to the IP address pool. Be sure to update your DNS +// records and any servers or devices that communicate with the address. If you +// attempt to release an Elastic IP address that you already released, you'll get +// an AuthFailure error if the address is already allocated to another Amazon Web +// Services account. After you release an Elastic IP address, you might be able to +// recover it. For more information, see AllocateAddress . func (c *Client) ReleaseAddress(ctx context.Context, params *ReleaseAddressInput, optFns ...func(*Options)) (*ReleaseAddressOutput, error) { if params == nil { params = &ReleaseAddressInput{} @@ -45,7 +39,7 @@ func (c *Client) ReleaseAddress(ctx context.Context, params *ReleaseAddressInput type ReleaseAddressInput struct { - // [EC2-VPC] The allocation ID. Required for EC2-VPC. + // The allocation ID. This parameter is required. AllocationId *string // Checks whether you have the required permissions for the action, without @@ -61,7 +55,7 @@ type ReleaseAddressInput struct { // classic, you receive an InvalidParameterCombination error. NetworkBorderGroup *string - // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. + // Deprecated. PublicIp *string noSmithyDocumentSerde diff --git a/service/ec2/api_op_ReleaseIpamPoolAllocation.go b/service/ec2/api_op_ReleaseIpamPoolAllocation.go index 6b9b89e6b30..c9e39e0eab5 100644 --- a/service/ec2/api_op_ReleaseIpamPoolAllocation.go +++ b/service/ec2/api_op_ReleaseIpamPoolAllocation.go @@ -10,10 +10,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Release an allocation within an IPAM pool. You can only use this action to -// release manual allocations. To remove an allocation for a resource without -// deleting the resource, set its monitored state to false using -// ModifyIpamResourceCidr (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyIpamResourceCidr.html) +// Release an allocation within an IPAM pool. The Region you use should be the +// IPAM pool locale. The locale is the Amazon Web Services Region where this IPAM +// pool is available for allocations. You can only use this action to release +// manual allocations. To remove an allocation for a resource without deleting the +// resource, set its monitored state to false using ModifyIpamResourceCidr (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyIpamResourceCidr.html) // . For more information, see Release an allocation (https://docs.aws.amazon.com/vpc/latest/ipam/release-pool-alloc-ipam.html) // in the Amazon VPC IPAM User Guide. All EC2 API actions follow an eventual // consistency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/query-api-troubleshooting.html#eventual-consistency) diff --git a/service/ec2/api_op_RestoreAddressToClassic.go b/service/ec2/api_op_RestoreAddressToClassic.go index 5fc2799fedd..721917f4f49 100644 --- a/service/ec2/api_op_RestoreAddressToClassic.go +++ b/service/ec2/api_op_RestoreAddressToClassic.go @@ -11,13 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Restores an Elastic IP address that was previously moved to the EC2-VPC -// platform back to the EC2-Classic platform. You cannot move an Elastic IP address -// that was originally allocated for use in EC2-VPC. The Elastic IP address must -// not be associated with an instance or network interface. We are retiring -// EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more -// information, see Migrate from EC2-Classic to a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html) -// in the Amazon Elastic Compute Cloud User Guide. +// This action is deprecated. Restores an Elastic IP address that was previously +// moved to the EC2-VPC platform back to the EC2-Classic platform. You cannot move +// an Elastic IP address that was originally allocated for use in EC2-VPC. The +// Elastic IP address must not be associated with an instance or network interface. func (c *Client) RestoreAddressToClassic(ctx context.Context, params *RestoreAddressToClassicInput, optFns ...func(*Options)) (*RestoreAddressToClassicOutput, error) { if params == nil { params = &RestoreAddressToClassicInput{} diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 391bf7bcd79..d7ec8bd1004 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -6302,6 +6302,97 @@ func awsEc2query_deserializeOpErrorCreateImage(response *smithyhttp.Response, me } } +type awsEc2query_deserializeOpCreateInstanceConnectEndpoint struct { +} + +func (*awsEc2query_deserializeOpCreateInstanceConnectEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpCreateInstanceConnectEndpoint) HandleDeserialize(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, awsEc2query_deserializeOpErrorCreateInstanceConnectEndpoint(response, &metadata) + } + output := &CreateInstanceConnectEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentCreateInstanceConnectEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorCreateInstanceConnectEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpCreateInstanceEventWindow struct { } @@ -13103,6 +13194,97 @@ func awsEc2query_deserializeOpErrorDeleteFpgaImage(response *smithyhttp.Response } } +type awsEc2query_deserializeOpDeleteInstanceConnectEndpoint struct { +} + +func (*awsEc2query_deserializeOpDeleteInstanceConnectEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDeleteInstanceConnectEndpoint) HandleDeserialize(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, awsEc2query_deserializeOpErrorDeleteInstanceConnectEndpoint(response, &metadata) + } + output := &DeleteInstanceConnectEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDeleteInstanceConnectEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorDeleteInstanceConnectEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpDeleteInstanceEventWindow struct { } @@ -23040,14 +23222,14 @@ func awsEc2query_deserializeOpErrorDescribeInstanceAttribute(response *smithyhtt } } -type awsEc2query_deserializeOpDescribeInstanceCreditSpecifications struct { +type awsEc2query_deserializeOpDescribeInstanceConnectEndpoints struct { } -func (*awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) ID() string { +func (*awsEc2query_deserializeOpDescribeInstanceConnectEndpoints) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeInstanceConnectEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23061,9 +23243,9 @@ func (m *awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) HandleDe } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceCreditSpecifications(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceConnectEndpoints(response, &metadata) } - output := &DescribeInstanceCreditSpecificationsOutput{} + output := &DescribeInstanceConnectEndpointsOutput{} out.Result = output var buff [1024]byte @@ -23084,7 +23266,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) HandleDe } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceCreditSpecificationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeInstanceConnectEndpointsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23098,7 +23280,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) HandleDe return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeInstanceCreditSpecifications(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeInstanceConnectEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23131,14 +23313,14 @@ func awsEc2query_deserializeOpErrorDescribeInstanceCreditSpecifications(response } } -type awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes struct { +type awsEc2query_deserializeOpDescribeInstanceCreditSpecifications struct { } -func (*awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) ID() string { +func (*awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23152,9 +23334,9 @@ func (m *awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) H } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceEventNotificationAttributes(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceCreditSpecifications(response, &metadata) } - output := &DescribeInstanceEventNotificationAttributesOutput{} + output := &DescribeInstanceCreditSpecificationsOutput{} out.Result = output var buff [1024]byte @@ -23175,7 +23357,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) H } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceEventNotificationAttributesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeInstanceCreditSpecificationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23189,7 +23371,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) H return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeInstanceEventNotificationAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeInstanceCreditSpecifications(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23222,14 +23404,14 @@ func awsEc2query_deserializeOpErrorDescribeInstanceEventNotificationAttributes(r } } -type awsEc2query_deserializeOpDescribeInstanceEventWindows struct { +type awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes struct { } -func (*awsEc2query_deserializeOpDescribeInstanceEventWindows) ID() string { +func (*awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeInstanceEventWindows) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23243,9 +23425,9 @@ func (m *awsEc2query_deserializeOpDescribeInstanceEventWindows) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceEventWindows(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceEventNotificationAttributes(response, &metadata) } - output := &DescribeInstanceEventWindowsOutput{} + output := &DescribeInstanceEventNotificationAttributesOutput{} out.Result = output var buff [1024]byte @@ -23266,7 +23448,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceEventWindows) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceEventWindowsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeInstanceEventNotificationAttributesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23280,7 +23462,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceEventWindows) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeInstanceEventWindows(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeInstanceEventNotificationAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23313,14 +23495,14 @@ func awsEc2query_deserializeOpErrorDescribeInstanceEventWindows(response *smithy } } -type awsEc2query_deserializeOpDescribeInstances struct { +type awsEc2query_deserializeOpDescribeInstanceEventWindows struct { } -func (*awsEc2query_deserializeOpDescribeInstances) ID() string { +func (*awsEc2query_deserializeOpDescribeInstanceEventWindows) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeInstanceEventWindows) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23334,9 +23516,9 @@ func (m *awsEc2query_deserializeOpDescribeInstances) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceEventWindows(response, &metadata) } - output := &DescribeInstancesOutput{} + output := &DescribeInstanceEventWindowsOutput{} out.Result = output var buff [1024]byte @@ -23357,7 +23539,7 @@ func (m *awsEc2query_deserializeOpDescribeInstances) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeInstanceEventWindowsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23371,7 +23553,7 @@ func (m *awsEc2query_deserializeOpDescribeInstances) HandleDeserialize(ctx conte return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeInstanceEventWindows(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23404,14 +23586,14 @@ func awsEc2query_deserializeOpErrorDescribeInstances(response *smithyhttp.Respon } } -type awsEc2query_deserializeOpDescribeInstanceStatus struct { +type awsEc2query_deserializeOpDescribeInstances struct { } -func (*awsEc2query_deserializeOpDescribeInstanceStatus) ID() string { +func (*awsEc2query_deserializeOpDescribeInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeInstanceStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23425,9 +23607,9 @@ func (m *awsEc2query_deserializeOpDescribeInstanceStatus) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceStatus(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeInstances(response, &metadata) } - output := &DescribeInstanceStatusOutput{} + output := &DescribeInstancesOutput{} out.Result = output var buff [1024]byte @@ -23448,7 +23630,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceStatus) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceStatusOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23462,7 +23644,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceStatus) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeInstanceStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23495,14 +23677,14 @@ func awsEc2query_deserializeOpErrorDescribeInstanceStatus(response *smithyhttp.R } } -type awsEc2query_deserializeOpDescribeInstanceTypeOfferings struct { +type awsEc2query_deserializeOpDescribeInstanceStatus struct { } -func (*awsEc2query_deserializeOpDescribeInstanceTypeOfferings) ID() string { +func (*awsEc2query_deserializeOpDescribeInstanceStatus) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeInstanceTypeOfferings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeInstanceStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23516,9 +23698,9 @@ func (m *awsEc2query_deserializeOpDescribeInstanceTypeOfferings) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceTypeOfferings(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceStatus(response, &metadata) } - output := &DescribeInstanceTypeOfferingsOutput{} + output := &DescribeInstanceStatusOutput{} out.Result = output var buff [1024]byte @@ -23539,7 +23721,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceTypeOfferings) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceTypeOfferingsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeInstanceStatusOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23553,7 +23735,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceTypeOfferings) HandleDeseriali return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeInstanceTypeOfferings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeInstanceStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23586,14 +23768,14 @@ func awsEc2query_deserializeOpErrorDescribeInstanceTypeOfferings(response *smith } } -type awsEc2query_deserializeOpDescribeInstanceTypes struct { +type awsEc2query_deserializeOpDescribeInstanceTypeOfferings struct { } -func (*awsEc2query_deserializeOpDescribeInstanceTypes) ID() string { +func (*awsEc2query_deserializeOpDescribeInstanceTypeOfferings) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeInstanceTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeInstanceTypeOfferings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23607,9 +23789,9 @@ func (m *awsEc2query_deserializeOpDescribeInstanceTypes) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceTypes(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceTypeOfferings(response, &metadata) } - output := &DescribeInstanceTypesOutput{} + output := &DescribeInstanceTypeOfferingsOutput{} out.Result = output var buff [1024]byte @@ -23630,7 +23812,7 @@ func (m *awsEc2query_deserializeOpDescribeInstanceTypes) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceTypesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeInstanceTypeOfferingsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23644,7 +23826,98 @@ func (m *awsEc2query_deserializeOpDescribeInstanceTypes) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeInstanceTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeInstanceTypeOfferings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsEc2query_deserializeOpDescribeInstanceTypes struct { +} + +func (*awsEc2query_deserializeOpDescribeInstanceTypes) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDescribeInstanceTypes) HandleDeserialize(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, awsEc2query_deserializeOpErrorDescribeInstanceTypes(response, &metadata) + } + output := &DescribeInstanceTypesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDescribeInstanceTypesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorDescribeInstanceTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -67640,6 +67913,223 @@ func awsEc2query_deserializeDocumentEbsOptimizedInfo(v **types.EbsOptimizedInfo, return nil } +func awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(v **types.Ec2InstanceConnectEndpoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Ec2InstanceConnectEndpoint + if *v == nil { + sv = &types.Ec2InstanceConnectEndpoint{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("availabilityZone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZone = ptr.String(xtv) + } + + case strings.EqualFold("createdAt", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("dnsName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DnsName = ptr.String(xtv) + } + + case strings.EqualFold("fipsDnsName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FipsDnsName = ptr.String(xtv) + } + + case strings.EqualFold("instanceConnectEndpointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceConnectEndpointArn = ptr.String(xtv) + } + + case strings.EqualFold("instanceConnectEndpointId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceConnectEndpointId = ptr.String(xtv) + } + + case strings.EqualFold("networkInterfaceIdSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentNetworkInterfaceIdSet(&sv.NetworkInterfaceIds, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ownerId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OwnerId = ptr.String(xtv) + } + + case strings.EqualFold("preserveClientIp", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.PreserveClientIp = ptr.Bool(xtv) + } + + case strings.EqualFold("securityGroupIdSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentSecurityGroupIdSet(&sv.SecurityGroupIds, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.Ec2InstanceConnectEndpointState(xtv) + } + + case strings.EqualFold("stateMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StateMessage = ptr.String(xtv) + } + + case strings.EqualFold("subnetId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubnetId = ptr.String(xtv) + } + + case strings.EqualFold("tagSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("vpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentEfaInfo(v **types.EfaInfo, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -78599,6 +79089,74 @@ func awsEc2query_deserializeDocumentInstanceCapacity(v **types.InstanceCapacity, return nil } +func awsEc2query_deserializeDocumentInstanceConnectEndpointSet(v *[]types.Ec2InstanceConnectEndpoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Ec2InstanceConnectEndpoint + if *v == nil { + sv = make([]types.Ec2InstanceConnectEndpoint, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.Ec2InstanceConnectEndpoint + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentInstanceConnectEndpointSetUnwrapped(v *[]types.Ec2InstanceConnectEndpoint, decoder smithyxml.NodeDecoder) error { + var sv []types.Ec2InstanceConnectEndpoint + if *v == nil { + sv = make([]types.Ec2InstanceConnectEndpoint, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Ec2InstanceConnectEndpoint + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentInstanceCount(v **types.InstanceCount, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -97953,6 +98511,86 @@ func awsEc2query_deserializeDocumentNetworkInterfaceCount(v **types.NetworkInter return nil } +func awsEc2query_deserializeDocumentNetworkInterfaceIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("item", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentNetworkInterfaceIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentNetworkInterfaceIpv6Address(v **types.NetworkInterfaceIpv6Address, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -109206,6 +109844,86 @@ func awsEc2query_deserializeDocumentSecurityGroupIdListUnwrapped(v *[]string, de *v = sv return nil } +func awsEc2query_deserializeDocumentSecurityGroupIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("item", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentSecurityGroupIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentSecurityGroupIdStringList(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -135841,6 +136559,61 @@ func awsEc2query_deserializeOpDocumentCreateImageOutput(v **CreateImageOutput, d return nil } +func awsEc2query_deserializeOpDocumentCreateInstanceConnectEndpointOutput(v **CreateInstanceConnectEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateInstanceConnectEndpointOutput + if *v == nil { + sv = &CreateInstanceConnectEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("clientToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ClientToken = ptr.String(xtv) + } + + case strings.EqualFold("instanceConnectEndpoint", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(&sv.InstanceConnectEndpoint, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentCreateInstanceEventWindowOutput(v **CreateInstanceEventWindowOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -139516,6 +140289,48 @@ func awsEc2query_deserializeOpDocumentDeleteFpgaImageOutput(v **DeleteFpgaImageO return nil } +func awsEc2query_deserializeOpDocumentDeleteInstanceConnectEndpointOutput(v **DeleteInstanceConnectEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteInstanceConnectEndpointOutput + if *v == nil { + sv = &DeleteInstanceConnectEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("instanceConnectEndpoint", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(&sv.InstanceConnectEndpoint, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentDeleteInstanceEventWindowOutput(v **DeleteInstanceEventWindowOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -144315,6 +145130,61 @@ func awsEc2query_deserializeOpDocumentDescribeInstanceAttributeOutput(v **Descri return nil } +func awsEc2query_deserializeOpDocumentDescribeInstanceConnectEndpointsOutput(v **DescribeInstanceConnectEndpointsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeInstanceConnectEndpointsOutput + if *v == nil { + sv = &DescribeInstanceConnectEndpointsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("instanceConnectEndpointSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentInstanceConnectEndpointSet(&sv.InstanceConnectEndpoints, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("nextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentDescribeInstanceCreditSpecificationsOutput(v **DescribeInstanceCreditSpecificationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/generated.json b/service/ec2/generated.json index e314a57bef5..7bf268afca1 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -81,6 +81,7 @@ "api_op_CreateFlowLogs.go", "api_op_CreateFpgaImage.go", "api_op_CreateImage.go", + "api_op_CreateInstanceConnectEndpoint.go", "api_op_CreateInstanceEventWindow.go", "api_op_CreateInstanceExportTask.go", "api_op_CreateInternetGateway.go", @@ -157,6 +158,7 @@ "api_op_DeleteFleets.go", "api_op_DeleteFlowLogs.go", "api_op_DeleteFpgaImage.go", + "api_op_DeleteInstanceConnectEndpoint.go", "api_op_DeleteInstanceEventWindow.go", "api_op_DeleteInternetGateway.go", "api_op_DeleteIpam.go", @@ -271,6 +273,7 @@ "api_op_DescribeImportImageTasks.go", "api_op_DescribeImportSnapshotTasks.go", "api_op_DescribeInstanceAttribute.go", + "api_op_DescribeInstanceConnectEndpoints.go", "api_op_DescribeInstanceCreditSpecifications.go", "api_op_DescribeInstanceEventNotificationAttributes.go", "api_op_DescribeInstanceEventWindows.go", diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index a77e53113d3..dfe151153e7 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -4497,6 +4497,70 @@ func (m *awsEc2query_serializeOpCreateImage) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpCreateInstanceConnectEndpoint struct { +} + +func (*awsEc2query_serializeOpCreateInstanceConnectEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpCreateInstanceConnectEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateInstanceConnectEndpointInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateInstanceConnectEndpoint") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentCreateInstanceConnectEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsEc2query_serializeOpCreateInstanceEventWindow struct { } @@ -9361,6 +9425,70 @@ func (m *awsEc2query_serializeOpDeleteFpgaImage) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDeleteInstanceConnectEndpoint struct { +} + +func (*awsEc2query_serializeOpDeleteInstanceConnectEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDeleteInstanceConnectEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteInstanceConnectEndpointInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteInstanceConnectEndpoint") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDeleteInstanceConnectEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsEc2query_serializeOpDeleteInstanceEventWindow struct { } @@ -16657,6 +16785,70 @@ func (m *awsEc2query_serializeOpDescribeInstanceAttribute) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDescribeInstanceConnectEndpoints struct { +} + +func (*awsEc2query_serializeOpDescribeInstanceConnectEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDescribeInstanceConnectEndpoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeInstanceConnectEndpointsInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeInstanceConnectEndpoints") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDescribeInstanceConnectEndpointsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsEc2query_serializeOpDescribeInstanceCreditSpecifications struct { } @@ -44774,6 +44966,16 @@ func awsEc2query_serializeDocumentSecurityGroupIdStringList(v []string, value qu return nil } +func awsEc2query_serializeDocumentSecurityGroupIdStringListRequest(v []string, value query.Value) error { + array := value.Array("SecurityGroupId") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsEc2query_serializeDocumentSecurityGroupRuleDescription(v *types.SecurityGroupRuleDescription, value query.Value) error { object := value.Object() _ = object @@ -49056,6 +49258,47 @@ func awsEc2query_serializeOpDocumentCreateImageInput(v *CreateImageInput, value return nil } +func awsEc2query_serializeOpDocumentCreateInstanceConnectEndpointInput(v *CreateInstanceConnectEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ClientToken != nil { + objectKey := object.Key("ClientToken") + objectKey.String(*v.ClientToken) + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.PreserveClientIp != nil { + objectKey := object.Key("PreserveClientIp") + objectKey.Boolean(*v.PreserveClientIp) + } + + if v.SecurityGroupIds != nil { + objectKey := object.FlatKey("SecurityGroupId") + if err := awsEc2query_serializeDocumentSecurityGroupIdStringListRequest(v.SecurityGroupIds, objectKey); err != nil { + return err + } + } + + if v.SubnetId != nil { + objectKey := object.Key("SubnetId") + objectKey.String(*v.SubnetId) + } + + if v.TagSpecifications != nil { + objectKey := object.FlatKey("TagSpecification") + if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { + return err + } + } + + return nil +} + func awsEc2query_serializeOpDocumentCreateInstanceEventWindowInput(v *CreateInstanceEventWindowInput, value query.Value) error { object := value.Object() _ = object @@ -52034,6 +52277,23 @@ func awsEc2query_serializeOpDocumentDeleteFpgaImageInput(v *DeleteFpgaImageInput return nil } +func awsEc2query_serializeOpDocumentDeleteInstanceConnectEndpointInput(v *DeleteInstanceConnectEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.InstanceConnectEndpointId != nil { + objectKey := object.Key("InstanceConnectEndpointId") + objectKey.String(*v.InstanceConnectEndpointId) + } + + return nil +} + func awsEc2query_serializeOpDocumentDeleteInstanceEventWindowInput(v *DeleteInstanceEventWindowInput, value query.Value) error { object := value.Object() _ = object @@ -54778,6 +55038,42 @@ func awsEc2query_serializeOpDocumentDescribeInstanceAttributeInput(v *DescribeIn return nil } +func awsEc2query_serializeOpDocumentDescribeInstanceConnectEndpointsInput(v *DescribeInstanceConnectEndpointsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.Filters != nil { + objectKey := object.FlatKey("Filter") + if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.InstanceConnectEndpointIds != nil { + objectKey := object.FlatKey("InstanceConnectEndpointId") + if err := awsEc2query_serializeDocumentValueStringList(v.InstanceConnectEndpointIds, objectKey); err != nil { + return err + } + } + + if v.MaxResults != nil { + objectKey := object.Key("MaxResults") + objectKey.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + func awsEc2query_serializeOpDocumentDescribeInstanceCreditSpecificationsInput(v *DescribeInstanceCreditSpecificationsInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index b3fc8471eed..5d93068e058 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -1583,6 +1583,33 @@ func (EbsOptimizedSupport) Values() []EbsOptimizedSupport { } } +type Ec2InstanceConnectEndpointState string + +// Enum values for Ec2InstanceConnectEndpointState +const ( + Ec2InstanceConnectEndpointStateCreateInProgress Ec2InstanceConnectEndpointState = "create-in-progress" + Ec2InstanceConnectEndpointStateCreateComplete Ec2InstanceConnectEndpointState = "create-complete" + Ec2InstanceConnectEndpointStateCreateFailed Ec2InstanceConnectEndpointState = "create-failed" + Ec2InstanceConnectEndpointStateDeleteInProgress Ec2InstanceConnectEndpointState = "delete-in-progress" + Ec2InstanceConnectEndpointStateDeleteComplete Ec2InstanceConnectEndpointState = "delete-complete" + Ec2InstanceConnectEndpointStateDeleteFailed Ec2InstanceConnectEndpointState = "delete-failed" +) + +// Values returns all known values for Ec2InstanceConnectEndpointState. 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 (Ec2InstanceConnectEndpointState) Values() []Ec2InstanceConnectEndpointState { + return []Ec2InstanceConnectEndpointState{ + "create-in-progress", + "create-complete", + "create-failed", + "delete-in-progress", + "delete-complete", + "delete-failed", + } +} + type ElasticGpuState string // Enum values for ElasticGpuState @@ -5955,6 +5982,7 @@ const ( ResourceTypeVpcBlockPublicAccessExclusion ResourceType = "vpc-block-public-access-exclusion" ResourceTypeIpamResourceDiscovery ResourceType = "ipam-resource-discovery" ResourceTypeIpamResourceDiscoveryAssociation ResourceType = "ipam-resource-discovery-association" + ResourceTypeInstanceConnectEndpoint ResourceType = "instance-connect-endpoint" ) // Values returns all known values for ResourceType. Note that this can be @@ -6047,6 +6075,7 @@ func (ResourceType) Values() []ResourceType { "vpc-block-public-access-exclusion", "ipam-resource-discovery", "ipam-resource-discovery-association", + "instance-connect-endpoint", } } diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 827ce7b4d63..fa7e461bb09 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -236,10 +236,10 @@ type AddPrefixListEntry struct { // Describes an Elastic IP address, or a carrier IP address. type Address struct { - // The ID representing the allocation of the address for use with EC2-VPC. + // The ID representing the allocation of the address. AllocationId *string - // The ID representing the association of the address with an instance in a VPC. + // The ID representing the association of the address with an instance. AssociationId *string // The carrier IP address associated. This option is only available for network @@ -253,8 +253,7 @@ type Address struct { // The ID of the customer-owned address pool. CustomerOwnedIpv4Pool *string - // Indicates whether this Elastic IP address is for use with instances in - // EC2-Classic ( standard ) or instances in a VPC ( vpc ). + // The network ( vpc ). Domain DomainType // The ID of the instance that the address is associated with (if any). @@ -3066,6 +3065,67 @@ type EbsOptimizedInfo struct { noSmithyDocumentSerde } +// The EC2 Instance Connect Endpoint. +type Ec2InstanceConnectEndpoint struct { + + // The Availability Zone of the EC2 Instance Connect Endpoint. + AvailabilityZone *string + + // The date and time that the EC2 Instance Connect Endpoint was created. + CreatedAt *time.Time + + // The DNS name of the EC2 Instance Connect Endpoint. + DnsName *string + + // + FipsDnsName *string + + // The Amazon Resource Name (ARN) of the EC2 Instance Connect Endpoint. + InstanceConnectEndpointArn *string + + // The ID of the EC2 Instance Connect Endpoint. + InstanceConnectEndpointId *string + + // The ID of the elastic network interface that Amazon EC2 automatically created + // when creating the EC2 Instance Connect Endpoint. + NetworkInterfaceIds []string + + // The ID of the Amazon Web Services account that created the EC2 Instance Connect + // Endpoint. + OwnerId *string + + // Indicates whether your client's IP address is preserved as the source. The + // value is true or false . + // - If true , your client's IP address is used when you connect to a resource. + // - If false , the elastic network interface IP address is used when you connect + // to a resource. + // Default: true + PreserveClientIp *bool + + // The security groups associated with the endpoint. If you didn't specify a + // security group, the default security group for your VPC is associated with the + // endpoint. + SecurityGroupIds []string + + // The current state of the EC2 Instance Connect Endpoint. + State Ec2InstanceConnectEndpointState + + // The message for the current state of the EC2 Instance Connect Endpoint. Can + // include a failure message. + StateMessage *string + + // The ID of the subnet in which the EC2 Instance Connect Endpoint was created. + SubnetId *string + + // The tags assigned to the EC2 Instance Connect Endpoint. + Tags []Tag + + // The ID of the VPC in which the EC2 Instance Connect Endpoint was created. + VpcId *string + + noSmithyDocumentSerde +} + // Describes the Elastic Fabric Adapters for the instance type. type EfaInfo struct { @@ -9542,14 +9602,10 @@ type Monitoring struct { noSmithyDocumentSerde } -// Describes the status of a moving Elastic IP address. We are retiring -// EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more -// information, see Migrate from EC2-Classic to a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html) -// in the Amazon Elastic Compute Cloud User Guide. +// This action is deprecated. Describes the status of a moving Elastic IP address. type MovingAddressStatus struct { - // The status of the Elastic IP address that's being moved to the EC2-VPC - // platform, or restored to the EC2-Classic platform. + // The status of the Elastic IP address that's being moved or restored. MoveStatus MoveStatus // The Elastic IP address. diff --git a/service/ec2/validators.go b/service/ec2/validators.go index 23bf2f94786..ed973b97a4f 100644 --- a/service/ec2/validators.go +++ b/service/ec2/validators.go @@ -1290,6 +1290,26 @@ func (m *validateOpCreateImage) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpCreateInstanceConnectEndpoint struct { +} + +func (*validateOpCreateInstanceConnectEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateInstanceConnectEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateInstanceConnectEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateInstanceConnectEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateInstanceExportTask struct { } @@ -2570,6 +2590,26 @@ func (m *validateOpDeleteFpgaImage) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpDeleteInstanceConnectEndpoint struct { +} + +func (*validateOpDeleteInstanceConnectEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteInstanceConnectEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteInstanceConnectEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteInstanceConnectEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteInstanceEventWindow struct { } @@ -8626,6 +8666,10 @@ func addOpCreateImageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateImage{}, middleware.After) } +func addOpCreateInstanceConnectEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateInstanceConnectEndpoint{}, middleware.After) +} + func addOpCreateInstanceExportTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateInstanceExportTask{}, middleware.After) } @@ -8882,6 +8926,10 @@ func addOpDeleteFpgaImageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteFpgaImage{}, middleware.After) } +func addOpDeleteInstanceConnectEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteInstanceConnectEndpoint{}, middleware.After) +} + func addOpDeleteInstanceEventWindowValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteInstanceEventWindow{}, middleware.After) } @@ -12024,6 +12072,21 @@ func validateOpCreateImageInput(v *CreateImageInput) error { } } +func validateOpCreateInstanceConnectEndpointInput(v *CreateInstanceConnectEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateInstanceConnectEndpointInput"} + if v.SubnetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateInstanceExportTaskInput(v *CreateInstanceExportTaskInput) error { if v == nil { return nil @@ -13173,6 +13236,21 @@ func validateOpDeleteFpgaImageInput(v *DeleteFpgaImageInput) error { } } +func validateOpDeleteInstanceConnectEndpointInput(v *DeleteInstanceConnectEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteInstanceConnectEndpointInput"} + if v.InstanceConnectEndpointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceConnectEndpointId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteInstanceEventWindowInput(v *DeleteInstanceEventWindowInput) error { if v == nil { return nil diff --git a/service/imagebuilder/types/types.go b/service/imagebuilder/types/types.go index c9ab76ff4bd..20a51be4d7c 100644 --- a/service/imagebuilder/types/types.go +++ b/service/imagebuilder/types/types.go @@ -910,7 +910,7 @@ type ImagePipeline struct { // This is no longer supported, and does not return a value. DateLastRun *string - // This is no longer supported, and does not return a value. + // The next date when the pipeline is scheduled to run. DateNextRun *string // The date on which this image pipeline was last updated. diff --git a/service/lightsail/api_op_GetCertificates.go b/service/lightsail/api_op_GetCertificates.go index aa81fe3727d..0699e915ccc 100644 --- a/service/lightsail/api_op_GetCertificates.go +++ b/service/lightsail/api_op_GetCertificates.go @@ -12,7 +12,7 @@ import ( ) // Returns information about one or more Amazon Lightsail SSL/TLS certificates. To -// get a summary of a certificate, ommit includeCertificateDetails from your +// get a summary of a certificate, omit includeCertificateDetails from your // request. The response will include only the certificate Amazon Resource Name // (ARN), certificate name, domain name, and tags. func (c *Client) GetCertificates(ctx context.Context, params *GetCertificatesInput, optFns ...func(*Options)) (*GetCertificatesOutput, error) { @@ -48,6 +48,12 @@ type GetCertificatesInput struct { // Resource Names (ARNs), domain names, and tags. IncludeCertificateDetails bool + // The token to advance to the next page of results from your request. To get a + // page token, perform an initial GetCertificates request. If your results are + // paginated, the response will return a next page token that you can specify as + // the page token in a subsequent request. + PageToken *string + noSmithyDocumentSerde } @@ -56,6 +62,12 @@ type GetCertificatesOutput struct { // An object that describes certificates. Certificates []types.CertificateSummary + // If NextPageToken is returned there are more results available. The value of + // NextPageToken is a unique pagination token for each page. Make the call again + // using the returned token to retrieve the next page. Keep all other arguments + // unchanged. + NextPageToken *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/lightsail/api_op_GetCostEstimate.go b/service/lightsail/api_op_GetCostEstimate.go index 70c14b787dc..26bf4afe0cd 100644 --- a/service/lightsail/api_op_GetCostEstimate.go +++ b/service/lightsail/api_op_GetCostEstimate.go @@ -33,7 +33,7 @@ type GetCostEstimateInput struct { // The cost estimate end time. Constraints: // - Specified in Coordinated Universal Time (UTC). - // - Specified in the Unix time format. For example, if you wish to use an end + // - Specified in the Unix time format. For example, if you want to use an end // time of October 1, 2018, at 9 PM UTC, specify 1538427600 as the end time. // You can convert a human-friendly time to Unix time format using a converter // like Epoch converter (https://www.epochconverter.com/) . @@ -48,7 +48,7 @@ type GetCostEstimateInput struct { // The cost estimate start time. Constraints: // - Specified in Coordinated Universal Time (UTC). - // - Specified in the Unix time format. For example, if you wish to use a start + // - Specified in the Unix time format. For example, if you want to use a start // time of October 1, 2018, at 8 PM UTC, specify 1538424000 as the start time. // You can convert a human-friendly time to Unix time format using a converter // like Epoch converter (https://www.epochconverter.com/) . diff --git a/service/lightsail/deserializers.go b/service/lightsail/deserializers.go index 13bea7556af..a0dea368ae7 100644 --- a/service/lightsail/deserializers.go +++ b/service/lightsail/deserializers.go @@ -35944,6 +35944,15 @@ func awsAwsjson11_deserializeOpDocumentGetCertificatesOutput(v **GetCertificates return err } + case "nextPageToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string to be of type string, got %T instead", value) + } + sv.NextPageToken = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/lightsail/serializers.go b/service/lightsail/serializers.go index ff2067c3fbb..621ac63c2e4 100644 --- a/service/lightsail/serializers.go +++ b/service/lightsail/serializers.go @@ -11278,6 +11278,11 @@ func awsAwsjson11_serializeOpDocumentGetCertificatesInput(v *GetCertificatesInpu ok.Boolean(v.IncludeCertificateDetails) } + if v.PageToken != nil { + ok := object.Key("pageToken") + ok.String(*v.PageToken) + } + return nil } diff --git a/service/lightsail/types/types.go b/service/lightsail/types/types.go index 09423f66691..3507abf00cb 100644 --- a/service/lightsail/types/types.go +++ b/service/lightsail/types/types.go @@ -766,7 +766,7 @@ type CacheSettings struct { } // Describes the full details of an Amazon Lightsail SSL/TLS certificate. To get a -// summary of a certificate, use the GetCertificates action and ommit +// summary of a certificate, use the GetCertificates action and omit // includeCertificateDetails from your request. The response will include only the // certificate Amazon Resource Name (ARN), certificate name, domain name, and tags. type Certificate struct { diff --git a/service/s3/types/enums.go b/service/s3/types/enums.go index e28e6b7cbfb..9e07250375a 100644 --- a/service/s3/types/enums.go +++ b/service/s3/types/enums.go @@ -1070,8 +1070,9 @@ type ServerSideEncryption string // Enum values for ServerSideEncryption const ( - ServerSideEncryptionAes256 ServerSideEncryption = "AES256" - ServerSideEncryptionAwsKms ServerSideEncryption = "aws:kms" + ServerSideEncryptionAes256 ServerSideEncryption = "AES256" + ServerSideEncryptionAwsKms ServerSideEncryption = "aws:kms" + ServerSideEncryptionAwsKmsDsse ServerSideEncryption = "aws:kms:dsse" ) // Values returns all known values for ServerSideEncryption. Note that this can be @@ -1081,6 +1082,7 @@ func (ServerSideEncryption) Values() []ServerSideEncryption { return []ServerSideEncryption{ "AES256", "aws:kms", + "aws:kms:dsse", } } diff --git a/service/securityhub/api_op_BatchDeleteAutomationRules.go b/service/securityhub/api_op_BatchDeleteAutomationRules.go new file mode 100644 index 00000000000..01f614199b3 --- /dev/null +++ b/service/securityhub/api_op_BatchDeleteAutomationRules.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +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/securityhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes one or more automation rules. +func (c *Client) BatchDeleteAutomationRules(ctx context.Context, params *BatchDeleteAutomationRulesInput, optFns ...func(*Options)) (*BatchDeleteAutomationRulesOutput, error) { + if params == nil { + params = &BatchDeleteAutomationRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchDeleteAutomationRules", params, optFns, c.addOperationBatchDeleteAutomationRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchDeleteAutomationRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchDeleteAutomationRulesInput struct { + + // A list of Amazon Resource Names (ARNs) for the rules that are to be deleted. + // + // This member is required. + AutomationRulesArns []string + + noSmithyDocumentSerde +} + +type BatchDeleteAutomationRulesOutput struct { + + // A list of properly processed rule ARNs. + ProcessedAutomationRules []string + + // A list of objects containing RuleArn , ErrorCode , and ErrorMessage . This + // parameter tells you which automation rules the request didn't delete and why. + UnprocessedAutomationRules []types.UnprocessedAutomationRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchDeleteAutomationRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchDeleteAutomationRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchDeleteAutomationRules{}, 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 = addOpBatchDeleteAutomationRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteAutomationRules(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_opBatchDeleteAutomationRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "securityhub", + OperationName: "BatchDeleteAutomationRules", + } +} diff --git a/service/securityhub/api_op_BatchGetAutomationRules.go b/service/securityhub/api_op_BatchGetAutomationRules.go new file mode 100644 index 00000000000..8efda6b0076 --- /dev/null +++ b/service/securityhub/api_op_BatchGetAutomationRules.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +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/securityhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of details for automation rules based on rule Amazon Resource +// Names (ARNs). +func (c *Client) BatchGetAutomationRules(ctx context.Context, params *BatchGetAutomationRulesInput, optFns ...func(*Options)) (*BatchGetAutomationRulesOutput, error) { + if params == nil { + params = &BatchGetAutomationRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetAutomationRules", params, optFns, c.addOperationBatchGetAutomationRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetAutomationRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetAutomationRulesInput struct { + + // A list of rule ARNs to get details for. + // + // This member is required. + AutomationRulesArns []string + + noSmithyDocumentSerde +} + +type BatchGetAutomationRulesOutput struct { + + // A list of rule details for the provided rule ARNs. + Rules []types.AutomationRulesConfig + + // A list of objects containing RuleArn , ErrorCode , and ErrorMessage . This + // parameter tells you which automation rules the request didn't retrieve and why. + UnprocessedAutomationRules []types.UnprocessedAutomationRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetAutomationRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetAutomationRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetAutomationRules{}, 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 = addOpBatchGetAutomationRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetAutomationRules(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_opBatchGetAutomationRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "securityhub", + OperationName: "BatchGetAutomationRules", + } +} diff --git a/service/securityhub/api_op_BatchUpdateAutomationRules.go b/service/securityhub/api_op_BatchUpdateAutomationRules.go new file mode 100644 index 00000000000..d2083572b5c --- /dev/null +++ b/service/securityhub/api_op_BatchUpdateAutomationRules.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +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/securityhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates one or more automation rules based on rule Amazon Resource Names (ARNs) +// and input parameters. +func (c *Client) BatchUpdateAutomationRules(ctx context.Context, params *BatchUpdateAutomationRulesInput, optFns ...func(*Options)) (*BatchUpdateAutomationRulesOutput, error) { + if params == nil { + params = &BatchUpdateAutomationRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchUpdateAutomationRules", params, optFns, c.addOperationBatchUpdateAutomationRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchUpdateAutomationRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchUpdateAutomationRulesInput struct { + + // An array of ARNs for the rules that are to be updated. Optionally, you can also + // include RuleStatus and RuleOrder . + // + // This member is required. + UpdateAutomationRulesRequestItems []types.UpdateAutomationRulesRequestItem + + noSmithyDocumentSerde +} + +type BatchUpdateAutomationRulesOutput struct { + + // A list of properly processed rule ARNs. + ProcessedAutomationRules []string + + // A list of objects containing RuleArn , ErrorCode , and ErrorMessage . This + // parameter tells you which automation rules the request didn't update and why. + UnprocessedAutomationRules []types.UnprocessedAutomationRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchUpdateAutomationRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchUpdateAutomationRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchUpdateAutomationRules{}, 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 = addOpBatchUpdateAutomationRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchUpdateAutomationRules(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_opBatchUpdateAutomationRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "securityhub", + OperationName: "BatchUpdateAutomationRules", + } +} diff --git a/service/securityhub/api_op_CreateAutomationRule.go b/service/securityhub/api_op_CreateAutomationRule.go new file mode 100644 index 00000000000..da10afa1477 --- /dev/null +++ b/service/securityhub/api_op_CreateAutomationRule.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +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/securityhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an automation rule based on input parameters. +func (c *Client) CreateAutomationRule(ctx context.Context, params *CreateAutomationRuleInput, optFns ...func(*Options)) (*CreateAutomationRuleOutput, error) { + if params == nil { + params = &CreateAutomationRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAutomationRule", params, optFns, c.addOperationCreateAutomationRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAutomationRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAutomationRuleInput struct { + + // One or more actions to update finding fields if a finding matches the + // conditions specified in Criteria . + // + // This member is required. + Actions []types.AutomationRulesAction + + // A set of ASFF finding field attributes and corresponding expected values that + // Security Hub uses to filter findings. If a finding matches the conditions + // specified in this parameter, Security Hub applies the rule action to the + // finding. + // + // This member is required. + Criteria *types.AutomationRulesFindingFilters + + // A description of the rule. + // + // This member is required. + Description *string + + // The name of the rule. + // + // This member is required. + RuleName *string + + // An integer ranging from 1 to 1000 that represents the order in which the rule + // action is applied to findings. Security Hub applies rules with lower values for + // this parameter first. + // + // This member is required. + RuleOrder int32 + + // Specifies whether a rule is the last to be applied with respect to a finding + // that matches the rule criteria. This is useful when a finding matches the + // criteria for multiple rules, and each rule has different actions. If the value + // of this field is set to true for a rule, Security Hub applies the rule action + // to a finding that matches the rule criteria and won't evaluate other rules for + // the finding. The default value of this field is false . + IsTerminal bool + + // Whether the rule is active after it is created. If this parameter is equal to + // Enabled , Security Hub will apply the rule to findings and finding updates after + // the rule is created. To change the value of this parameter after creating a + // rule, use BatchUpdateAutomationRules . + RuleStatus types.RuleStatus + + // User-defined tags that help you label the purpose of a rule. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateAutomationRuleOutput struct { + + // The Amazon Resource Name (ARN) of the automation rule that you created. + RuleArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAutomationRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAutomationRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAutomationRule{}, 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 = addOpCreateAutomationRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAutomationRule(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_opCreateAutomationRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "securityhub", + OperationName: "CreateAutomationRule", + } +} diff --git a/service/securityhub/api_op_ListAutomationRules.go b/service/securityhub/api_op_ListAutomationRules.go new file mode 100644 index 00000000000..809a492e674 --- /dev/null +++ b/service/securityhub/api_op_ListAutomationRules.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +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/securityhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// A list of automation rules and their metadata for the calling account. +func (c *Client) ListAutomationRules(ctx context.Context, params *ListAutomationRulesInput, optFns ...func(*Options)) (*ListAutomationRulesOutput, error) { + if params == nil { + params = &ListAutomationRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAutomationRules", params, optFns, c.addOperationListAutomationRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAutomationRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAutomationRulesInput struct { + + // The maximum number of rules to return in the response. This currently ranges + // from 1 to 100. + MaxResults int32 + + // A token to specify where to start paginating the response. This is the NextToken + // from a previously truncated response. On your first call to the + // ListAutomationRules API, set the value of this parameter to NULL . + NextToken *string + + noSmithyDocumentSerde +} + +type ListAutomationRulesOutput struct { + + // Metadata for rules in the calling account. The response includes rules with a + // RuleStatus of ENABLED and DISABLED . + AutomationRulesMetadata []types.AutomationRulesMetadata + + // A pagination token for the response. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAutomationRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAutomationRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAutomationRules{}, 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_opListAutomationRules(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_opListAutomationRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "securityhub", + OperationName: "ListAutomationRules", + } +} diff --git a/service/securityhub/deserializers.go b/service/securityhub/deserializers.go index d565adae40e..5cbc557bb20 100644 --- a/service/securityhub/deserializers.go +++ b/service/securityhub/deserializers.go @@ -210,14 +210,14 @@ func awsRestjson1_deserializeOpErrorAcceptInvitation(response *smithyhttp.Respon } } -type awsRestjson1_deserializeOpBatchDisableStandards struct { +type awsRestjson1_deserializeOpBatchDeleteAutomationRules struct { } -func (*awsRestjson1_deserializeOpBatchDisableStandards) ID() string { +func (*awsRestjson1_deserializeOpBatchDeleteAutomationRules) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpBatchDisableStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchDeleteAutomationRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -231,9 +231,9 @@ func (m *awsRestjson1_deserializeOpBatchDisableStandards) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorBatchDisableStandards(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchDeleteAutomationRules(response, &metadata) } - output := &BatchDisableStandardsOutput{} + output := &BatchDeleteAutomationRulesOutput{} out.Result = output var buff [1024]byte @@ -254,7 +254,7 @@ func (m *awsRestjson1_deserializeOpBatchDisableStandards) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchDeleteAutomationRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -267,7 +267,7 @@ func (m *awsRestjson1_deserializeOpBatchDisableStandards) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorBatchDisableStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchDeleteAutomationRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -320,6 +320,9 @@ func awsRestjson1_deserializeOpErrorBatchDisableStandards(response *smithyhttp.R case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -330,7 +333,7 @@ func awsRestjson1_deserializeOpErrorBatchDisableStandards(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(v **BatchDisableStandardsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchDeleteAutomationRulesOutput(v **BatchDeleteAutomationRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -343,17 +346,22 @@ func awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(v **BatchDisa return fmt.Errorf("unexpected JSON type %v", value) } - var sv *BatchDisableStandardsOutput + var sv *BatchDeleteAutomationRulesOutput if *v == nil { - sv = &BatchDisableStandardsOutput{} + sv = &BatchDeleteAutomationRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "StandardsSubscriptions": - if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { + case "ProcessedAutomationRules": + if err := awsRestjson1_deserializeDocumentAutomationRulesArnsList(&sv.ProcessedAutomationRules, value); err != nil { + return err + } + + case "UnprocessedAutomationRules": + if err := awsRestjson1_deserializeDocumentUnprocessedAutomationRulesList(&sv.UnprocessedAutomationRules, value); err != nil { return err } @@ -366,14 +374,14 @@ func awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(v **BatchDisa return nil } -type awsRestjson1_deserializeOpBatchEnableStandards struct { +type awsRestjson1_deserializeOpBatchDisableStandards struct { } -func (*awsRestjson1_deserializeOpBatchEnableStandards) ID() string { +func (*awsRestjson1_deserializeOpBatchDisableStandards) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpBatchEnableStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchDisableStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -387,9 +395,9 @@ func (m *awsRestjson1_deserializeOpBatchEnableStandards) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorBatchEnableStandards(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchDisableStandards(response, &metadata) } - output := &BatchEnableStandardsOutput{} + output := &BatchDisableStandardsOutput{} out.Result = output var buff [1024]byte @@ -410,7 +418,7 @@ func (m *awsRestjson1_deserializeOpBatchEnableStandards) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -423,7 +431,7 @@ func (m *awsRestjson1_deserializeOpBatchEnableStandards) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorBatchEnableStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchDisableStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -486,7 +494,7 @@ func awsRestjson1_deserializeOpErrorBatchEnableStandards(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(v **BatchEnableStandardsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(v **BatchDisableStandardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -499,9 +507,9 @@ func awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(v **BatchEnabl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *BatchEnableStandardsOutput + var sv *BatchDisableStandardsOutput if *v == nil { - sv = &BatchEnableStandardsOutput{} + sv = &BatchDisableStandardsOutput{} } else { sv = *v } @@ -522,14 +530,14 @@ func awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(v **BatchEnabl return nil } -type awsRestjson1_deserializeOpBatchGetSecurityControls struct { +type awsRestjson1_deserializeOpBatchEnableStandards struct { } -func (*awsRestjson1_deserializeOpBatchGetSecurityControls) ID() string { +func (*awsRestjson1_deserializeOpBatchEnableStandards) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpBatchGetSecurityControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchEnableStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -543,9 +551,9 @@ func (m *awsRestjson1_deserializeOpBatchGetSecurityControls) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorBatchGetSecurityControls(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchEnableStandards(response, &metadata) } - output := &BatchGetSecurityControlsOutput{} + output := &BatchEnableStandardsOutput{} out.Result = output var buff [1024]byte @@ -566,7 +574,7 @@ func (m *awsRestjson1_deserializeOpBatchGetSecurityControls) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentBatchGetSecurityControlsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -579,7 +587,7 @@ func (m *awsRestjson1_deserializeOpBatchGetSecurityControls) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorBatchGetSecurityControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchEnableStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -642,7 +650,7 @@ func awsRestjson1_deserializeOpErrorBatchGetSecurityControls(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentBatchGetSecurityControlsOutput(v **BatchGetSecurityControlsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(v **BatchEnableStandardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -655,22 +663,17 @@ func awsRestjson1_deserializeOpDocumentBatchGetSecurityControlsOutput(v **BatchG return fmt.Errorf("unexpected JSON type %v", value) } - var sv *BatchGetSecurityControlsOutput + var sv *BatchEnableStandardsOutput if *v == nil { - sv = &BatchGetSecurityControlsOutput{} + sv = &BatchEnableStandardsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "SecurityControls": - if err := awsRestjson1_deserializeDocumentSecurityControls(&sv.SecurityControls, value); err != nil { - return err - } - - case "UnprocessedIds": - if err := awsRestjson1_deserializeDocumentUnprocessedSecurityControls(&sv.UnprocessedIds, value); err != nil { + case "StandardsSubscriptions": + if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { return err } @@ -683,14 +686,14 @@ func awsRestjson1_deserializeOpDocumentBatchGetSecurityControlsOutput(v **BatchG return nil } -type awsRestjson1_deserializeOpBatchGetStandardsControlAssociations struct { +type awsRestjson1_deserializeOpBatchGetAutomationRules struct { } -func (*awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) ID() string { +func (*awsRestjson1_deserializeOpBatchGetAutomationRules) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchGetAutomationRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -704,9 +707,9 @@ func (m *awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorBatchGetStandardsControlAssociations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchGetAutomationRules(response, &metadata) } - output := &BatchGetStandardsControlAssociationsOutput{} + output := &BatchGetAutomationRulesOutput{} out.Result = output var buff [1024]byte @@ -727,7 +730,7 @@ func (m *awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) HandleD return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentBatchGetStandardsControlAssociationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchGetAutomationRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -740,7 +743,7 @@ func (m *awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) HandleD return out, metadata, err } -func awsRestjson1_deserializeOpErrorBatchGetStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchGetAutomationRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -781,6 +784,9 @@ func awsRestjson1_deserializeOpErrorBatchGetStandardsControlAssociations(respons } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -793,6 +799,9 @@ func awsRestjson1_deserializeOpErrorBatchGetStandardsControlAssociations(respons case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -803,7 +812,7 @@ func awsRestjson1_deserializeOpErrorBatchGetStandardsControlAssociations(respons } } -func awsRestjson1_deserializeOpDocumentBatchGetStandardsControlAssociationsOutput(v **BatchGetStandardsControlAssociationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchGetAutomationRulesOutput(v **BatchGetAutomationRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -816,22 +825,22 @@ func awsRestjson1_deserializeOpDocumentBatchGetStandardsControlAssociationsOutpu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *BatchGetStandardsControlAssociationsOutput + var sv *BatchGetAutomationRulesOutput if *v == nil { - sv = &BatchGetStandardsControlAssociationsOutput{} + sv = &BatchGetAutomationRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "StandardsControlAssociationDetails": - if err := awsRestjson1_deserializeDocumentStandardsControlAssociationDetails(&sv.StandardsControlAssociationDetails, value); err != nil { + case "Rules": + if err := awsRestjson1_deserializeDocumentAutomationRulesConfigList(&sv.Rules, value); err != nil { return err } - case "UnprocessedAssociations": - if err := awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociations(&sv.UnprocessedAssociations, value); err != nil { + case "UnprocessedAutomationRules": + if err := awsRestjson1_deserializeDocumentUnprocessedAutomationRulesList(&sv.UnprocessedAutomationRules, value); err != nil { return err } @@ -844,14 +853,14 @@ func awsRestjson1_deserializeOpDocumentBatchGetStandardsControlAssociationsOutpu return nil } -type awsRestjson1_deserializeOpBatchImportFindings struct { +type awsRestjson1_deserializeOpBatchGetSecurityControls struct { } -func (*awsRestjson1_deserializeOpBatchImportFindings) ID() string { +func (*awsRestjson1_deserializeOpBatchGetSecurityControls) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpBatchImportFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchGetSecurityControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -865,9 +874,9 @@ func (m *awsRestjson1_deserializeOpBatchImportFindings) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorBatchImportFindings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchGetSecurityControls(response, &metadata) } - output := &BatchImportFindingsOutput{} + output := &BatchGetSecurityControlsOutput{} out.Result = output var buff [1024]byte @@ -888,7 +897,7 @@ func (m *awsRestjson1_deserializeOpBatchImportFindings) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchGetSecurityControlsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -901,7 +910,7 @@ func (m *awsRestjson1_deserializeOpBatchImportFindings) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorBatchImportFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchGetSecurityControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -964,7 +973,7 @@ func awsRestjson1_deserializeOpErrorBatchImportFindings(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(v **BatchImportFindingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchGetSecurityControlsOutput(v **BatchGetSecurityControlsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -977,44 +986,23 @@ func awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(v **BatchImport return fmt.Errorf("unexpected JSON type %v", value) } - var sv *BatchImportFindingsOutput + var sv *BatchGetSecurityControlsOutput if *v == nil { - sv = &BatchImportFindingsOutput{} + sv = &BatchGetSecurityControlsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "FailedCount": - 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.FailedCount = int32(i64) - } - - case "FailedFindings": - if err := awsRestjson1_deserializeDocumentImportFindingsErrorList(&sv.FailedFindings, value); err != nil { + case "SecurityControls": + if err := awsRestjson1_deserializeDocumentSecurityControls(&sv.SecurityControls, value); err != nil { return err } - case "SuccessCount": - 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.SuccessCount = int32(i64) + case "UnprocessedIds": + if err := awsRestjson1_deserializeDocumentUnprocessedSecurityControls(&sv.UnprocessedIds, value); err != nil { + return err } default: @@ -1026,14 +1014,14 @@ func awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(v **BatchImport return nil } -type awsRestjson1_deserializeOpBatchUpdateFindings struct { +type awsRestjson1_deserializeOpBatchGetStandardsControlAssociations struct { } -func (*awsRestjson1_deserializeOpBatchUpdateFindings) ID() string { +func (*awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpBatchUpdateFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1047,9 +1035,9 @@ func (m *awsRestjson1_deserializeOpBatchUpdateFindings) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorBatchUpdateFindings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchGetStandardsControlAssociations(response, &metadata) } - output := &BatchUpdateFindingsOutput{} + output := &BatchGetStandardsControlAssociationsOutput{} out.Result = output var buff [1024]byte @@ -1070,7 +1058,7 @@ func (m *awsRestjson1_deserializeOpBatchUpdateFindings) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchGetStandardsControlAssociationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1083,7 +1071,7 @@ func (m *awsRestjson1_deserializeOpBatchUpdateFindings) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorBatchUpdateFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchGetStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1146,7 +1134,7 @@ func awsRestjson1_deserializeOpErrorBatchUpdateFindings(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(v **BatchUpdateFindingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchGetStandardsControlAssociationsOutput(v **BatchGetStandardsControlAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1159,22 +1147,22 @@ func awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(v **BatchUpdate return fmt.Errorf("unexpected JSON type %v", value) } - var sv *BatchUpdateFindingsOutput + var sv *BatchGetStandardsControlAssociationsOutput if *v == nil { - sv = &BatchUpdateFindingsOutput{} + sv = &BatchGetStandardsControlAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ProcessedFindings": - if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifierList(&sv.ProcessedFindings, value); err != nil { + case "StandardsControlAssociationDetails": + if err := awsRestjson1_deserializeDocumentStandardsControlAssociationDetails(&sv.StandardsControlAssociationDetails, value); err != nil { return err } - case "UnprocessedFindings": - if err := awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFindingsList(&sv.UnprocessedFindings, value); err != nil { + case "UnprocessedAssociations": + if err := awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociations(&sv.UnprocessedAssociations, value); err != nil { return err } @@ -1187,14 +1175,14 @@ func awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(v **BatchUpdate return nil } -type awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations struct { +type awsRestjson1_deserializeOpBatchImportFindings struct { } -func (*awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) ID() string { +func (*awsRestjson1_deserializeOpBatchImportFindings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchImportFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1208,9 +1196,9 @@ func (m *awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) Hand } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorBatchUpdateStandardsControlAssociations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchImportFindings(response, &metadata) } - output := &BatchUpdateStandardsControlAssociationsOutput{} + output := &BatchImportFindingsOutput{} out.Result = output var buff [1024]byte @@ -1231,7 +1219,7 @@ func (m *awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) Hand return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentBatchUpdateStandardsControlAssociationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1244,7 +1232,7 @@ func (m *awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) Hand return out, metadata, err } -func awsRestjson1_deserializeOpErrorBatchUpdateStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchImportFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1307,7 +1295,7 @@ func awsRestjson1_deserializeOpErrorBatchUpdateStandardsControlAssociations(resp } } -func awsRestjson1_deserializeOpDocumentBatchUpdateStandardsControlAssociationsOutput(v **BatchUpdateStandardsControlAssociationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(v **BatchImportFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1320,20 +1308,46 @@ func awsRestjson1_deserializeOpDocumentBatchUpdateStandardsControlAssociationsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *BatchUpdateStandardsControlAssociationsOutput + var sv *BatchImportFindingsOutput if *v == nil { - sv = &BatchUpdateStandardsControlAssociationsOutput{} + sv = &BatchImportFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "UnprocessedAssociationUpdates": - if err := awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociationUpdates(&sv.UnprocessedAssociationUpdates, value); err != nil { + case "FailedCount": + 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.FailedCount = int32(i64) + } + + case "FailedFindings": + if err := awsRestjson1_deserializeDocumentImportFindingsErrorList(&sv.FailedFindings, value); err != nil { return err } + case "SuccessCount": + 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.SuccessCount = int32(i64) + } + default: _, _ = key, value @@ -1343,14 +1357,14 @@ func awsRestjson1_deserializeOpDocumentBatchUpdateStandardsControlAssociationsOu return nil } -type awsRestjson1_deserializeOpCreateActionTarget struct { +type awsRestjson1_deserializeOpBatchUpdateAutomationRules struct { } -func (*awsRestjson1_deserializeOpCreateActionTarget) ID() string { +func (*awsRestjson1_deserializeOpBatchUpdateAutomationRules) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchUpdateAutomationRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1364,9 +1378,9 @@ func (m *awsRestjson1_deserializeOpCreateActionTarget) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateActionTarget(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchUpdateAutomationRules(response, &metadata) } - output := &CreateActionTargetOutput{} + output := &BatchUpdateAutomationRulesOutput{} out.Result = output var buff [1024]byte @@ -1387,7 +1401,7 @@ func (m *awsRestjson1_deserializeOpCreateActionTarget) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchUpdateAutomationRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1400,7 +1414,7 @@ func (m *awsRestjson1_deserializeOpCreateActionTarget) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchUpdateAutomationRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1453,8 +1467,8 @@ func awsRestjson1_deserializeOpErrorCreateActionTarget(response *smithyhttp.Resp case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1466,7 +1480,7 @@ func awsRestjson1_deserializeOpErrorCreateActionTarget(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(v **CreateActionTargetOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchUpdateAutomationRulesOutput(v **BatchUpdateAutomationRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1479,22 +1493,23 @@ func awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(v **CreateAction return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateActionTargetOutput + var sv *BatchUpdateAutomationRulesOutput if *v == nil { - sv = &CreateActionTargetOutput{} + sv = &BatchUpdateAutomationRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ActionTargetArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ActionTargetArn = ptr.String(jtv) + case "ProcessedAutomationRules": + if err := awsRestjson1_deserializeDocumentAutomationRulesArnsList(&sv.ProcessedAutomationRules, value); err != nil { + return err + } + + case "UnprocessedAutomationRules": + if err := awsRestjson1_deserializeDocumentUnprocessedAutomationRulesList(&sv.UnprocessedAutomationRules, value); err != nil { + return err } default: @@ -1506,14 +1521,14 @@ func awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(v **CreateAction return nil } -type awsRestjson1_deserializeOpCreateFindingAggregator struct { +type awsRestjson1_deserializeOpBatchUpdateFindings struct { } -func (*awsRestjson1_deserializeOpCreateFindingAggregator) ID() string { +func (*awsRestjson1_deserializeOpBatchUpdateFindings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateFindingAggregator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchUpdateFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1527,9 +1542,9 @@ func (m *awsRestjson1_deserializeOpCreateFindingAggregator) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateFindingAggregator(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchUpdateFindings(response, &metadata) } - output := &CreateFindingAggregatorOutput{} + output := &BatchUpdateFindingsOutput{} out.Result = output var buff [1024]byte @@ -1550,7 +1565,7 @@ func (m *awsRestjson1_deserializeOpCreateFindingAggregator) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateFindingAggregatorOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1563,7 +1578,7 @@ func (m *awsRestjson1_deserializeOpCreateFindingAggregator) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateFindingAggregator(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchUpdateFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1604,9 +1619,6 @@ func awsRestjson1_deserializeOpErrorCreateFindingAggregator(response *smithyhttp } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -1629,7 +1641,7 @@ func awsRestjson1_deserializeOpErrorCreateFindingAggregator(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentCreateFindingAggregatorOutput(v **CreateFindingAggregatorOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(v **BatchUpdateFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1642,44 +1654,22 @@ func awsRestjson1_deserializeOpDocumentCreateFindingAggregatorOutput(v **CreateF return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateFindingAggregatorOutput + var sv *BatchUpdateFindingsOutput if *v == nil { - sv = &CreateFindingAggregatorOutput{} + sv = &BatchUpdateFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "FindingAggregationRegion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.FindingAggregationRegion = ptr.String(jtv) - } - - case "FindingAggregatorArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.FindingAggregatorArn = ptr.String(jtv) - } - - case "RegionLinkingMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.RegionLinkingMode = ptr.String(jtv) + case "ProcessedFindings": + if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifierList(&sv.ProcessedFindings, value); err != nil { + return err } - case "Regions": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { + case "UnprocessedFindings": + if err := awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFindingsList(&sv.UnprocessedFindings, value); err != nil { return err } @@ -1692,14 +1682,14 @@ func awsRestjson1_deserializeOpDocumentCreateFindingAggregatorOutput(v **CreateF return nil } -type awsRestjson1_deserializeOpCreateInsight struct { +type awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations struct { } -func (*awsRestjson1_deserializeOpCreateInsight) ID() string { +func (*awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1713,9 +1703,9 @@ func (m *awsRestjson1_deserializeOpCreateInsight) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateInsight(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchUpdateStandardsControlAssociations(response, &metadata) } - output := &CreateInsightOutput{} + output := &BatchUpdateStandardsControlAssociationsOutput{} out.Result = output var buff [1024]byte @@ -1736,7 +1726,7 @@ func (m *awsRestjson1_deserializeOpCreateInsight) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateInsightOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchUpdateStandardsControlAssociationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1749,7 +1739,7 @@ func (m *awsRestjson1_deserializeOpCreateInsight) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchUpdateStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1802,9 +1792,6 @@ func awsRestjson1_deserializeOpErrorCreateInsight(response *smithyhttp.Response, case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1815,7 +1802,7 @@ func awsRestjson1_deserializeOpErrorCreateInsight(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateInsightOutput(v **CreateInsightOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchUpdateStandardsControlAssociationsOutput(v **BatchUpdateStandardsControlAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1828,22 +1815,18 @@ func awsRestjson1_deserializeOpDocumentCreateInsightOutput(v **CreateInsightOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateInsightOutput + var sv *BatchUpdateStandardsControlAssociationsOutput if *v == nil { - sv = &CreateInsightOutput{} + sv = &BatchUpdateStandardsControlAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "InsightArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.InsightArn = ptr.String(jtv) + case "UnprocessedAssociationUpdates": + if err := awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociationUpdates(&sv.UnprocessedAssociationUpdates, value); err != nil { + return err } default: @@ -1855,14 +1838,14 @@ func awsRestjson1_deserializeOpDocumentCreateInsightOutput(v **CreateInsightOutp return nil } -type awsRestjson1_deserializeOpCreateMembers struct { +type awsRestjson1_deserializeOpCreateActionTarget struct { } -func (*awsRestjson1_deserializeOpCreateMembers) ID() string { +func (*awsRestjson1_deserializeOpCreateActionTarget) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1876,9 +1859,9 @@ func (m *awsRestjson1_deserializeOpCreateMembers) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateActionTarget(response, &metadata) } - output := &CreateMembersOutput{} + output := &CreateActionTargetOutput{} out.Result = output var buff [1024]byte @@ -1899,7 +1882,7 @@ func (m *awsRestjson1_deserializeOpCreateMembers) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateMembersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1912,7 +1895,7 @@ func (m *awsRestjson1_deserializeOpCreateMembers) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1978,7 +1961,7 @@ func awsRestjson1_deserializeOpErrorCreateMembers(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateMembersOutput(v **CreateMembersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(v **CreateActionTargetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1991,18 +1974,22 @@ func awsRestjson1_deserializeOpDocumentCreateMembersOutput(v **CreateMembersOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateMembersOutput + var sv *CreateActionTargetOutput if *v == nil { - sv = &CreateMembersOutput{} + sv = &CreateActionTargetOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "UnprocessedAccounts": - if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { - return err + case "ActionTargetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ActionTargetArn = ptr.String(jtv) } default: @@ -2014,14 +2001,14 @@ func awsRestjson1_deserializeOpDocumentCreateMembersOutput(v **CreateMembersOutp return nil } -type awsRestjson1_deserializeOpDeclineInvitations struct { +type awsRestjson1_deserializeOpCreateAutomationRule struct { } -func (*awsRestjson1_deserializeOpDeclineInvitations) ID() string { +func (*awsRestjson1_deserializeOpCreateAutomationRule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeclineInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAutomationRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2035,9 +2022,9 @@ func (m *awsRestjson1_deserializeOpDeclineInvitations) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeclineInvitations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAutomationRule(response, &metadata) } - output := &DeclineInvitationsOutput{} + output := &CreateAutomationRuleOutput{} out.Result = output var buff [1024]byte @@ -2058,7 +2045,7 @@ func (m *awsRestjson1_deserializeOpDeclineInvitations) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAutomationRuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2071,7 +2058,7 @@ func (m *awsRestjson1_deserializeOpDeclineInvitations) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeclineInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAutomationRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2112,6 +2099,9 @@ func awsRestjson1_deserializeOpErrorDeclineInvitations(response *smithyhttp.Resp } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -2121,8 +2111,8 @@ func awsRestjson1_deserializeOpErrorDeclineInvitations(response *smithyhttp.Resp case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2134,7 +2124,7 @@ func awsRestjson1_deserializeOpErrorDeclineInvitations(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(v **DeclineInvitationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAutomationRuleOutput(v **CreateAutomationRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2147,18 +2137,22 @@ func awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(v **DeclineInvit return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeclineInvitationsOutput + var sv *CreateAutomationRuleOutput if *v == nil { - sv = &DeclineInvitationsOutput{} + sv = &CreateAutomationRuleOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "UnprocessedAccounts": - if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { - return err + case "RuleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleArn = ptr.String(jtv) } default: @@ -2170,14 +2164,14 @@ func awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(v **DeclineInvit return nil } -type awsRestjson1_deserializeOpDeleteActionTarget struct { +type awsRestjson1_deserializeOpCreateFindingAggregator struct { } -func (*awsRestjson1_deserializeOpDeleteActionTarget) ID() string { +func (*awsRestjson1_deserializeOpCreateFindingAggregator) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateFindingAggregator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2191,9 +2185,9 @@ func (m *awsRestjson1_deserializeOpDeleteActionTarget) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteActionTarget(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateFindingAggregator(response, &metadata) } - output := &DeleteActionTargetOutput{} + output := &CreateFindingAggregatorOutput{} out.Result = output var buff [1024]byte @@ -2214,7 +2208,7 @@ func (m *awsRestjson1_deserializeOpDeleteActionTarget) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateFindingAggregatorOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2227,7 +2221,7 @@ func (m *awsRestjson1_deserializeOpDeleteActionTarget) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateFindingAggregator(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2268,6 +2262,9 @@ func awsRestjson1_deserializeOpErrorDeleteActionTarget(response *smithyhttp.Resp } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -2277,8 +2274,8 @@ func awsRestjson1_deserializeOpErrorDeleteActionTarget(response *smithyhttp.Resp case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2290,7 +2287,7 @@ func awsRestjson1_deserializeOpErrorDeleteActionTarget(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(v **DeleteActionTargetOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateFindingAggregatorOutput(v **CreateFindingAggregatorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2303,22 +2300,45 @@ func awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(v **DeleteAction return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteActionTargetOutput + var sv *CreateFindingAggregatorOutput if *v == nil { - sv = &DeleteActionTargetOutput{} + sv = &CreateFindingAggregatorOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ActionTargetArn": + case "FindingAggregationRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.ActionTargetArn = ptr.String(jtv) + sv.FindingAggregationRegion = ptr.String(jtv) + } + + case "FindingAggregatorArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FindingAggregatorArn = ptr.String(jtv) + } + + case "RegionLinkingMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RegionLinkingMode = ptr.String(jtv) + } + + case "Regions": + if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { + return err } default: @@ -2330,14 +2350,14 @@ func awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(v **DeleteAction return nil } -type awsRestjson1_deserializeOpDeleteFindingAggregator struct { +type awsRestjson1_deserializeOpCreateInsight struct { } -func (*awsRestjson1_deserializeOpDeleteFindingAggregator) ID() string { +func (*awsRestjson1_deserializeOpCreateInsight) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteFindingAggregator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2351,15 +2371,43 @@ func (m *awsRestjson1_deserializeOpDeleteFindingAggregator) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteFindingAggregator(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateInsight(response, &metadata) } - output := &DeleteFindingAggregatorOutput{} + output := &CreateInsightOutput{} 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_deserializeOpDocumentCreateInsightOutput(&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_deserializeOpErrorDeleteFindingAggregator(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2400,9 +2448,6 @@ func awsRestjson1_deserializeOpErrorDeleteFindingAggregator(response *smithyhttp } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -2415,8 +2460,8 @@ func awsRestjson1_deserializeOpErrorDeleteFindingAggregator(response *smithyhttp case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceConflictException", errorCode): + return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2428,14 +2473,54 @@ func awsRestjson1_deserializeOpErrorDeleteFindingAggregator(response *smithyhttp } } -type awsRestjson1_deserializeOpDeleteInsight struct { +func awsRestjson1_deserializeOpDocumentCreateInsightOutput(v **CreateInsightOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateInsightOutput + if *v == nil { + sv = &CreateInsightOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "InsightArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.InsightArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteInsight) ID() string { +type awsRestjson1_deserializeOpCreateMembers struct { +} + +func (*awsRestjson1_deserializeOpCreateMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2449,9 +2534,9 @@ func (m *awsRestjson1_deserializeOpDeleteInsight) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteInsight(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateMembers(response, &metadata) } - output := &DeleteInsightOutput{} + output := &CreateMembersOutput{} out.Result = output var buff [1024]byte @@ -2472,7 +2557,7 @@ func (m *awsRestjson1_deserializeOpDeleteInsight) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteInsightOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2485,7 +2570,7 @@ func (m *awsRestjson1_deserializeOpDeleteInsight) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2538,8 +2623,8 @@ func awsRestjson1_deserializeOpErrorDeleteInsight(response *smithyhttp.Response, case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceConflictException", errorCode): + return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2551,7 +2636,7 @@ func awsRestjson1_deserializeOpErrorDeleteInsight(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDeleteInsightOutput(v **DeleteInsightOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateMembersOutput(v **CreateMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2564,22 +2649,18 @@ func awsRestjson1_deserializeOpDocumentDeleteInsightOutput(v **DeleteInsightOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteInsightOutput + var sv *CreateMembersOutput if *v == nil { - sv = &DeleteInsightOutput{} + sv = &CreateMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "InsightArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.InsightArn = ptr.String(jtv) + case "UnprocessedAccounts": + if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { + return err } default: @@ -2591,14 +2672,14 @@ func awsRestjson1_deserializeOpDocumentDeleteInsightOutput(v **DeleteInsightOutp return nil } -type awsRestjson1_deserializeOpDeleteInvitations struct { +type awsRestjson1_deserializeOpDeclineInvitations struct { } -func (*awsRestjson1_deserializeOpDeleteInvitations) ID() string { +func (*awsRestjson1_deserializeOpDeclineInvitations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeclineInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2612,9 +2693,9 @@ func (m *awsRestjson1_deserializeOpDeleteInvitations) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteInvitations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeclineInvitations(response, &metadata) } - output := &DeleteInvitationsOutput{} + output := &DeclineInvitationsOutput{} out.Result = output var buff [1024]byte @@ -2635,7 +2716,7 @@ func (m *awsRestjson1_deserializeOpDeleteInvitations) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2648,7 +2729,7 @@ func (m *awsRestjson1_deserializeOpDeleteInvitations) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeclineInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2698,9 +2779,6 @@ func awsRestjson1_deserializeOpErrorDeleteInvitations(response *smithyhttp.Respo case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2714,7 +2792,7 @@ func awsRestjson1_deserializeOpErrorDeleteInvitations(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(v **DeleteInvitationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(v **DeclineInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2727,9 +2805,9 @@ func awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(v **DeleteInvitat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteInvitationsOutput + var sv *DeclineInvitationsOutput if *v == nil { - sv = &DeleteInvitationsOutput{} + sv = &DeclineInvitationsOutput{} } else { sv = *v } @@ -2750,14 +2828,14 @@ func awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(v **DeleteInvitat return nil } -type awsRestjson1_deserializeOpDeleteMembers struct { +type awsRestjson1_deserializeOpDeleteActionTarget struct { } -func (*awsRestjson1_deserializeOpDeleteMembers) ID() string { +func (*awsRestjson1_deserializeOpDeleteActionTarget) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2771,9 +2849,9 @@ func (m *awsRestjson1_deserializeOpDeleteMembers) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteActionTarget(response, &metadata) } - output := &DeleteMembersOutput{} + output := &DeleteActionTargetOutput{} out.Result = output var buff [1024]byte @@ -2794,7 +2872,7 @@ func (m *awsRestjson1_deserializeOpDeleteMembers) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteMembersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2807,7 +2885,7 @@ func (m *awsRestjson1_deserializeOpDeleteMembers) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2857,9 +2935,6 @@ func awsRestjson1_deserializeOpErrorDeleteMembers(response *smithyhttp.Response, case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2873,7 +2948,7 @@ func awsRestjson1_deserializeOpErrorDeleteMembers(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDeleteMembersOutput(v **DeleteMembersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(v **DeleteActionTargetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2886,18 +2961,22 @@ func awsRestjson1_deserializeOpDocumentDeleteMembersOutput(v **DeleteMembersOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteMembersOutput + var sv *DeleteActionTargetOutput if *v == nil { - sv = &DeleteMembersOutput{} + sv = &DeleteActionTargetOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "UnprocessedAccounts": - if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { - return err + case "ActionTargetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ActionTargetArn = ptr.String(jtv) } default: @@ -2909,14 +2988,14 @@ func awsRestjson1_deserializeOpDocumentDeleteMembersOutput(v **DeleteMembersOutp return nil } -type awsRestjson1_deserializeOpDescribeActionTargets struct { +type awsRestjson1_deserializeOpDeleteFindingAggregator struct { } -func (*awsRestjson1_deserializeOpDescribeActionTargets) ID() string { +func (*awsRestjson1_deserializeOpDeleteFindingAggregator) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeActionTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteFindingAggregator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2930,9 +3009,107 @@ func (m *awsRestjson1_deserializeOpDescribeActionTargets) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeActionTargets(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteFindingAggregator(response, &metadata) } - output := &DescribeActionTargetsOutput{} + output := &DeleteFindingAggregatorOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteFindingAggregator(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteInsight struct { +} + +func (*awsRestjson1_deserializeOpDeleteInsight) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteInsight) HandleDeserialize(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_deserializeOpErrorDeleteInsight(response, &metadata) + } + output := &DeleteInsightOutput{} out.Result = output var buff [1024]byte @@ -2953,7 +3130,7 @@ func (m *awsRestjson1_deserializeOpDescribeActionTargets) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteInsightOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2966,7 +3143,7 @@ func (m *awsRestjson1_deserializeOpDescribeActionTargets) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeActionTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3016,6 +3193,9 @@ func awsRestjson1_deserializeOpErrorDescribeActionTargets(response *smithyhttp.R case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3029,7 +3209,7 @@ func awsRestjson1_deserializeOpErrorDescribeActionTargets(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(v **DescribeActionTargetsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteInsightOutput(v **DeleteInsightOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3042,27 +3222,22 @@ func awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(v **DescribeA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeActionTargetsOutput + var sv *DeleteInsightOutput if *v == nil { - sv = &DescribeActionTargetsOutput{} + sv = &DeleteInsightOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ActionTargets": - if err := awsRestjson1_deserializeDocumentActionTargetList(&sv.ActionTargets, value); err != nil { - return err - } - - case "NextToken": + case "InsightArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.InsightArn = ptr.String(jtv) } default: @@ -3074,14 +3249,14 @@ func awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(v **DescribeA return nil } -type awsRestjson1_deserializeOpDescribeHub struct { +type awsRestjson1_deserializeOpDeleteInvitations struct { } -func (*awsRestjson1_deserializeOpDescribeHub) ID() string { +func (*awsRestjson1_deserializeOpDeleteInvitations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3095,9 +3270,9 @@ func (m *awsRestjson1_deserializeOpDescribeHub) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeHub(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteInvitations(response, &metadata) } - output := &DescribeHubOutput{} + output := &DeleteInvitationsOutput{} out.Result = output var buff [1024]byte @@ -3118,7 +3293,7 @@ func (m *awsRestjson1_deserializeOpDescribeHub) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeHubOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3131,7 +3306,7 @@ func (m *awsRestjson1_deserializeOpDescribeHub) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3197,7 +3372,7 @@ func awsRestjson1_deserializeOpErrorDescribeHub(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentDescribeHubOutput(v **DescribeHubOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(v **DeleteInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3210,49 +3385,18 @@ func awsRestjson1_deserializeOpDocumentDescribeHubOutput(v **DescribeHubOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeHubOutput + var sv *DeleteInvitationsOutput if *v == nil { - sv = &DescribeHubOutput{} + sv = &DeleteInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AutoEnableControls": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.AutoEnableControls = jtv - } - - case "ControlFindingGenerator": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ControlFindingGenerator to be of type string, got %T instead", value) - } - sv.ControlFindingGenerator = types.ControlFindingGenerator(jtv) - } - - case "HubArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.HubArn = ptr.String(jtv) - } - - case "SubscribedAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.SubscribedAt = ptr.String(jtv) + case "UnprocessedAccounts": + if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { + return err } default: @@ -3264,14 +3408,14 @@ func awsRestjson1_deserializeOpDocumentDescribeHubOutput(v **DescribeHubOutput, return nil } -type awsRestjson1_deserializeOpDescribeOrganizationConfiguration struct { +type awsRestjson1_deserializeOpDeleteMembers struct { } -func (*awsRestjson1_deserializeOpDescribeOrganizationConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDeleteMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3285,9 +3429,9 @@ func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteMembers(response, &metadata) } - output := &DescribeOrganizationConfigurationOutput{} + output := &DeleteMembersOutput{} out.Result = output var buff [1024]byte @@ -3308,7 +3452,7 @@ func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3321,7 +3465,7 @@ func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3374,6 +3518,9 @@ func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response * case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3384,7 +3531,7 @@ func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response * } } -func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v **DescribeOrganizationConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteMembersOutput(v **DeleteMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3397,40 +3544,18 @@ func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeOrganizationConfigurationOutput + var sv *DeleteMembersOutput if *v == nil { - sv = &DescribeOrganizationConfigurationOutput{} + sv = &DeleteMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AutoEnable": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.AutoEnable = jtv - } - - case "AutoEnableStandards": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AutoEnableStandards to be of type string, got %T instead", value) - } - sv.AutoEnableStandards = types.AutoEnableStandards(jtv) - } - - case "MemberAccountLimitReached": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.MemberAccountLimitReached = jtv + case "UnprocessedAccounts": + if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { + return err } default: @@ -3442,14 +3567,14 @@ func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v return nil } -type awsRestjson1_deserializeOpDescribeProducts struct { +type awsRestjson1_deserializeOpDescribeActionTargets struct { } -func (*awsRestjson1_deserializeOpDescribeProducts) ID() string { +func (*awsRestjson1_deserializeOpDescribeActionTargets) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeProducts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeActionTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3463,9 +3588,9 @@ func (m *awsRestjson1_deserializeOpDescribeProducts) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeProducts(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeActionTargets(response, &metadata) } - output := &DescribeProductsOutput{} + output := &DescribeActionTargetsOutput{} out.Result = output var buff [1024]byte @@ -3486,7 +3611,7 @@ func (m *awsRestjson1_deserializeOpDescribeProducts) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeProductsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3499,7 +3624,7 @@ func (m *awsRestjson1_deserializeOpDescribeProducts) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeProducts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeActionTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3549,8 +3674,8 @@ func awsRestjson1_deserializeOpErrorDescribeProducts(response *smithyhttp.Respon case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3562,7 +3687,7 @@ func awsRestjson1_deserializeOpErrorDescribeProducts(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentDescribeProductsOutput(v **DescribeProductsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(v **DescribeActionTargetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3575,15 +3700,20 @@ func awsRestjson1_deserializeOpDocumentDescribeProductsOutput(v **DescribeProduc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeProductsOutput + var sv *DescribeActionTargetsOutput if *v == nil { - sv = &DescribeProductsOutput{} + sv = &DescribeActionTargetsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "ActionTargets": + if err := awsRestjson1_deserializeDocumentActionTargetList(&sv.ActionTargets, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -3593,11 +3723,6 @@ func awsRestjson1_deserializeOpDocumentDescribeProductsOutput(v **DescribeProduc sv.NextToken = ptr.String(jtv) } - case "Products": - if err := awsRestjson1_deserializeDocumentProductsList(&sv.Products, value); err != nil { - return err - } - default: _, _ = key, value @@ -3607,14 +3732,14 @@ func awsRestjson1_deserializeOpDocumentDescribeProductsOutput(v **DescribeProduc return nil } -type awsRestjson1_deserializeOpDescribeStandards struct { +type awsRestjson1_deserializeOpDescribeHub struct { } -func (*awsRestjson1_deserializeOpDescribeStandards) ID() string { +func (*awsRestjson1_deserializeOpDescribeHub) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3628,9 +3753,9 @@ func (m *awsRestjson1_deserializeOpDescribeStandards) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeStandards(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeHub(response, &metadata) } - output := &DescribeStandardsOutput{} + output := &DescribeHubOutput{} out.Result = output var buff [1024]byte @@ -3651,7 +3776,7 @@ func (m *awsRestjson1_deserializeOpDescribeStandards) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeStandardsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeHubOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3664,7 +3789,7 @@ func (m *awsRestjson1_deserializeOpDescribeStandards) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3714,6 +3839,12 @@ func awsRestjson1_deserializeOpErrorDescribeStandards(response *smithyhttp.Respo case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3724,7 +3855,7 @@ func awsRestjson1_deserializeOpErrorDescribeStandards(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDescribeStandardsOutput(v **DescribeStandardsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeHubOutput(v **DescribeHubOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3737,27 +3868,49 @@ func awsRestjson1_deserializeOpDocumentDescribeStandardsOutput(v **DescribeStand return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeStandardsOutput + var sv *DescribeHubOutput if *v == nil { - sv = &DescribeStandardsOutput{} + sv = &DescribeHubOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": + case "AutoEnableControls": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoEnableControls = jtv + } + + case "ControlFindingGenerator": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ControlFindingGenerator to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ControlFindingGenerator = types.ControlFindingGenerator(jtv) } - case "Standards": - if err := awsRestjson1_deserializeDocumentStandards(&sv.Standards, value); err != nil { - return err + case "HubArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.HubArn = ptr.String(jtv) + } + + case "SubscribedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SubscribedAt = ptr.String(jtv) } default: @@ -3769,14 +3922,14 @@ func awsRestjson1_deserializeOpDocumentDescribeStandardsOutput(v **DescribeStand return nil } -type awsRestjson1_deserializeOpDescribeStandardsControls struct { +type awsRestjson1_deserializeOpDescribeOrganizationConfiguration struct { } -func (*awsRestjson1_deserializeOpDescribeStandardsControls) ID() string { +func (*awsRestjson1_deserializeOpDescribeOrganizationConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeStandardsControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3790,9 +3943,9 @@ func (m *awsRestjson1_deserializeOpDescribeStandardsControls) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeStandardsControls(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response, &metadata) } - output := &DescribeStandardsControlsOutput{} + output := &DescribeOrganizationConfigurationOutput{} out.Result = output var buff [1024]byte @@ -3813,7 +3966,7 @@ func (m *awsRestjson1_deserializeOpDescribeStandardsControls) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeStandardsControlsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3826,7 +3979,7 @@ func (m *awsRestjson1_deserializeOpDescribeStandardsControls) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeStandardsControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3876,8 +4029,8 @@ func awsRestjson1_deserializeOpErrorDescribeStandardsControls(response *smithyht case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3889,7 +4042,7 @@ func awsRestjson1_deserializeOpErrorDescribeStandardsControls(response *smithyht } } -func awsRestjson1_deserializeOpDocumentDescribeStandardsControlsOutput(v **DescribeStandardsControlsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v **DescribeOrganizationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3902,27 +4055,40 @@ func awsRestjson1_deserializeOpDocumentDescribeStandardsControlsOutput(v **Descr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeStandardsControlsOutput + var sv *DescribeOrganizationConfigurationOutput if *v == nil { - sv = &DescribeStandardsControlsOutput{} + sv = &DescribeOrganizationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Controls": - if err := awsRestjson1_deserializeDocumentStandardsControls(&sv.Controls, value); err != nil { - return err + case "AutoEnable": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoEnable = jtv } - case "NextToken": + case "AutoEnableStandards": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected AutoEnableStandards to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AutoEnableStandards = types.AutoEnableStandards(jtv) + } + + case "MemberAccountLimitReached": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.MemberAccountLimitReached = jtv } default: @@ -3934,14 +4100,14 @@ func awsRestjson1_deserializeOpDocumentDescribeStandardsControlsOutput(v **Descr return nil } -type awsRestjson1_deserializeOpDisableImportFindingsForProduct struct { +type awsRestjson1_deserializeOpDescribeProducts struct { } -func (*awsRestjson1_deserializeOpDisableImportFindingsForProduct) ID() string { +func (*awsRestjson1_deserializeOpDescribeProducts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisableImportFindingsForProduct) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeProducts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3955,110 +4121,43 @@ func (m *awsRestjson1_deserializeOpDisableImportFindingsForProduct) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisableImportFindingsForProduct(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeProducts(response, &metadata) } - output := &DisableImportFindingsForProductOutput{} + output := &DescribeProductsOutput{} out.Result = output - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDisableImportFindingsForProduct(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { + 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 - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("InvalidAccessException", errorCode): - return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDisableOrganizationAdminAccount struct { -} - -func (*awsRestjson1_deserializeOpDisableOrganizationAdminAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDisableOrganizationAdminAccount) HandleDeserialize(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_deserializeOpErrorDisableOrganizationAdminAccount(response, &metadata) + err = awsRestjson1_deserializeOpDocumentDescribeProductsOutput(&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(), + } } - output := &DisableOrganizationAdminAccountOutput{} - out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisableOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeProducts(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4121,14 +4220,59 @@ func awsRestjson1_deserializeOpErrorDisableOrganizationAdminAccount(response *sm } } -type awsRestjson1_deserializeOpDisableSecurityHub struct { +func awsRestjson1_deserializeOpDocumentDescribeProductsOutput(v **DescribeProductsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeProductsOutput + if *v == nil { + sv = &DescribeProductsOutput{} + } 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 "Products": + if err := awsRestjson1_deserializeDocumentProductsList(&sv.Products, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDisableSecurityHub) ID() string { +type awsRestjson1_deserializeOpDescribeStandards struct { +} + +func (*awsRestjson1_deserializeOpDescribeStandards) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisableSecurityHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4142,15 +4286,43 @@ func (m *awsRestjson1_deserializeOpDisableSecurityHub) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisableSecurityHub(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeStandards(response, &metadata) } - output := &DisableSecurityHubOutput{} + output := &DescribeStandardsOutput{} 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_deserializeOpDocumentDescribeStandardsOutput(&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_deserializeOpErrorDisableSecurityHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4197,11 +4369,8 @@ func awsRestjson1_deserializeOpErrorDisableSecurityHub(response *smithyhttp.Resp case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4213,14 +4382,59 @@ func awsRestjson1_deserializeOpErrorDisableSecurityHub(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpDisassociateFromAdministratorAccount struct { +func awsRestjson1_deserializeOpDocumentDescribeStandardsOutput(v **DescribeStandardsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeStandardsOutput + if *v == nil { + sv = &DescribeStandardsOutput{} + } 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 "Standards": + if err := awsRestjson1_deserializeDocumentStandards(&sv.Standards, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDisassociateFromAdministratorAccount) ID() string { +type awsRestjson1_deserializeOpDescribeStandardsControls struct { +} + +func (*awsRestjson1_deserializeOpDescribeStandardsControls) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateFromAdministratorAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeStandardsControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4234,15 +4448,43 @@ func (m *awsRestjson1_deserializeOpDisassociateFromAdministratorAccount) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateFromAdministratorAccount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeStandardsControls(response, &metadata) } - output := &DisassociateFromAdministratorAccountOutput{} + output := &DescribeStandardsControlsOutput{} 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_deserializeOpDocumentDescribeStandardsControlsOutput(&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_deserializeOpErrorDisassociateFromAdministratorAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeStandardsControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4292,9 +4534,6 @@ func awsRestjson1_deserializeOpErrorDisassociateFromAdministratorAccount(respons case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4308,14 +4547,59 @@ func awsRestjson1_deserializeOpErrorDisassociateFromAdministratorAccount(respons } } -type awsRestjson1_deserializeOpDisassociateFromMasterAccount struct { +func awsRestjson1_deserializeOpDocumentDescribeStandardsControlsOutput(v **DescribeStandardsControlsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeStandardsControlsOutput + if *v == nil { + sv = &DescribeStandardsControlsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Controls": + if err := awsRestjson1_deserializeDocumentStandardsControls(&sv.Controls, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDisassociateFromMasterAccount) ID() string { +type awsRestjson1_deserializeOpDisableImportFindingsForProduct struct { +} + +func (*awsRestjson1_deserializeOpDisableImportFindingsForProduct) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateFromMasterAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisableImportFindingsForProduct) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4329,15 +4613,15 @@ func (m *awsRestjson1_deserializeOpDisassociateFromMasterAccount) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateFromMasterAccount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisableImportFindingsForProduct(response, &metadata) } - output := &DisassociateFromMasterAccountOutput{} + output := &DisableImportFindingsForProductOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateFromMasterAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisableImportFindingsForProduct(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4403,14 +4687,14 @@ func awsRestjson1_deserializeOpErrorDisassociateFromMasterAccount(response *smit } } -type awsRestjson1_deserializeOpDisassociateMembers struct { +type awsRestjson1_deserializeOpDisableOrganizationAdminAccount struct { } -func (*awsRestjson1_deserializeOpDisassociateMembers) ID() string { +func (*awsRestjson1_deserializeOpDisableOrganizationAdminAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisableOrganizationAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4424,15 +4708,15 @@ func (m *awsRestjson1_deserializeOpDisassociateMembers) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisableOrganizationAdminAccount(response, &metadata) } - output := &DisassociateMembersOutput{} + output := &DisableOrganizationAdminAccountOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisableOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4485,9 +4769,6 @@ func awsRestjson1_deserializeOpErrorDisassociateMembers(response *smithyhttp.Res case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4498,14 +4779,14 @@ func awsRestjson1_deserializeOpErrorDisassociateMembers(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpEnableImportFindingsForProduct struct { +type awsRestjson1_deserializeOpDisableSecurityHub struct { } -func (*awsRestjson1_deserializeOpEnableImportFindingsForProduct) ID() string { +func (*awsRestjson1_deserializeOpDisableSecurityHub) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpEnableImportFindingsForProduct) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisableSecurityHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4519,43 +4800,15 @@ func (m *awsRestjson1_deserializeOpEnableImportFindingsForProduct) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorEnableImportFindingsForProduct(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisableSecurityHub(response, &metadata) } - output := &EnableImportFindingsForProductOutput{} + output := &DisableSecurityHubOutput{} 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_deserializeOpDocumentEnableImportFindingsForProductOutput(&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_deserializeOpErrorEnableImportFindingsForProduct(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisableSecurityHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4602,14 +4855,11 @@ func awsRestjson1_deserializeOpErrorEnableImportFindingsForProduct(response *smi case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): - return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4621,54 +4871,14 @@ func awsRestjson1_deserializeOpErrorEnableImportFindingsForProduct(response *smi } } -func awsRestjson1_deserializeOpDocumentEnableImportFindingsForProductOutput(v **EnableImportFindingsForProductOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *EnableImportFindingsForProductOutput - if *v == nil { - sv = &EnableImportFindingsForProductOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ProductSubscriptionArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ProductSubscriptionArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpEnableOrganizationAdminAccount struct { +type awsRestjson1_deserializeOpDisassociateFromAdministratorAccount struct { } -func (*awsRestjson1_deserializeOpEnableOrganizationAdminAccount) ID() string { +func (*awsRestjson1_deserializeOpDisassociateFromAdministratorAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpEnableOrganizationAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateFromAdministratorAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4682,15 +4892,15 @@ func (m *awsRestjson1_deserializeOpEnableOrganizationAdminAccount) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateFromAdministratorAccount(response, &metadata) } - output := &EnableOrganizationAdminAccountOutput{} + output := &DisassociateFromAdministratorAccountOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateFromAdministratorAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4743,6 +4953,9 @@ func awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response *smi case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4753,14 +4966,14 @@ func awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response *smi } } -type awsRestjson1_deserializeOpEnableSecurityHub struct { +type awsRestjson1_deserializeOpDisassociateFromMasterAccount struct { } -func (*awsRestjson1_deserializeOpEnableSecurityHub) ID() string { +func (*awsRestjson1_deserializeOpDisassociateFromMasterAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpEnableSecurityHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateFromMasterAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4774,15 +4987,15 @@ func (m *awsRestjson1_deserializeOpEnableSecurityHub) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorEnableSecurityHub(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateFromMasterAccount(response, &metadata) } - output := &EnableSecurityHubOutput{} + output := &DisassociateFromMasterAccountOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorEnableSecurityHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateFromMasterAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4823,20 +5036,20 @@ func awsRestjson1_deserializeOpErrorEnableSecurityHub(response *smithyhttp.Respo } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4848,14 +5061,14 @@ func awsRestjson1_deserializeOpErrorEnableSecurityHub(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpGetAdministratorAccount struct { +type awsRestjson1_deserializeOpDisassociateMembers struct { } -func (*awsRestjson1_deserializeOpGetAdministratorAccount) ID() string { +func (*awsRestjson1_deserializeOpDisassociateMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAdministratorAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4869,43 +5082,15 @@ func (m *awsRestjson1_deserializeOpGetAdministratorAccount) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAdministratorAccount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateMembers(response, &metadata) } - output := &GetAdministratorAccountOutput{} + output := &DisassociateMembersOutput{} 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_deserializeOpDocumentGetAdministratorAccountOutput(&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_deserializeOpErrorGetAdministratorAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4971,50 +5156,14 @@ func awsRestjson1_deserializeOpErrorGetAdministratorAccount(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentGetAdministratorAccountOutput(v **GetAdministratorAccountOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetAdministratorAccountOutput - if *v == nil { - sv = &GetAdministratorAccountOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Administrator": - if err := awsRestjson1_deserializeDocumentInvitation(&sv.Administrator, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetEnabledStandards struct { +type awsRestjson1_deserializeOpEnableImportFindingsForProduct struct { } -func (*awsRestjson1_deserializeOpGetEnabledStandards) ID() string { +func (*awsRestjson1_deserializeOpEnableImportFindingsForProduct) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetEnabledStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpEnableImportFindingsForProduct) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5028,9 +5177,9 @@ func (m *awsRestjson1_deserializeOpGetEnabledStandards) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetEnabledStandards(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorEnableImportFindingsForProduct(response, &metadata) } - output := &GetEnabledStandardsOutput{} + output := &EnableImportFindingsForProductOutput{} out.Result = output var buff [1024]byte @@ -5051,7 +5200,7 @@ func (m *awsRestjson1_deserializeOpGetEnabledStandards) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentEnableImportFindingsForProductOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5064,7 +5213,7 @@ func (m *awsRestjson1_deserializeOpGetEnabledStandards) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetEnabledStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorEnableImportFindingsForProduct(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5117,6 +5266,9 @@ func awsRestjson1_deserializeOpErrorGetEnabledStandards(response *smithyhttp.Res case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceConflictException", errorCode): + return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5127,7 +5279,7 @@ func awsRestjson1_deserializeOpErrorGetEnabledStandards(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(v **GetEnabledStandardsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentEnableImportFindingsForProductOutput(v **EnableImportFindingsForProductOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5140,27 +5292,22 @@ func awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(v **GetEnabledS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetEnabledStandardsOutput + var sv *EnableImportFindingsForProductOutput if *v == nil { - sv = &GetEnabledStandardsOutput{} + sv = &EnableImportFindingsForProductOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": + case "ProductSubscriptionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) - } - - case "StandardsSubscriptions": - if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { - return err + sv.ProductSubscriptionArn = ptr.String(jtv) } default: @@ -5172,14 +5319,14 @@ func awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(v **GetEnabledS return nil } -type awsRestjson1_deserializeOpGetFindingAggregator struct { +type awsRestjson1_deserializeOpEnableOrganizationAdminAccount struct { } -func (*awsRestjson1_deserializeOpGetFindingAggregator) ID() string { +func (*awsRestjson1_deserializeOpEnableOrganizationAdminAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetFindingAggregator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpEnableOrganizationAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5193,43 +5340,107 @@ func (m *awsRestjson1_deserializeOpGetFindingAggregator) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetFindingAggregator(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response, &metadata) } - output := &GetFindingAggregatorOutput{} + output := &EnableOrganizationAdminAccountOutput{} out.Result = output + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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(response.Body, ringBuffer) - + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return out, metadata, err + return err } - err = awsRestjson1_deserializeOpDocumentGetFindingAggregatorOutput(&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(), + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + + } +} + +type awsRestjson1_deserializeOpEnableSecurityHub struct { +} + +func (*awsRestjson1_deserializeOpEnableSecurityHub) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpEnableSecurityHub) HandleDeserialize(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_deserializeOpErrorEnableSecurityHub(response, &metadata) + } + output := &EnableSecurityHubOutput{} + out.Result = output + return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetFindingAggregator(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorEnableSecurityHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5279,14 +5490,11 @@ func awsRestjson1_deserializeOpErrorGetFindingAggregator(response *smithyhttp.Re case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): - return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceConflictException", errorCode): + return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5298,77 +5506,14 @@ func awsRestjson1_deserializeOpErrorGetFindingAggregator(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentGetFindingAggregatorOutput(v **GetFindingAggregatorOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetFindingAggregatorOutput - if *v == nil { - sv = &GetFindingAggregatorOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "FindingAggregationRegion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.FindingAggregationRegion = ptr.String(jtv) - } - - case "FindingAggregatorArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.FindingAggregatorArn = ptr.String(jtv) - } - - case "RegionLinkingMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.RegionLinkingMode = ptr.String(jtv) - } - - case "Regions": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetFindingHistory struct { +type awsRestjson1_deserializeOpGetAdministratorAccount struct { } -func (*awsRestjson1_deserializeOpGetFindingHistory) ID() string { +func (*awsRestjson1_deserializeOpGetAdministratorAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetFindingHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAdministratorAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5382,9 +5527,9 @@ func (m *awsRestjson1_deserializeOpGetFindingHistory) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetFindingHistory(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAdministratorAccount(response, &metadata) } - output := &GetFindingHistoryOutput{} + output := &GetAdministratorAccountOutput{} out.Result = output var buff [1024]byte @@ -5405,7 +5550,7 @@ func (m *awsRestjson1_deserializeOpGetFindingHistory) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetFindingHistoryOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAdministratorAccountOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5418,7 +5563,7 @@ func (m *awsRestjson1_deserializeOpGetFindingHistory) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetFindingHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAdministratorAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5471,6 +5616,9 @@ func awsRestjson1_deserializeOpErrorGetFindingHistory(response *smithyhttp.Respo case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5481,7 +5629,7 @@ func awsRestjson1_deserializeOpErrorGetFindingHistory(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetFindingHistoryOutput(v **GetFindingHistoryOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAdministratorAccountOutput(v **GetAdministratorAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5494,26 +5642,17 @@ func awsRestjson1_deserializeOpDocumentGetFindingHistoryOutput(v **GetFindingHis return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetFindingHistoryOutput + var sv *GetAdministratorAccountOutput if *v == nil { - sv = &GetFindingHistoryOutput{} + sv = &GetAdministratorAccountOutput{} } 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 "Records": - if err := awsRestjson1_deserializeDocumentFindingHistoryRecordList(&sv.Records, value); err != nil { + case "Administrator": + if err := awsRestjson1_deserializeDocumentInvitation(&sv.Administrator, value); err != nil { return err } @@ -5526,14 +5665,14 @@ func awsRestjson1_deserializeOpDocumentGetFindingHistoryOutput(v **GetFindingHis return nil } -type awsRestjson1_deserializeOpGetFindings struct { +type awsRestjson1_deserializeOpGetEnabledStandards struct { } -func (*awsRestjson1_deserializeOpGetFindings) ID() string { +func (*awsRestjson1_deserializeOpGetEnabledStandards) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetEnabledStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5547,9 +5686,9 @@ func (m *awsRestjson1_deserializeOpGetFindings) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetFindings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetEnabledStandards(response, &metadata) } - output := &GetFindingsOutput{} + output := &GetEnabledStandardsOutput{} out.Result = output var buff [1024]byte @@ -5570,7 +5709,7 @@ func (m *awsRestjson1_deserializeOpGetFindings) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetFindingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5583,7 +5722,7 @@ func (m *awsRestjson1_deserializeOpGetFindings) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetEnabledStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5646,7 +5785,7 @@ func awsRestjson1_deserializeOpErrorGetFindings(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentGetFindingsOutput(v **GetFindingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(v **GetEnabledStandardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5659,20 +5798,15 @@ func awsRestjson1_deserializeOpDocumentGetFindingsOutput(v **GetFindingsOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetFindingsOutput + var sv *GetEnabledStandardsOutput if *v == nil { - sv = &GetFindingsOutput{} + sv = &GetEnabledStandardsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Findings": - if err := awsRestjson1_deserializeDocumentAwsSecurityFindingList(&sv.Findings, value); err != nil { - return err - } - case "NextToken": if value != nil { jtv, ok := value.(string) @@ -5682,6 +5816,11 @@ func awsRestjson1_deserializeOpDocumentGetFindingsOutput(v **GetFindingsOutput, sv.NextToken = ptr.String(jtv) } + case "StandardsSubscriptions": + if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { + return err + } + default: _, _ = key, value @@ -5691,14 +5830,14 @@ func awsRestjson1_deserializeOpDocumentGetFindingsOutput(v **GetFindingsOutput, return nil } -type awsRestjson1_deserializeOpGetInsightResults struct { +type awsRestjson1_deserializeOpGetFindingAggregator struct { } -func (*awsRestjson1_deserializeOpGetInsightResults) ID() string { +func (*awsRestjson1_deserializeOpGetFindingAggregator) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetInsightResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFindingAggregator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5712,9 +5851,9 @@ func (m *awsRestjson1_deserializeOpGetInsightResults) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetInsightResults(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFindingAggregator(response, &metadata) } - output := &GetInsightResultsOutput{} + output := &GetFindingAggregatorOutput{} out.Result = output var buff [1024]byte @@ -5735,7 +5874,7 @@ func (m *awsRestjson1_deserializeOpGetInsightResults) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFindingAggregatorOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5748,7 +5887,7 @@ func (m *awsRestjson1_deserializeOpGetInsightResults) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetInsightResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFindingAggregator(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5789,6 +5928,9 @@ func awsRestjson1_deserializeOpErrorGetInsightResults(response *smithyhttp.Respo } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -5814,7 +5956,7 @@ func awsRestjson1_deserializeOpErrorGetInsightResults(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(v **GetInsightResultsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFindingAggregatorOutput(v **GetFindingAggregatorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5827,17 +5969,44 @@ func awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(v **GetInsightRes return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetInsightResultsOutput + var sv *GetFindingAggregatorOutput if *v == nil { - sv = &GetInsightResultsOutput{} + sv = &GetFindingAggregatorOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "InsightResults": - if err := awsRestjson1_deserializeDocumentInsightResults(&sv.InsightResults, value); err != nil { + case "FindingAggregationRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FindingAggregationRegion = ptr.String(jtv) + } + + case "FindingAggregatorArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FindingAggregatorArn = ptr.String(jtv) + } + + case "RegionLinkingMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RegionLinkingMode = ptr.String(jtv) + } + + case "Regions": + if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { return err } @@ -5850,14 +6019,14 @@ func awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(v **GetInsightRes return nil } -type awsRestjson1_deserializeOpGetInsights struct { +type awsRestjson1_deserializeOpGetFindingHistory struct { } -func (*awsRestjson1_deserializeOpGetInsights) ID() string { +func (*awsRestjson1_deserializeOpGetFindingHistory) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetInsights) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFindingHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5871,9 +6040,9 @@ func (m *awsRestjson1_deserializeOpGetInsights) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetInsights(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFindingHistory(response, &metadata) } - output := &GetInsightsOutput{} + output := &GetFindingHistoryOutput{} out.Result = output var buff [1024]byte @@ -5894,7 +6063,7 @@ func (m *awsRestjson1_deserializeOpGetInsights) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetInsightsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFindingHistoryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5907,7 +6076,7 @@ func (m *awsRestjson1_deserializeOpGetInsights) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetInsights(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFindingHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5960,9 +6129,6 @@ func awsRestjson1_deserializeOpErrorGetInsights(response *smithyhttp.Response, m case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5973,7 +6139,7 @@ func awsRestjson1_deserializeOpErrorGetInsights(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentGetInsightsOutput(v **GetInsightsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFindingHistoryOutput(v **GetFindingHistoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5986,20 +6152,15 @@ func awsRestjson1_deserializeOpDocumentGetInsightsOutput(v **GetInsightsOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetInsightsOutput + var sv *GetFindingHistoryOutput if *v == nil { - sv = &GetInsightsOutput{} + sv = &GetFindingHistoryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Insights": - if err := awsRestjson1_deserializeDocumentInsightList(&sv.Insights, value); err != nil { - return err - } - case "NextToken": if value != nil { jtv, ok := value.(string) @@ -6009,6 +6170,11 @@ func awsRestjson1_deserializeOpDocumentGetInsightsOutput(v **GetInsightsOutput, sv.NextToken = ptr.String(jtv) } + case "Records": + if err := awsRestjson1_deserializeDocumentFindingHistoryRecordList(&sv.Records, value); err != nil { + return err + } + default: _, _ = key, value @@ -6018,14 +6184,14 @@ func awsRestjson1_deserializeOpDocumentGetInsightsOutput(v **GetInsightsOutput, return nil } -type awsRestjson1_deserializeOpGetInvitationsCount struct { +type awsRestjson1_deserializeOpGetFindings struct { } -func (*awsRestjson1_deserializeOpGetInvitationsCount) ID() string { +func (*awsRestjson1_deserializeOpGetFindings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetInvitationsCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6039,9 +6205,9 @@ func (m *awsRestjson1_deserializeOpGetInvitationsCount) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetInvitationsCount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFindings(response, &metadata) } - output := &GetInvitationsCountOutput{} + output := &GetFindingsOutput{} out.Result = output var buff [1024]byte @@ -6062,7 +6228,7 @@ func (m *awsRestjson1_deserializeOpGetInvitationsCount) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFindingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6075,7 +6241,7 @@ func (m *awsRestjson1_deserializeOpGetInvitationsCount) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetInvitationsCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6138,7 +6304,7 @@ func awsRestjson1_deserializeOpErrorGetInvitationsCount(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(v **GetInvitationsCountOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFindingsOutput(v **GetFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6151,26 +6317,27 @@ func awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(v **GetInvitati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetInvitationsCountOutput + var sv *GetFindingsOutput if *v == nil { - sv = &GetInvitationsCountOutput{} + sv = &GetFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "InvitationsCount": + case "Findings": + if err := awsRestjson1_deserializeDocumentAwsSecurityFindingList(&sv.Findings, value); err != nil { + return err + } + + case "NextToken": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.InvitationsCount = int32(i64) + sv.NextToken = ptr.String(jtv) } default: @@ -6182,14 +6349,14 @@ func awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(v **GetInvitati return nil } -type awsRestjson1_deserializeOpGetMasterAccount struct { +type awsRestjson1_deserializeOpGetInsightResults struct { } -func (*awsRestjson1_deserializeOpGetMasterAccount) ID() string { +func (*awsRestjson1_deserializeOpGetInsightResults) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetMasterAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetInsightResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6203,9 +6370,9 @@ func (m *awsRestjson1_deserializeOpGetMasterAccount) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetMasterAccount(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetInsightResults(response, &metadata) } - output := &GetMasterAccountOutput{} + output := &GetInsightResultsOutput{} out.Result = output var buff [1024]byte @@ -6226,7 +6393,7 @@ func (m *awsRestjson1_deserializeOpGetMasterAccount) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6239,7 +6406,7 @@ func (m *awsRestjson1_deserializeOpGetMasterAccount) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetMasterAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetInsightResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6305,7 +6472,7 @@ func awsRestjson1_deserializeOpErrorGetMasterAccount(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(v **GetMasterAccountOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(v **GetInsightResultsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6318,17 +6485,17 @@ func awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(v **GetMasterAccou return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetMasterAccountOutput + var sv *GetInsightResultsOutput if *v == nil { - sv = &GetMasterAccountOutput{} + sv = &GetInsightResultsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Master": - if err := awsRestjson1_deserializeDocumentInvitation(&sv.Master, value); err != nil { + case "InsightResults": + if err := awsRestjson1_deserializeDocumentInsightResults(&sv.InsightResults, value); err != nil { return err } @@ -6341,14 +6508,14 @@ func awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(v **GetMasterAccou return nil } -type awsRestjson1_deserializeOpGetMembers struct { +type awsRestjson1_deserializeOpGetInsights struct { } -func (*awsRestjson1_deserializeOpGetMembers) ID() string { +func (*awsRestjson1_deserializeOpGetInsights) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetInsights) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6362,9 +6529,9 @@ func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetInsights(response, &metadata) } - output := &GetMembersOutput{} + output := &GetInsightsOutput{} out.Result = output var buff [1024]byte @@ -6385,7 +6552,7 @@ func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetMembersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetInsightsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6398,7 +6565,7 @@ func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetInsights(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6464,7 +6631,7 @@ func awsRestjson1_deserializeOpErrorGetMembers(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetInsightsOutput(v **GetInsightsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6477,23 +6644,27 @@ func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetMembersOutput + var sv *GetInsightsOutput if *v == nil { - sv = &GetMembersOutput{} + sv = &GetInsightsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Members": - if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { + case "Insights": + if err := awsRestjson1_deserializeDocumentInsightList(&sv.Insights, value); err != nil { return err } - case "UnprocessedAccounts": - if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, 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: @@ -6505,14 +6676,14 @@ func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, va return nil } -type awsRestjson1_deserializeOpInviteMembers struct { +type awsRestjson1_deserializeOpGetInvitationsCount struct { } -func (*awsRestjson1_deserializeOpInviteMembers) ID() string { +func (*awsRestjson1_deserializeOpGetInvitationsCount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpInviteMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetInvitationsCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6526,9 +6697,9 @@ func (m *awsRestjson1_deserializeOpInviteMembers) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorInviteMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetInvitationsCount(response, &metadata) } - output := &InviteMembersOutput{} + output := &GetInvitationsCountOutput{} out.Result = output var buff [1024]byte @@ -6549,7 +6720,7 @@ func (m *awsRestjson1_deserializeOpInviteMembers) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentInviteMembersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6562,7 +6733,7 @@ func (m *awsRestjson1_deserializeOpInviteMembers) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorInviteMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetInvitationsCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6615,9 +6786,6 @@ func awsRestjson1_deserializeOpErrorInviteMembers(response *smithyhttp.Response, case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6628,7 +6796,7 @@ func awsRestjson1_deserializeOpErrorInviteMembers(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentInviteMembersOutput(v **InviteMembersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(v **GetInvitationsCountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6641,18 +6809,26 @@ func awsRestjson1_deserializeOpDocumentInviteMembersOutput(v **InviteMembersOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *InviteMembersOutput + var sv *GetInvitationsCountOutput if *v == nil { - sv = &InviteMembersOutput{} + sv = &GetInvitationsCountOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "UnprocessedAccounts": - if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { - return err + case "InvitationsCount": + 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.InvitationsCount = int32(i64) } default: @@ -6664,14 +6840,14 @@ func awsRestjson1_deserializeOpDocumentInviteMembersOutput(v **InviteMembersOutp return nil } -type awsRestjson1_deserializeOpListEnabledProductsForImport struct { +type awsRestjson1_deserializeOpGetMasterAccount struct { } -func (*awsRestjson1_deserializeOpListEnabledProductsForImport) ID() string { +func (*awsRestjson1_deserializeOpGetMasterAccount) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListEnabledProductsForImport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetMasterAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6685,9 +6861,9 @@ func (m *awsRestjson1_deserializeOpListEnabledProductsForImport) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListEnabledProductsForImport(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetMasterAccount(response, &metadata) } - output := &ListEnabledProductsForImportOutput{} + output := &GetMasterAccountOutput{} out.Result = output var buff [1024]byte @@ -6708,7 +6884,7 @@ func (m *awsRestjson1_deserializeOpListEnabledProductsForImport) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6721,7 +6897,7 @@ func (m *awsRestjson1_deserializeOpListEnabledProductsForImport) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorListEnabledProductsForImport(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetMasterAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6768,9 +6944,15 @@ func awsRestjson1_deserializeOpErrorListEnabledProductsForImport(response *smith case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6781,7 +6963,7 @@ func awsRestjson1_deserializeOpErrorListEnabledProductsForImport(response *smith } } -func awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(v **ListEnabledProductsForImportOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(v **GetMasterAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6794,26 +6976,17 @@ func awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(v **Li return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListEnabledProductsForImportOutput + var sv *GetMasterAccountOutput if *v == nil { - sv = &ListEnabledProductsForImportOutput{} + sv = &GetMasterAccountOutput{} } 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 "ProductSubscriptions": - if err := awsRestjson1_deserializeDocumentProductSubscriptionArnList(&sv.ProductSubscriptions, value); err != nil { + case "Master": + if err := awsRestjson1_deserializeDocumentInvitation(&sv.Master, value); err != nil { return err } @@ -6826,14 +6999,14 @@ func awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(v **Li return nil } -type awsRestjson1_deserializeOpListFindingAggregators struct { +type awsRestjson1_deserializeOpGetMembers struct { } -func (*awsRestjson1_deserializeOpListFindingAggregators) ID() string { +func (*awsRestjson1_deserializeOpGetMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFindingAggregators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6847,9 +7020,9 @@ func (m *awsRestjson1_deserializeOpListFindingAggregators) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFindingAggregators(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetMembers(response, &metadata) } - output := &ListFindingAggregatorsOutput{} + output := &GetMembersOutput{} out.Result = output var buff [1024]byte @@ -6870,7 +7043,7 @@ func (m *awsRestjson1_deserializeOpListFindingAggregators) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFindingAggregatorsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6883,7 +7056,7 @@ func (m *awsRestjson1_deserializeOpListFindingAggregators) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFindingAggregators(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6924,9 +7097,6 @@ func awsRestjson1_deserializeOpErrorListFindingAggregators(response *smithyhttp. } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -6939,6 +7109,9 @@ func awsRestjson1_deserializeOpErrorListFindingAggregators(response *smithyhttp. case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6949,7 +7122,7 @@ func awsRestjson1_deserializeOpErrorListFindingAggregators(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListFindingAggregatorsOutput(v **ListFindingAggregatorsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6962,27 +7135,23 @@ func awsRestjson1_deserializeOpDocumentListFindingAggregatorsOutput(v **ListFind return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFindingAggregatorsOutput + var sv *GetMembersOutput if *v == nil { - sv = &ListFindingAggregatorsOutput{} + sv = &GetMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "FindingAggregators": - if err := awsRestjson1_deserializeDocumentFindingAggregatorList(&sv.FindingAggregators, value); err != nil { + case "Members": + if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) + case "UnprocessedAccounts": + if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { + return err } default: @@ -6994,14 +7163,14 @@ func awsRestjson1_deserializeOpDocumentListFindingAggregatorsOutput(v **ListFind return nil } -type awsRestjson1_deserializeOpListInvitations struct { +type awsRestjson1_deserializeOpInviteMembers struct { } -func (*awsRestjson1_deserializeOpListInvitations) ID() string { +func (*awsRestjson1_deserializeOpInviteMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpInviteMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7015,9 +7184,9 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListInvitations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorInviteMembers(response, &metadata) } - output := &ListInvitationsOutput{} + output := &InviteMembersOutput{} out.Result = output var buff [1024]byte @@ -7038,7 +7207,7 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListInvitationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentInviteMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7051,7 +7220,7 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorInviteMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7104,6 +7273,9 @@ func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Respons case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7114,7 +7286,7 @@ func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentInviteMembersOutput(v **InviteMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7127,29 +7299,20 @@ func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitations return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListInvitationsOutput + var sv *InviteMembersOutput if *v == nil { - sv = &ListInvitationsOutput{} + sv = &InviteMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Invitations": - if err := awsRestjson1_deserializeDocumentInvitationList(&sv.Invitations, value); err != nil { + case "UnprocessedAccounts": + if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -7159,14 +7322,14 @@ func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitations return nil } -type awsRestjson1_deserializeOpListMembers struct { +type awsRestjson1_deserializeOpListAutomationRules struct { } -func (*awsRestjson1_deserializeOpListMembers) ID() string { +func (*awsRestjson1_deserializeOpListAutomationRules) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAutomationRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7180,9 +7343,9 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAutomationRules(response, &metadata) } - output := &ListMembersOutput{} + output := &ListAutomationRulesOutput{} out.Result = output var buff [1024]byte @@ -7203,7 +7366,7 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMembersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAutomationRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7216,7 +7379,7 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAutomationRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7257,6 +7420,9 @@ func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, m } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -7279,7 +7445,7 @@ func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAutomationRulesOutput(v **ListAutomationRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7292,17 +7458,17 @@ func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMembersOutput + var sv *ListAutomationRulesOutput if *v == nil { - sv = &ListMembersOutput{} + sv = &ListAutomationRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Members": - if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { + case "AutomationRulesMetadata": + if err := awsRestjson1_deserializeDocumentAutomationRulesMetadataList(&sv.AutomationRulesMetadata, value); err != nil { return err } @@ -7310,7 +7476,7 @@ func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -7324,14 +7490,14 @@ func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, return nil } -type awsRestjson1_deserializeOpListOrganizationAdminAccounts struct { +type awsRestjson1_deserializeOpListEnabledProductsForImport struct { } -func (*awsRestjson1_deserializeOpListOrganizationAdminAccounts) ID() string { +func (*awsRestjson1_deserializeOpListEnabledProductsForImport) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListEnabledProductsForImport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7345,9 +7511,9 @@ func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListEnabledProductsForImport(response, &metadata) } - output := &ListOrganizationAdminAccountsOutput{} + output := &ListEnabledProductsForImportOutput{} out.Result = output var buff [1024]byte @@ -7368,7 +7534,7 @@ func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserial return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7381,7 +7547,7 @@ func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserial return out, metadata, err } -func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListEnabledProductsForImport(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7428,9 +7594,6 @@ func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smit case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): - return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) @@ -7444,7 +7607,7 @@ func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smit } } -func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **ListOrganizationAdminAccountsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(v **ListEnabledProductsForImportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7457,20 +7620,15 @@ func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **L return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListOrganizationAdminAccountsOutput + var sv *ListEnabledProductsForImportOutput if *v == nil { - sv = &ListOrganizationAdminAccountsOutput{} + sv = &ListEnabledProductsForImportOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AdminAccounts": - if err := awsRestjson1_deserializeDocumentAdminAccounts(&sv.AdminAccounts, value); err != nil { - return err - } - case "NextToken": if value != nil { jtv, ok := value.(string) @@ -7480,6 +7638,11 @@ func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **L sv.NextToken = ptr.String(jtv) } + case "ProductSubscriptions": + if err := awsRestjson1_deserializeDocumentProductSubscriptionArnList(&sv.ProductSubscriptions, value); err != nil { + return err + } + default: _, _ = key, value @@ -7489,14 +7652,14 @@ func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **L return nil } -type awsRestjson1_deserializeOpListSecurityControlDefinitions struct { +type awsRestjson1_deserializeOpListFindingAggregators struct { } -func (*awsRestjson1_deserializeOpListSecurityControlDefinitions) ID() string { +func (*awsRestjson1_deserializeOpListFindingAggregators) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityControlDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFindingAggregators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7510,9 +7673,9 @@ func (m *awsRestjson1_deserializeOpListSecurityControlDefinitions) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityControlDefinitions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListFindingAggregators(response, &metadata) } - output := &ListSecurityControlDefinitionsOutput{} + output := &ListFindingAggregatorsOutput{} out.Result = output var buff [1024]byte @@ -7533,7 +7696,7 @@ func (m *awsRestjson1_deserializeOpListSecurityControlDefinitions) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityControlDefinitionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListFindingAggregatorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7546,7 +7709,7 @@ func (m *awsRestjson1_deserializeOpListSecurityControlDefinitions) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityControlDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListFindingAggregators(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7587,6 +7750,9 @@ func awsRestjson1_deserializeOpErrorListSecurityControlDefinitions(response *smi } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -7609,7 +7775,7 @@ func awsRestjson1_deserializeOpErrorListSecurityControlDefinitions(response *smi } } -func awsRestjson1_deserializeOpDocumentListSecurityControlDefinitionsOutput(v **ListSecurityControlDefinitionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListFindingAggregatorsOutput(v **ListFindingAggregatorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7622,15 +7788,20 @@ func awsRestjson1_deserializeOpDocumentListSecurityControlDefinitionsOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityControlDefinitionsOutput + var sv *ListFindingAggregatorsOutput if *v == nil { - sv = &ListSecurityControlDefinitionsOutput{} + sv = &ListFindingAggregatorsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "FindingAggregators": + if err := awsRestjson1_deserializeDocumentFindingAggregatorList(&sv.FindingAggregators, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -7640,11 +7811,6 @@ func awsRestjson1_deserializeOpDocumentListSecurityControlDefinitionsOutput(v ** sv.NextToken = ptr.String(jtv) } - case "SecurityControlDefinitions": - if err := awsRestjson1_deserializeDocumentSecurityControlDefinitions(&sv.SecurityControlDefinitions, value); err != nil { - return err - } - default: _, _ = key, value @@ -7654,14 +7820,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityControlDefinitionsOutput(v ** return nil } -type awsRestjson1_deserializeOpListStandardsControlAssociations struct { +type awsRestjson1_deserializeOpListInvitations struct { } -func (*awsRestjson1_deserializeOpListStandardsControlAssociations) ID() string { +func (*awsRestjson1_deserializeOpListInvitations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListStandardsControlAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7675,9 +7841,9 @@ func (m *awsRestjson1_deserializeOpListStandardsControlAssociations) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListStandardsControlAssociations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListInvitations(response, &metadata) } - output := &ListStandardsControlAssociationsOutput{} + output := &ListInvitationsOutput{} out.Result = output var buff [1024]byte @@ -7698,7 +7864,7 @@ func (m *awsRestjson1_deserializeOpListStandardsControlAssociations) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListStandardsControlAssociationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListInvitationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7711,7 +7877,7 @@ func (m *awsRestjson1_deserializeOpListStandardsControlAssociations) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorListStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7774,7 +7940,7 @@ func awsRestjson1_deserializeOpErrorListStandardsControlAssociations(response *s } } -func awsRestjson1_deserializeOpDocumentListStandardsControlAssociationsOutput(v **ListStandardsControlAssociationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7787,29 +7953,29 @@ func awsRestjson1_deserializeOpDocumentListStandardsControlAssociationsOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListStandardsControlAssociationsOutput + var sv *ListInvitationsOutput if *v == nil { - sv = &ListStandardsControlAssociationsOutput{} + sv = &ListInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "Invitations": + if err := awsRestjson1_deserializeDocumentInvitationList(&sv.Invitations, 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) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "StandardsControlAssociationSummaries": - if err := awsRestjson1_deserializeDocumentStandardsControlAssociationSummaries(&sv.StandardsControlAssociationSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -7819,14 +7985,14 @@ func awsRestjson1_deserializeOpDocumentListStandardsControlAssociationsOutput(v return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListMembers struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7840,9 +8006,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListMembers(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListMembersOutput{} out.Result = output var buff [1024]byte @@ -7863,7 +8029,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7876,7 +8042,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7920,11 +8086,14 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7936,7 +8105,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7949,20 +8118,29 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListMembersOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "Members": + if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { return err } + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -7972,14 +8150,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListOrganizationAdminAccounts struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListOrganizationAdminAccounts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7993,15 +8171,43 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response, &metadata) } - output := &TagResourceOutput{} + output := &ListOrganizationAdminAccountsOutput{} 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_deserializeOpDocumentListOrganizationAdminAccountsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8045,11 +8251,14 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8061,14 +8270,59 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **ListOrganizationAdminAccountsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListOrganizationAdminAccountsOutput + if *v == nil { + sv = &ListOrganizationAdminAccountsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdminAccounts": + if err := awsRestjson1_deserializeDocumentAdminAccounts(&sv.AdminAccounts, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpListSecurityControlDefinitions struct { +} + +func (*awsRestjson1_deserializeOpListSecurityControlDefinitions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityControlDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8082,15 +8336,43 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityControlDefinitions(response, &metadata) } - output := &UntagResourceOutput{} + output := &ListSecurityControlDefinitionsOutput{} 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_deserializeOpDocumentListSecurityControlDefinitionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityControlDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8134,11 +8416,14 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8150,14 +8435,59 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateActionTarget struct { +func awsRestjson1_deserializeOpDocumentListSecurityControlDefinitionsOutput(v **ListSecurityControlDefinitionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSecurityControlDefinitionsOutput + if *v == nil { + sv = &ListSecurityControlDefinitionsOutput{} + } 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 "SecurityControlDefinitions": + if err := awsRestjson1_deserializeDocumentSecurityControlDefinitions(&sv.SecurityControlDefinitions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateActionTarget) ID() string { +type awsRestjson1_deserializeOpListStandardsControlAssociations struct { +} + +func (*awsRestjson1_deserializeOpListStandardsControlAssociations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListStandardsControlAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8171,15 +8501,43 @@ func (m *awsRestjson1_deserializeOpUpdateActionTarget) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateActionTarget(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListStandardsControlAssociations(response, &metadata) } - output := &UpdateActionTargetOutput{} + output := &ListStandardsControlAssociationsOutput{} 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_deserializeOpDocumentListStandardsControlAssociationsOutput(&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_deserializeOpErrorUpdateActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8229,8 +8587,8 @@ func awsRestjson1_deserializeOpErrorUpdateActionTarget(response *smithyhttp.Resp case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8242,14 +8600,59 @@ func awsRestjson1_deserializeOpErrorUpdateActionTarget(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpUpdateFindingAggregator struct { +func awsRestjson1_deserializeOpDocumentListStandardsControlAssociationsOutput(v **ListStandardsControlAssociationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListStandardsControlAssociationsOutput + if *v == nil { + sv = &ListStandardsControlAssociationsOutput{} + } 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 "StandardsControlAssociationSummaries": + if err := awsRestjson1_deserializeDocumentStandardsControlAssociationSummaries(&sv.StandardsControlAssociationSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateFindingAggregator) ID() string { +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateFindingAggregator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8263,9 +8666,9 @@ func (m *awsRestjson1_deserializeOpUpdateFindingAggregator) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateFindingAggregator(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UpdateFindingAggregatorOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -8286,7 +8689,7 @@ func (m *awsRestjson1_deserializeOpUpdateFindingAggregator) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateFindingAggregatorOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8299,7 +8702,7 @@ func (m *awsRestjson1_deserializeOpUpdateFindingAggregator) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateFindingAggregator(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8340,21 +8743,12 @@ func awsRestjson1_deserializeOpErrorUpdateFindingAggregator(response *smithyhttp } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("InvalidAccessException", errorCode): - return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -8368,7 +8762,7 @@ func awsRestjson1_deserializeOpErrorUpdateFindingAggregator(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentUpdateFindingAggregatorOutput(v **UpdateFindingAggregatorOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8381,44 +8775,17 @@ func awsRestjson1_deserializeOpDocumentUpdateFindingAggregatorOutput(v **UpdateF return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateFindingAggregatorOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &UpdateFindingAggregatorOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "FindingAggregationRegion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.FindingAggregationRegion = ptr.String(jtv) - } - - case "FindingAggregatorArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.FindingAggregatorArn = ptr.String(jtv) - } - - case "RegionLinkingMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.RegionLinkingMode = ptr.String(jtv) - } - - case "Regions": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } @@ -8431,14 +8798,14 @@ func awsRestjson1_deserializeOpDocumentUpdateFindingAggregatorOutput(v **UpdateF return nil } -type awsRestjson1_deserializeOpUpdateFindings struct { +type awsRestjson1_deserializeOpTagResource struct { } -func (*awsRestjson1_deserializeOpUpdateFindings) ID() string { +func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -8452,15 +8819,15 @@ func (m *awsRestjson1_deserializeOpUpdateFindings) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateFindings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } - output := &UpdateFindingsOutput{} + output := &TagResourceOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -8504,15 +8871,9 @@ func awsRestjson1_deserializeOpErrorUpdateFindings(response *smithyhttp.Response case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("InvalidAccessException", errorCode): - return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -8526,14 +8887,14 @@ func awsRestjson1_deserializeOpErrorUpdateFindings(response *smithyhttp.Response } } -type awsRestjson1_deserializeOpUpdateInsight struct { +type awsRestjson1_deserializeOpUntagResource struct { } -func (*awsRestjson1_deserializeOpUpdateInsight) ID() string { +func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -8547,15 +8908,15 @@ func (m *awsRestjson1_deserializeOpUpdateInsight) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateInsight(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } - output := &UpdateInsightOutput{} + output := &UntagResourceOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -8599,15 +8960,9 @@ func awsRestjson1_deserializeOpErrorUpdateInsight(response *smithyhttp.Response, case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("InvalidAccessException", errorCode): - return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -8621,14 +8976,14 @@ func awsRestjson1_deserializeOpErrorUpdateInsight(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateOrganizationConfiguration struct { +type awsRestjson1_deserializeOpUpdateActionTarget struct { } -func (*awsRestjson1_deserializeOpUpdateOrganizationConfiguration) ID() string { +func (*awsRestjson1_deserializeOpUpdateActionTarget) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8642,15 +8997,15 @@ func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateActionTarget(response, &metadata) } - output := &UpdateOrganizationConfigurationOutput{} + output := &UpdateActionTargetOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8700,8 +9055,8 @@ func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *sm case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8713,14 +9068,14 @@ func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *sm } } -type awsRestjson1_deserializeOpUpdateSecurityHubConfiguration struct { +type awsRestjson1_deserializeOpUpdateFindingAggregator struct { } -func (*awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) ID() string { +func (*awsRestjson1_deserializeOpUpdateFindingAggregator) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateFindingAggregator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8734,15 +9089,43 @@ func (m *awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateSecurityHubConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateFindingAggregator(response, &metadata) } - output := &UpdateSecurityHubConfigurationOutput{} + output := &UpdateFindingAggregatorOutput{} 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_deserializeOpDocumentUpdateFindingAggregatorOutput(&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_deserializeOpErrorUpdateSecurityHubConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateFindingAggregator(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8783,6 +9166,9 @@ func awsRestjson1_deserializeOpErrorUpdateSecurityHubConfiguration(response *smi } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -8808,14 +9194,77 @@ func awsRestjson1_deserializeOpErrorUpdateSecurityHubConfiguration(response *smi } } -type awsRestjson1_deserializeOpUpdateStandardsControl struct { +func awsRestjson1_deserializeOpDocumentUpdateFindingAggregatorOutput(v **UpdateFindingAggregatorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateFindingAggregatorOutput + if *v == nil { + sv = &UpdateFindingAggregatorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FindingAggregationRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FindingAggregationRegion = ptr.String(jtv) + } + + case "FindingAggregatorArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FindingAggregatorArn = ptr.String(jtv) + } + + case "RegionLinkingMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RegionLinkingMode = ptr.String(jtv) + } + + case "Regions": + if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateStandardsControl) ID() string { +type awsRestjson1_deserializeOpUpdateFindings struct { +} + +func (*awsRestjson1_deserializeOpUpdateFindings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateStandardsControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8829,15 +9278,15 @@ func (m *awsRestjson1_deserializeOpUpdateStandardsControl) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateStandardsControl(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateFindings(response, &metadata) } - output := &UpdateStandardsControlOutput{} + output := &UpdateFindingsOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateStandardsControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8887,6 +9336,9 @@ func awsRestjson1_deserializeOpErrorUpdateStandardsControl(response *smithyhttp. case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -8900,44 +9352,418 @@ func awsRestjson1_deserializeOpErrorUpdateStandardsControl(response *smithyhttp. } } -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 - } +type awsRestjson1_deserializeOpUpdateInsight struct { +} - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) +func (*awsRestjson1_deserializeOpUpdateInsight) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpUpdateInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - - return output -} + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } -func awsRestjson1_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalException{} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateInsight(response, &metadata) + } + output := &UpdateInsightOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateOrganizationConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateOrganizationConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response, &metadata) + } + output := &UpdateOrganizationConfigurationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateSecurityHubConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) HandleDeserialize(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_deserializeOpErrorUpdateSecurityHubConfiguration(response, &metadata) + } + output := &UpdateSecurityHubConfigurationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSecurityHubConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateStandardsControl struct { +} + +func (*awsRestjson1_deserializeOpUpdateStandardsControl) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateStandardsControl) HandleDeserialize(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_deserializeOpErrorUpdateStandardsControl(response, &metadata) + } + output := &UpdateStandardsControlOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateStandardsControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +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_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -9261,6 +10087,40 @@ func awsRestjson1_deserializeDocumentAction(v **types.Action, value interface{}) return nil } +func awsRestjson1_deserializeDocumentActionList(v *[]types.AutomationRulesAction, 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.AutomationRulesAction + if *v == nil { + cv = []types.AutomationRulesAction{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AutomationRulesAction + destAddr := &col + if err := awsRestjson1_deserializeDocumentAutomationRulesAction(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentActionLocalIpDetails(v **types.ActionLocalIpDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9682,78 +10542,827 @@ func awsRestjson1_deserializeDocumentAdminAccount(v **types.AdminAccount, value sv.Status = types.AdminStatus(jtv) } - default: - _, _ = key, value + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAdminAccounts(v *[]types.AdminAccount, 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.AdminAccount + if *v == nil { + cv = []types.AdminAccount{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AdminAccount + destAddr := &col + if err := awsRestjson1_deserializeDocumentAdminAccount(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssociatedStandard(v **types.AssociatedStandard, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AssociatedStandard + if *v == nil { + sv = &types.AssociatedStandard{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "StandardsId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.StandardsId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssociatedStandardsList(v *[]types.AssociatedStandard, 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.AssociatedStandard + if *v == nil { + cv = []types.AssociatedStandard{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssociatedStandard + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssociatedStandard(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssociationSetDetails(v **types.AssociationSetDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AssociationSetDetails + if *v == nil { + sv = &types.AssociationSetDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssociationState": + if err := awsRestjson1_deserializeDocumentAssociationStateDetails(&sv.AssociationState, value); err != nil { + return err + } + + case "GatewayId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.GatewayId = ptr.String(jtv) + } + + case "Main": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Main = jtv + } + + case "RouteTableAssociationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RouteTableAssociationId = ptr.String(jtv) + } + + case "RouteTableId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RouteTableId = ptr.String(jtv) + } + + case "SubnetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SubnetId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssociationSetList(v *[]types.AssociationSetDetails, 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.AssociationSetDetails + if *v == nil { + cv = []types.AssociationSetDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssociationSetDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssociationSetDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssociationStateDetails(v **types.AssociationStateDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AssociationStateDetails + if *v == nil { + sv = &types.AssociationStateDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutomationRulesAction(v **types.AutomationRulesAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AutomationRulesAction + if *v == nil { + sv = &types.AutomationRulesAction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FindingFieldsUpdate": + if err := awsRestjson1_deserializeDocumentAutomationRulesFindingFieldsUpdate(&sv.FindingFieldsUpdate, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutomationRulesActionType to be of type string, got %T instead", value) + } + sv.Type = types.AutomationRulesActionType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutomationRulesArnsList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAutomationRulesConfig(v **types.AutomationRulesConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AutomationRulesConfig + if *v == nil { + sv = &types.AutomationRulesConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Actions": + if err := awsRestjson1_deserializeDocumentActionList(&sv.Actions, value); err != nil { + return err + } + + case "CreatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "CreatedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "Criteria": + if err := awsRestjson1_deserializeDocumentAutomationRulesFindingFilters(&sv.Criteria, value); err != nil { + return err + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "IsTerminal": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsTerminal = jtv + } + + case "RuleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleArn = ptr.String(jtv) + } + + case "RuleName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleName = ptr.String(jtv) + } + + case "RuleOrder": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RuleOrderValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RuleOrder = int32(i64) + } + + case "RuleStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleStatus to be of type string, got %T instead", value) + } + sv.RuleStatus = types.RuleStatus(jtv) + } + + case "UpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutomationRulesConfigList(v *[]types.AutomationRulesConfig, 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.AutomationRulesConfig + if *v == nil { + cv = []types.AutomationRulesConfig{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AutomationRulesConfig + destAddr := &col + if err := awsRestjson1_deserializeDocumentAutomationRulesConfig(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAutomationRulesFindingFieldsUpdate(v **types.AutomationRulesFindingFieldsUpdate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AutomationRulesFindingFieldsUpdate + if *v == nil { + sv = &types.AutomationRulesFindingFieldsUpdate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Confidence": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RatioScale to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Confidence = int32(i64) + } + + case "Criticality": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RatioScale to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Criticality = int32(i64) + } + + case "Note": + if err := awsRestjson1_deserializeDocumentNoteUpdate(&sv.Note, value); err != nil { + return err + } + + case "RelatedFindings": + if err := awsRestjson1_deserializeDocumentRelatedFindingList(&sv.RelatedFindings, value); err != nil { + return err + } + + case "Severity": + if err := awsRestjson1_deserializeDocumentSeverityUpdate(&sv.Severity, value); err != nil { + return err + } + + case "Types": + if err := awsRestjson1_deserializeDocumentTypeList(&sv.Types, value); err != nil { + return err + } + + case "UserDefinedFields": + if err := awsRestjson1_deserializeDocumentFieldMap(&sv.UserDefinedFields, value); err != nil { + return err + } + + case "VerificationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VerificationState to be of type string, got %T instead", value) + } + sv.VerificationState = types.VerificationState(jtv) + } + + case "Workflow": + if err := awsRestjson1_deserializeDocumentWorkflowUpdate(&sv.Workflow, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutomationRulesFindingFilters(v **types.AutomationRulesFindingFilters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AutomationRulesFindingFilters + if *v == nil { + sv = &types.AutomationRulesFindingFilters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AwsAccountId": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.AwsAccountId, value); err != nil { + return err + } + + case "CompanyName": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.CompanyName, value); err != nil { + return err + } + + case "ComplianceAssociatedStandardsId": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceAssociatedStandardsId, value); err != nil { + return err + } + + case "ComplianceSecurityControlId": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceSecurityControlId, value); err != nil { + return err + } + + case "ComplianceStatus": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceStatus, value); err != nil { + return err + } + + case "Confidence": + if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.Confidence, value); err != nil { + return err + } + + case "CreatedAt": + if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.CreatedAt, value); err != nil { + return err + } + + case "Criticality": + if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.Criticality, value); err != nil { + return err + } + + case "Description": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Description, value); err != nil { + return err + } + + case "FirstObservedAt": + if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.FirstObservedAt, value); err != nil { + return err + } + + case "GeneratorId": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.GeneratorId, value); err != nil { + return err + } + + case "Id": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Id, value); err != nil { + return err + } + + case "LastObservedAt": + if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.LastObservedAt, value); err != nil { + return err + } + + case "NoteText": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NoteText, value); err != nil { + return err + } + + case "NoteUpdatedAt": + if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.NoteUpdatedAt, value); err != nil { + return err + } + + case "NoteUpdatedBy": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NoteUpdatedBy, value); err != nil { + return err + } + + case "ProductArn": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProductArn, value); err != nil { + return err + } + + case "ProductName": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProductName, value); err != nil { + return err + } + + case "RecordState": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RecordState, value); err != nil { + return err + } + + case "RelatedFindingsId": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedFindingsId, value); err != nil { + return err + } + + case "RelatedFindingsProductArn": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedFindingsProductArn, value); err != nil { + return err + } + + case "ResourceDetailsOther": + if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ResourceDetailsOther, value); err != nil { + return err + } + + case "ResourceId": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceId, value); err != nil { + return err + } + + case "ResourcePartition": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourcePartition, value); err != nil { + return err + } - } - } - *v = sv - return nil -} + case "ResourceRegion": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceRegion, value); err != nil { + return err + } -func awsRestjson1_deserializeDocumentAdminAccounts(v *[]types.AdminAccount, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "ResourceTags": + if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ResourceTags, value); err != nil { + return err + } - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "ResourceType": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceType, value); err != nil { + return err + } - var cv []types.AdminAccount - if *v == nil { - cv = []types.AdminAccount{} - } else { - cv = *v - } + case "SeverityLabel": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.SeverityLabel, value); err != nil { + return err + } - for _, value := range shape { - var col types.AdminAccount - destAddr := &col - if err := awsRestjson1_deserializeDocumentAdminAccount(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + case "SourceUrl": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.SourceUrl, value); err != nil { + return err + } - } - *v = cv - return nil -} + case "Title": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Title, value); err != nil { + return err + } -func awsRestjson1_deserializeDocumentAssociatedStandard(v **types.AssociatedStandard, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "Type": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Type, value); err != nil { + return err + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "UpdatedAt": + if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.UpdatedAt, value); err != nil { + return err + } - var sv *types.AssociatedStandard - if *v == nil { - sv = &types.AssociatedStandard{} - } else { - sv = *v - } + case "UserDefinedFields": + if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.UserDefinedFields, value); err != nil { + return err + } - for key, value := range shape { - switch key { - case "StandardsId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.StandardsId = ptr.String(jtv) + case "VerificationState": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VerificationState, value); err != nil { + return err + } + + case "WorkflowStatus": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.WorkflowStatus, value); err != nil { + return err } default: @@ -9765,41 +11374,7 @@ func awsRestjson1_deserializeDocumentAssociatedStandard(v **types.AssociatedStan return nil } -func awsRestjson1_deserializeDocumentAssociatedStandardsList(v *[]types.AssociatedStandard, 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.AssociatedStandard - if *v == nil { - cv = []types.AssociatedStandard{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AssociatedStandard - destAddr := &col - if err := awsRestjson1_deserializeDocumentAssociatedStandard(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAssociationSetDetails(v **types.AssociationSetDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAutomationRulesMetadata(v **types.AutomationRulesMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9812,63 +11387,106 @@ func awsRestjson1_deserializeDocumentAssociationSetDetails(v **types.Association return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssociationSetDetails + var sv *types.AutomationRulesMetadata if *v == nil { - sv = &types.AssociationSetDetails{} + sv = &types.AutomationRulesMetadata{} } else { sv = *v } for key, value := range shape { switch key { - case "AssociationState": - if err := awsRestjson1_deserializeDocumentAssociationStateDetails(&sv.AssociationState, value); err != nil { - return err + case "CreatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) } - case "GatewayId": + case "CreatedBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.GatewayId = ptr.String(jtv) + sv.CreatedBy = ptr.String(jtv) } - case "Main": + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "IsTerminal": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.Main = jtv + sv.IsTerminal = jtv } - case "RouteTableAssociationId": + case "RuleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.RouteTableAssociationId = ptr.String(jtv) + sv.RuleArn = ptr.String(jtv) } - case "RouteTableId": + case "RuleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.RouteTableId = ptr.String(jtv) + sv.RuleName = ptr.String(jtv) } - case "SubnetId": + case "RuleOrder": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RuleOrderValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RuleOrder = int32(i64) + } + + case "RuleStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected RuleStatus to be of type string, got %T instead", value) } - sv.SubnetId = ptr.String(jtv) + sv.RuleStatus = types.RuleStatus(jtv) + } + + case "UpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) } default: @@ -9880,7 +11498,7 @@ func awsRestjson1_deserializeDocumentAssociationSetDetails(v **types.Association return nil } -func awsRestjson1_deserializeDocumentAssociationSetList(v *[]types.AssociationSetDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAutomationRulesMetadataList(v *[]types.AutomationRulesMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9893,17 +11511,17 @@ func awsRestjson1_deserializeDocumentAssociationSetList(v *[]types.AssociationSe return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssociationSetDetails + var cv []types.AutomationRulesMetadata if *v == nil { - cv = []types.AssociationSetDetails{} + cv = []types.AutomationRulesMetadata{} } else { cv = *v } for _, value := range shape { - var col types.AssociationSetDetails + var col types.AutomationRulesMetadata destAddr := &col - if err := awsRestjson1_deserializeDocumentAssociationSetDetails(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAutomationRulesMetadata(&destAddr, value); err != nil { return err } col = *destAddr @@ -9914,55 +11532,6 @@ func awsRestjson1_deserializeDocumentAssociationSetList(v *[]types.AssociationSe return nil } -func awsRestjson1_deserializeDocumentAssociationStateDetails(v **types.AssociationStateDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", 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.AssociationStateDetails - if *v == nil { - sv = &types.AssociationStateDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "State": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.State = ptr.String(jtv) - } - - case "StatusMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.StatusMessage = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsRestjson1_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -51974,6 +53543,55 @@ func awsRestjson1_deserializeDocumentNote(v **types.Note, value interface{}) err return nil } +func awsRestjson1_deserializeDocumentNoteUpdate(v **types.NoteUpdate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NoteUpdate + if *v == nil { + sv = &types.NoteUpdate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + case "UpdatedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.UpdatedBy = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentNumberFilter(v **types.NumberFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -56295,6 +57913,93 @@ func awsRestjson1_deserializeDocumentSeverity(v **types.Severity, value interfac return nil } +func awsRestjson1_deserializeDocumentSeverityUpdate(v **types.SeverityUpdate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SeverityUpdate + if *v == nil { + sv = &types.SeverityUpdate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Label": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SeverityLabel to be of type string, got %T instead", value) + } + sv.Label = types.SeverityLabel(jtv) + } + + case "Normalized": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RatioScale to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Normalized = int32(i64) + } + + case "Product": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Product = 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.Product = 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_deserializeDocumentSoftwarePackage(v **types.SoftwarePackage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -58036,6 +59741,102 @@ func awsRestjson1_deserializeDocumentTypeList(v *[]string, value interface{}) er return nil } +func awsRestjson1_deserializeDocumentUnprocessedAutomationRule(v **types.UnprocessedAutomationRule, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.UnprocessedAutomationRule + if *v == nil { + sv = &types.UnprocessedAutomationRule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + 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.ErrorCode = int32(i64) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "RuleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnprocessedAutomationRulesList(v *[]types.UnprocessedAutomationRule, 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.UnprocessedAutomationRule + if *v == nil { + cv = []types.UnprocessedAutomationRule{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.UnprocessedAutomationRule + destAddr := &col + if err := awsRestjson1_deserializeDocumentUnprocessedAutomationRule(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentUnprocessedSecurityControl(v **types.UnprocessedSecurityControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -58970,3 +60771,43 @@ func awsRestjson1_deserializeDocumentWorkflow(v **types.Workflow, value interfac *v = sv return nil } + +func awsRestjson1_deserializeDocumentWorkflowUpdate(v **types.WorkflowUpdate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.WorkflowUpdate + if *v == nil { + sv = &types.WorkflowUpdate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStatus to be of type string, got %T instead", value) + } + sv.Status = types.WorkflowStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/securityhub/generated.json b/service/securityhub/generated.json index c51949c0e10..17287bc3196 100644 --- a/service/securityhub/generated.json +++ b/service/securityhub/generated.json @@ -10,14 +10,18 @@ "api_client_test.go", "api_op_AcceptAdministratorInvitation.go", "api_op_AcceptInvitation.go", + "api_op_BatchDeleteAutomationRules.go", "api_op_BatchDisableStandards.go", "api_op_BatchEnableStandards.go", + "api_op_BatchGetAutomationRules.go", "api_op_BatchGetSecurityControls.go", "api_op_BatchGetStandardsControlAssociations.go", "api_op_BatchImportFindings.go", + "api_op_BatchUpdateAutomationRules.go", "api_op_BatchUpdateFindings.go", "api_op_BatchUpdateStandardsControlAssociations.go", "api_op_CreateActionTarget.go", + "api_op_CreateAutomationRule.go", "api_op_CreateFindingAggregator.go", "api_op_CreateInsight.go", "api_op_CreateMembers.go", @@ -53,6 +57,7 @@ "api_op_GetMasterAccount.go", "api_op_GetMembers.go", "api_op_InviteMembers.go", + "api_op_ListAutomationRules.go", "api_op_ListEnabledProductsForImport.go", "api_op_ListFindingAggregators.go", "api_op_ListInvitations.go", diff --git a/service/securityhub/serializers.go b/service/securityhub/serializers.go index 10fa7a45b1f..e3300fb414d 100644 --- a/service/securityhub/serializers.go +++ b/service/securityhub/serializers.go @@ -162,6 +162,76 @@ func awsRestjson1_serializeOpDocumentAcceptInvitationInput(v *AcceptInvitationIn return nil } +type awsRestjson1_serializeOpBatchDeleteAutomationRules struct { +} + +func (*awsRestjson1_serializeOpBatchDeleteAutomationRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchDeleteAutomationRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchDeleteAutomationRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/automationrules/delete") + 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_serializeOpDocumentBatchDeleteAutomationRulesInput(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_serializeOpHttpBindingsBatchDeleteAutomationRulesInput(v *BatchDeleteAutomationRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchDeleteAutomationRulesInput(v *BatchDeleteAutomationRulesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutomationRulesArns != nil { + ok := object.Key("AutomationRulesArns") + if err := awsRestjson1_serializeDocumentAutomationRulesArnsList(v.AutomationRulesArns, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpBatchDisableStandards struct { } @@ -302,6 +372,76 @@ func awsRestjson1_serializeOpDocumentBatchEnableStandardsInput(v *BatchEnableSta return nil } +type awsRestjson1_serializeOpBatchGetAutomationRules struct { +} + +func (*awsRestjson1_serializeOpBatchGetAutomationRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchGetAutomationRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetAutomationRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/automationrules/get") + 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_serializeOpDocumentBatchGetAutomationRulesInput(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_serializeOpHttpBindingsBatchGetAutomationRulesInput(v *BatchGetAutomationRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchGetAutomationRulesInput(v *BatchGetAutomationRulesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutomationRulesArns != nil { + ok := object.Key("AutomationRulesArns") + if err := awsRestjson1_serializeDocumentAutomationRulesArnsList(v.AutomationRulesArns, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpBatchGetSecurityControls struct { } @@ -512,6 +652,76 @@ func awsRestjson1_serializeOpDocumentBatchImportFindingsInput(v *BatchImportFind return nil } +type awsRestjson1_serializeOpBatchUpdateAutomationRules struct { +} + +func (*awsRestjson1_serializeOpBatchUpdateAutomationRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchUpdateAutomationRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchUpdateAutomationRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/automationrules/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchUpdateAutomationRulesInput(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_serializeOpHttpBindingsBatchUpdateAutomationRulesInput(v *BatchUpdateAutomationRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchUpdateAutomationRulesInput(v *BatchUpdateAutomationRulesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.UpdateAutomationRulesRequestItems != nil { + ok := object.Key("UpdateAutomationRulesRequestItems") + if err := awsRestjson1_serializeDocumentUpdateAutomationRulesRequestItemsList(v.UpdateAutomationRulesRequestItems, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpBatchUpdateFindings struct { } @@ -787,14 +997,14 @@ func awsRestjson1_serializeOpDocumentCreateActionTargetInput(v *CreateActionTarg return nil } -type awsRestjson1_serializeOpCreateFindingAggregator struct { +type awsRestjson1_serializeOpCreateAutomationRule struct { } -func (*awsRestjson1_serializeOpCreateFindingAggregator) ID() string { +func (*awsRestjson1_serializeOpCreateAutomationRule) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateFindingAggregator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateAutomationRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -802,13 +1012,13 @@ func (m *awsRestjson1_serializeOpCreateFindingAggregator) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateFindingAggregatorInput) + input, ok := in.Parameters.(*CreateAutomationRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/findingAggregator/create") + opPath, opQuery := httpbinding.SplitURI("/automationrules/create") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -820,7 +1030,7 @@ func (m *awsRestjson1_serializeOpCreateFindingAggregator) HandleSerialize(ctx co restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateFindingAggregatorInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentCreateAutomationRuleInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -835,7 +1045,7 @@ func (m *awsRestjson1_serializeOpCreateFindingAggregator) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateFindingAggregatorInput(v *CreateFindingAggregatorInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateAutomationRuleInput(v *CreateAutomationRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -843,18 +1053,52 @@ func awsRestjson1_serializeOpHttpBindingsCreateFindingAggregatorInput(v *CreateF return nil } -func awsRestjson1_serializeOpDocumentCreateFindingAggregatorInput(v *CreateFindingAggregatorInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateAutomationRuleInput(v *CreateAutomationRuleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.RegionLinkingMode != nil { - ok := object.Key("RegionLinkingMode") - ok.String(*v.RegionLinkingMode) + if v.Actions != nil { + ok := object.Key("Actions") + if err := awsRestjson1_serializeDocumentActionList(v.Actions, ok); err != nil { + return err + } } - if v.Regions != nil { - ok := object.Key("Regions") - if err := awsRestjson1_serializeDocumentStringList(v.Regions, ok); err != nil { + if v.Criteria != nil { + ok := object.Key("Criteria") + if err := awsRestjson1_serializeDocumentAutomationRulesFindingFilters(v.Criteria, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.IsTerminal { + ok := object.Key("IsTerminal") + ok.Boolean(v.IsTerminal) + } + + if v.RuleName != nil { + ok := object.Key("RuleName") + ok.String(*v.RuleName) + } + + { + ok := object.Key("RuleOrder") + ok.Integer(v.RuleOrder) + } + + if len(v.RuleStatus) > 0 { + ok := object.Key("RuleStatus") + ok.String(string(v.RuleStatus)) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } @@ -862,14 +1106,14 @@ func awsRestjson1_serializeOpDocumentCreateFindingAggregatorInput(v *CreateFindi return nil } -type awsRestjson1_serializeOpCreateInsight struct { +type awsRestjson1_serializeOpCreateFindingAggregator struct { } -func (*awsRestjson1_serializeOpCreateInsight) ID() string { +func (*awsRestjson1_serializeOpCreateFindingAggregator) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateInsight) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateFindingAggregator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -877,13 +1121,13 @@ func (m *awsRestjson1_serializeOpCreateInsight) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateInsightInput) + input, ok := in.Parameters.(*CreateFindingAggregatorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/insights") + opPath, opQuery := httpbinding.SplitURI("/findingAggregator/create") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -895,7 +1139,7 @@ func (m *awsRestjson1_serializeOpCreateInsight) HandleSerialize(ctx context.Cont restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateInsightInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentCreateFindingAggregatorInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -910,7 +1154,7 @@ func (m *awsRestjson1_serializeOpCreateInsight) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateInsightInput(v *CreateInsightInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateFindingAggregatorInput(v *CreateFindingAggregatorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -918,25 +1162,100 @@ func awsRestjson1_serializeOpHttpBindingsCreateInsightInput(v *CreateInsightInpu return nil } -func awsRestjson1_serializeOpDocumentCreateInsightInput(v *CreateInsightInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateFindingAggregatorInput(v *CreateFindingAggregatorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Filters != nil { - ok := object.Key("Filters") - if err := awsRestjson1_serializeDocumentAwsSecurityFindingFilters(v.Filters, ok); err != nil { - return err - } - } - - if v.GroupByAttribute != nil { - ok := object.Key("GroupByAttribute") - ok.String(*v.GroupByAttribute) + if v.RegionLinkingMode != nil { + ok := object.Key("RegionLinkingMode") + ok.String(*v.RegionLinkingMode) } - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) + if v.Regions != nil { + ok := object.Key("Regions") + if err := awsRestjson1_serializeDocumentStringList(v.Regions, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateInsight struct { +} + +func (*awsRestjson1_serializeOpCreateInsight) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateInsight) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateInsightInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/insights") + 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_serializeOpDocumentCreateInsightInput(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_serializeOpHttpBindingsCreateInsightInput(v *CreateInsightInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateInsightInput(v *CreateInsightInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentAwsSecurityFindingFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.GroupByAttribute != nil { + ok := object.Key("GroupByAttribute") + ok.String(*v.GroupByAttribute) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) } return nil @@ -3033,6 +3352,63 @@ func awsRestjson1_serializeOpDocumentInviteMembersInput(v *InviteMembersInput, v return nil } +type awsRestjson1_serializeOpListAutomationRules struct { +} + +func (*awsRestjson1_serializeOpListAutomationRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAutomationRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAutomationRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/automationrules/list") + 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_serializeOpHttpBindingsListAutomationRulesInput(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_serializeOpHttpBindingsListAutomationRulesInput(v *ListAutomationRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListEnabledProductsForImport struct { } @@ -4303,6 +4679,19 @@ func awsRestjson1_serializeDocumentAction(v *types.Action, value smithyjson.Valu return nil } +func awsRestjson1_serializeDocumentActionList(v []types.AutomationRulesAction, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAutomationRulesAction(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentActionLocalIpDetails(v *types.ActionLocalIpDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4343,182 +4732,528 @@ func awsRestjson1_serializeDocumentActionRemoteIpDetails(v *types.ActionRemoteIp } } - if v.Country != nil { - ok := object.Key("Country") - if err := awsRestjson1_serializeDocumentCountry(v.Country, ok); err != nil { + if v.Country != nil { + ok := object.Key("Country") + if err := awsRestjson1_serializeDocumentCountry(v.Country, ok); err != nil { + return err + } + } + + if v.GeoLocation != nil { + ok := object.Key("GeoLocation") + if err := awsRestjson1_serializeDocumentGeoLocation(v.GeoLocation, ok); err != nil { + return err + } + } + + if v.IpAddressV4 != nil { + ok := object.Key("IpAddressV4") + ok.String(*v.IpAddressV4) + } + + if v.Organization != nil { + ok := object.Key("Organization") + if err := awsRestjson1_serializeDocumentIpOrganizationDetails(v.Organization, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentActionRemotePortDetails(v *types.ActionRemotePortDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Port != 0 { + ok := object.Key("Port") + ok.Integer(v.Port) + } + + if v.PortName != nil { + ok := object.Key("PortName") + ok.String(*v.PortName) + } + + return nil +} + +func awsRestjson1_serializeDocumentAdjustment(v *types.Adjustment, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Metric != nil { + ok := object.Key("Metric") + ok.String(*v.Metric) + } + + if v.Reason != nil { + ok := object.Key("Reason") + ok.String(*v.Reason) + } + + return nil +} + +func awsRestjson1_serializeDocumentAdjustmentList(v []types.Adjustment, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAdjustment(&v[i], av); err != nil { + return err + } + } + 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_serializeDocumentAssociatedStandard(v *types.AssociatedStandard, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StandardsId != nil { + ok := object.Key("StandardsId") + ok.String(*v.StandardsId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAssociatedStandardsList(v []types.AssociatedStandard, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAssociatedStandard(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAssociationSetDetails(v *types.AssociationSetDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssociationState != nil { + ok := object.Key("AssociationState") + if err := awsRestjson1_serializeDocumentAssociationStateDetails(v.AssociationState, ok); err != nil { + return err + } + } + + if v.GatewayId != nil { + ok := object.Key("GatewayId") + ok.String(*v.GatewayId) + } + + if v.Main { + ok := object.Key("Main") + ok.Boolean(v.Main) + } + + if v.RouteTableAssociationId != nil { + ok := object.Key("RouteTableAssociationId") + ok.String(*v.RouteTableAssociationId) + } + + if v.RouteTableId != nil { + ok := object.Key("RouteTableId") + ok.String(*v.RouteTableId) + } + + if v.SubnetId != nil { + ok := object.Key("SubnetId") + ok.String(*v.SubnetId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAssociationSetList(v []types.AssociationSetDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAssociationSetDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAssociationStateDetails(v *types.AssociationStateDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.State != nil { + ok := object.Key("State") + ok.String(*v.State) + } + + if v.StatusMessage != nil { + ok := object.Key("StatusMessage") + ok.String(*v.StatusMessage) + } + + return nil +} + +func awsRestjson1_serializeDocumentAutomationRulesAction(v *types.AutomationRulesAction, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FindingFieldsUpdate != nil { + ok := object.Key("FindingFieldsUpdate") + if err := awsRestjson1_serializeDocumentAutomationRulesFindingFieldsUpdate(v.FindingFieldsUpdate, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentAutomationRulesArnsList(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_serializeDocumentAutomationRulesFindingFieldsUpdate(v *types.AutomationRulesFindingFieldsUpdate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Confidence != 0 { + ok := object.Key("Confidence") + ok.Integer(v.Confidence) + } + + if v.Criticality != 0 { + ok := object.Key("Criticality") + ok.Integer(v.Criticality) + } + + if v.Note != nil { + ok := object.Key("Note") + if err := awsRestjson1_serializeDocumentNoteUpdate(v.Note, ok); err != nil { + return err + } + } + + if v.RelatedFindings != nil { + ok := object.Key("RelatedFindings") + if err := awsRestjson1_serializeDocumentRelatedFindingList(v.RelatedFindings, ok); err != nil { + return err + } + } + + if v.Severity != nil { + ok := object.Key("Severity") + if err := awsRestjson1_serializeDocumentSeverityUpdate(v.Severity, ok); err != nil { + return err + } + } + + if v.Types != nil { + ok := object.Key("Types") + if err := awsRestjson1_serializeDocumentTypeList(v.Types, ok); err != nil { + return err + } + } + + if v.UserDefinedFields != nil { + ok := object.Key("UserDefinedFields") + if err := awsRestjson1_serializeDocumentFieldMap(v.UserDefinedFields, ok); err != nil { + return err + } + } + + if len(v.VerificationState) > 0 { + ok := object.Key("VerificationState") + ok.String(string(v.VerificationState)) + } + + if v.Workflow != nil { + ok := object.Key("Workflow") + if err := awsRestjson1_serializeDocumentWorkflowUpdate(v.Workflow, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAutomationRulesFindingFilters(v *types.AutomationRulesFindingFilters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwsAccountId != nil { + ok := object.Key("AwsAccountId") + if err := awsRestjson1_serializeDocumentStringFilterList(v.AwsAccountId, ok); err != nil { + return err + } + } + + if v.CompanyName != nil { + ok := object.Key("CompanyName") + if err := awsRestjson1_serializeDocumentStringFilterList(v.CompanyName, ok); err != nil { + return err + } + } + + if v.ComplianceAssociatedStandardsId != nil { + ok := object.Key("ComplianceAssociatedStandardsId") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ComplianceAssociatedStandardsId, ok); err != nil { + return err + } + } + + if v.ComplianceSecurityControlId != nil { + ok := object.Key("ComplianceSecurityControlId") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ComplianceSecurityControlId, ok); err != nil { + return err + } + } + + if v.ComplianceStatus != nil { + ok := object.Key("ComplianceStatus") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ComplianceStatus, ok); err != nil { + return err + } + } + + if v.Confidence != nil { + ok := object.Key("Confidence") + if err := awsRestjson1_serializeDocumentNumberFilterList(v.Confidence, ok); err != nil { + return err + } + } + + if v.CreatedAt != nil { + ok := object.Key("CreatedAt") + if err := awsRestjson1_serializeDocumentDateFilterList(v.CreatedAt, ok); err != nil { + return err + } + } + + if v.Criticality != nil { + ok := object.Key("Criticality") + if err := awsRestjson1_serializeDocumentNumberFilterList(v.Criticality, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("Description") + if err := awsRestjson1_serializeDocumentStringFilterList(v.Description, ok); err != nil { + return err + } + } + + if v.FirstObservedAt != nil { + ok := object.Key("FirstObservedAt") + if err := awsRestjson1_serializeDocumentDateFilterList(v.FirstObservedAt, ok); err != nil { + return err + } + } + + if v.GeneratorId != nil { + ok := object.Key("GeneratorId") + if err := awsRestjson1_serializeDocumentStringFilterList(v.GeneratorId, ok); err != nil { + return err + } + } + + if v.Id != nil { + ok := object.Key("Id") + if err := awsRestjson1_serializeDocumentStringFilterList(v.Id, ok); err != nil { + return err + } + } + + if v.LastObservedAt != nil { + ok := object.Key("LastObservedAt") + if err := awsRestjson1_serializeDocumentDateFilterList(v.LastObservedAt, ok); err != nil { + return err + } + } + + if v.NoteText != nil { + ok := object.Key("NoteText") + if err := awsRestjson1_serializeDocumentStringFilterList(v.NoteText, ok); err != nil { + return err + } + } + + if v.NoteUpdatedAt != nil { + ok := object.Key("NoteUpdatedAt") + if err := awsRestjson1_serializeDocumentDateFilterList(v.NoteUpdatedAt, ok); err != nil { + return err + } + } + + if v.NoteUpdatedBy != nil { + ok := object.Key("NoteUpdatedBy") + if err := awsRestjson1_serializeDocumentStringFilterList(v.NoteUpdatedBy, ok); err != nil { return err } } - if v.GeoLocation != nil { - ok := object.Key("GeoLocation") - if err := awsRestjson1_serializeDocumentGeoLocation(v.GeoLocation, ok); err != nil { + if v.ProductArn != nil { + ok := object.Key("ProductArn") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ProductArn, ok); err != nil { return err } } - if v.IpAddressV4 != nil { - ok := object.Key("IpAddressV4") - ok.String(*v.IpAddressV4) - } - - if v.Organization != nil { - ok := object.Key("Organization") - if err := awsRestjson1_serializeDocumentIpOrganizationDetails(v.Organization, ok); err != nil { + if v.ProductName != nil { + ok := object.Key("ProductName") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ProductName, ok); err != nil { return err } } - return nil -} - -func awsRestjson1_serializeDocumentActionRemotePortDetails(v *types.ActionRemotePortDetails, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Port != 0 { - ok := object.Key("Port") - ok.Integer(v.Port) + if v.RecordState != nil { + ok := object.Key("RecordState") + if err := awsRestjson1_serializeDocumentStringFilterList(v.RecordState, ok); err != nil { + return err + } } - if v.PortName != nil { - ok := object.Key("PortName") - ok.String(*v.PortName) + if v.RelatedFindingsId != nil { + ok := object.Key("RelatedFindingsId") + if err := awsRestjson1_serializeDocumentStringFilterList(v.RelatedFindingsId, ok); err != nil { + return err + } } - return nil -} - -func awsRestjson1_serializeDocumentAdjustment(v *types.Adjustment, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Metric != nil { - ok := object.Key("Metric") - ok.String(*v.Metric) + if v.RelatedFindingsProductArn != nil { + ok := object.Key("RelatedFindingsProductArn") + if err := awsRestjson1_serializeDocumentStringFilterList(v.RelatedFindingsProductArn, ok); err != nil { + return err + } } - if v.Reason != nil { - ok := object.Key("Reason") - ok.String(*v.Reason) + if v.ResourceDetailsOther != nil { + ok := object.Key("ResourceDetailsOther") + if err := awsRestjson1_serializeDocumentMapFilterList(v.ResourceDetailsOther, ok); err != nil { + return err + } } - return nil -} - -func awsRestjson1_serializeDocumentAdjustmentList(v []types.Adjustment, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentAdjustment(&v[i], av); err != nil { + if v.ResourceId != nil { + ok := object.Key("ResourceId") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ResourceId, ok); err != nil { return err } } - 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]) + if v.ResourcePartition != nil { + ok := object.Key("ResourcePartition") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ResourcePartition, ok); err != nil { + return err + } } - return nil -} - -func awsRestjson1_serializeDocumentAssociatedStandard(v *types.AssociatedStandard, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - if v.StandardsId != nil { - ok := object.Key("StandardsId") - ok.String(*v.StandardsId) + if v.ResourceRegion != nil { + ok := object.Key("ResourceRegion") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ResourceRegion, ok); err != nil { + return err + } } - return nil -} - -func awsRestjson1_serializeDocumentAssociatedStandardsList(v []types.AssociatedStandard, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentAssociatedStandard(&v[i], av); err != nil { + if v.ResourceTags != nil { + ok := object.Key("ResourceTags") + if err := awsRestjson1_serializeDocumentMapFilterList(v.ResourceTags, ok); err != nil { return err } } - return nil -} - -func awsRestjson1_serializeDocumentAssociationSetDetails(v *types.AssociationSetDetails, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - if v.AssociationState != nil { - ok := object.Key("AssociationState") - if err := awsRestjson1_serializeDocumentAssociationStateDetails(v.AssociationState, ok); err != nil { + if v.ResourceType != nil { + ok := object.Key("ResourceType") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ResourceType, ok); err != nil { return err } } - if v.GatewayId != nil { - ok := object.Key("GatewayId") - ok.String(*v.GatewayId) + if v.SeverityLabel != nil { + ok := object.Key("SeverityLabel") + if err := awsRestjson1_serializeDocumentStringFilterList(v.SeverityLabel, ok); err != nil { + return err + } } - if v.Main { - ok := object.Key("Main") - ok.Boolean(v.Main) + if v.SourceUrl != nil { + ok := object.Key("SourceUrl") + if err := awsRestjson1_serializeDocumentStringFilterList(v.SourceUrl, ok); err != nil { + return err + } } - if v.RouteTableAssociationId != nil { - ok := object.Key("RouteTableAssociationId") - ok.String(*v.RouteTableAssociationId) + if v.Title != nil { + ok := object.Key("Title") + if err := awsRestjson1_serializeDocumentStringFilterList(v.Title, ok); err != nil { + return err + } } - if v.RouteTableId != nil { - ok := object.Key("RouteTableId") - ok.String(*v.RouteTableId) + if v.Type != nil { + ok := object.Key("Type") + if err := awsRestjson1_serializeDocumentStringFilterList(v.Type, ok); err != nil { + return err + } } - if v.SubnetId != nil { - ok := object.Key("SubnetId") - ok.String(*v.SubnetId) + if v.UpdatedAt != nil { + ok := object.Key("UpdatedAt") + if err := awsRestjson1_serializeDocumentDateFilterList(v.UpdatedAt, ok); err != nil { + return err + } } - return nil -} - -func awsRestjson1_serializeDocumentAssociationSetList(v []types.AssociationSetDetails, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentAssociationSetDetails(&v[i], av); err != nil { + if v.UserDefinedFields != nil { + ok := object.Key("UserDefinedFields") + if err := awsRestjson1_serializeDocumentMapFilterList(v.UserDefinedFields, ok); err != nil { return err } } - return nil -} - -func awsRestjson1_serializeDocumentAssociationStateDetails(v *types.AssociationStateDetails, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - if v.State != nil { - ok := object.Key("State") - ok.String(*v.State) + if v.VerificationState != nil { + ok := object.Key("VerificationState") + if err := awsRestjson1_serializeDocumentStringFilterList(v.VerificationState, ok); err != nil { + return err + } } - if v.StatusMessage != nil { - ok := object.Key("StatusMessage") - ok.String(*v.StatusMessage) + if v.WorkflowStatus != nil { + ok := object.Key("WorkflowStatus") + if err := awsRestjson1_serializeDocumentStringFilterList(v.WorkflowStatus, ok); err != nil { + return err + } } return nil @@ -26052,6 +26787,70 @@ func awsRestjson1_serializeDocumentTypeList(v []string, value smithyjson.Value) return nil } +func awsRestjson1_serializeDocumentUpdateAutomationRulesRequestItem(v *types.UpdateAutomationRulesRequestItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Actions != nil { + ok := object.Key("Actions") + if err := awsRestjson1_serializeDocumentActionList(v.Actions, ok); err != nil { + return err + } + } + + if v.Criteria != nil { + ok := object.Key("Criteria") + if err := awsRestjson1_serializeDocumentAutomationRulesFindingFilters(v.Criteria, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.IsTerminal { + ok := object.Key("IsTerminal") + ok.Boolean(v.IsTerminal) + } + + if v.RuleArn != nil { + ok := object.Key("RuleArn") + ok.String(*v.RuleArn) + } + + if v.RuleName != nil { + ok := object.Key("RuleName") + ok.String(*v.RuleName) + } + + if v.RuleOrder != 0 { + ok := object.Key("RuleOrder") + ok.Integer(v.RuleOrder) + } + + if len(v.RuleStatus) > 0 { + ok := object.Key("RuleStatus") + ok.String(string(v.RuleStatus)) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdateAutomationRulesRequestItemsList(v []types.UpdateAutomationRulesRequestItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentUpdateAutomationRulesRequestItem(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentVolumeMount(v *types.VolumeMount, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/securityhub/types/enums.go b/service/securityhub/types/enums.go index 01e5067e981..9b7cd04d55d 100644 --- a/service/securityhub/types/enums.go +++ b/service/securityhub/types/enums.go @@ -56,6 +56,22 @@ func (AutoEnableStandards) Values() []AutoEnableStandards { } } +type AutomationRulesActionType string + +// Enum values for AutomationRulesActionType +const ( + AutomationRulesActionTypeFindingFieldsUpdate AutomationRulesActionType = "FINDING_FIELDS_UPDATE" +) + +// Values returns all known values for AutomationRulesActionType. 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 (AutomationRulesActionType) Values() []AutomationRulesActionType { + return []AutomationRulesActionType{ + "FINDING_FIELDS_UPDATE", + } +} + type AwsIamAccessKeyStatus string // Enum values for AwsIamAccessKeyStatus @@ -362,6 +378,24 @@ func (RegionAvailabilityStatus) Values() []RegionAvailabilityStatus { } } +type RuleStatus string + +// Enum values for RuleStatus +const ( + RuleStatusEnabled RuleStatus = "ENABLED" + RuleStatusDisabled RuleStatus = "DISABLED" +) + +// Values returns all known values for RuleStatus. 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 (RuleStatus) Values() []RuleStatus { + return []RuleStatus{ + "ENABLED", + "DISABLED", + } +} + type SeverityLabel string // Enum values for SeverityLabel diff --git a/service/securityhub/types/types.go b/service/securityhub/types/types.go index 5c64080c8ac..e70dc67237f 100644 --- a/service/securityhub/types/types.go +++ b/service/securityhub/types/types.go @@ -212,6 +212,316 @@ type AssociationStateDetails struct { noSmithyDocumentSerde } +// One or more actions to update finding fields if a finding matches the defined +// criteria of the rule. +type AutomationRulesAction struct { + + // Specifies that the automation rule action is an update to a finding field. + FindingFieldsUpdate *AutomationRulesFindingFieldsUpdate + + // Specifies that the rule action should update the Types finding field. The Types + // finding field provides one or more finding types in the format of + // namespace/category/classifier that classify a finding. For more information, see + // Types taxonomy for ASFF (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format-type-taxonomy.html) + // in the Security Hub User Guide. + Type AutomationRulesActionType + + noSmithyDocumentSerde +} + +// Defines the configuration of an automation rule. +type AutomationRulesConfig struct { + + // One or more actions to update finding fields if a finding matches the defined + // criteria of the rule. + Actions []AutomationRulesAction + + // A timestamp that indicates when the rule was created. Uses the date-time format + // specified in RFC 3339 section 5.6, Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6) + // . The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z . + CreatedAt *time.Time + + // The principal that created a rule. + CreatedBy *string + + // A set of Amazon Web Services Security Finding Format (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html) + // finding field attributes and corresponding expected values that Security Hub + // uses to filter findings. If a finding matches the conditions specified in this + // parameter, Security Hub applies the rule action to the finding. + Criteria *AutomationRulesFindingFilters + + // A description of the rule. + Description *string + + // Specifies whether a rule is the last to be applied with respect to a finding + // that matches the rule criteria. This is useful when a finding matches the + // criteria for multiple rules, and each rule has different actions. If the value + // of this field is set to true for a rule, Security Hub applies the rule action + // to a finding that matches the rule criteria and won't evaluate other rules for + // the finding.
 The default value of this field is false . + IsTerminal bool + + // The Amazon Resource Name (ARN) of a rule. + RuleArn *string + + // The name of the rule. + RuleName *string + + // An integer ranging from 1 to 1000 that represents the order in which the rule + // action is applied to findings. Security Hub applies rules with lower values for + // this parameter first. + RuleOrder int32 + + // Whether the rule is active after it is created. If this parameter is equal to + // >ENABLED , Security Hub will apply the rule to findings and finding updates + // after the rule is created. + RuleStatus RuleStatus + + // A timestamp that indicates when the rule was most recently updated. Uses the + // date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6) + // . The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z . + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Identifies the finding fields that the automation rule action will update when +// a finding matches the defined criteria. +type AutomationRulesFindingFieldsUpdate struct { + + // The rule action will update the Confidence field of a finding. + Confidence int32 + + // The rule action will update the Criticality field of a finding. + Criticality int32 + + // The updated note. + Note *NoteUpdate + + // A list of findings that are related to a finding. + RelatedFindings []RelatedFinding + + // Updates to the severity information for a finding. + Severity *SeverityUpdate + + // The rule action will update the Types field of a finding. + Types []string + + // The rule action will update the UserDefinedFields field of a finding. + UserDefinedFields map[string]string + + // The rule action will update the VerificationState field of a finding. + VerificationState VerificationState + + // Used to update information about the investigation into the finding. + Workflow *WorkflowUpdate + + noSmithyDocumentSerde +} + +// The criteria that determine which findings a rule applies to. +type AutomationRulesFindingFilters struct { + + // The Amazon Web Services account ID in which a finding was generated. + AwsAccountId []StringFilter + + // The name of the company for the product that generated the finding. For + // control-based findings, the company is Amazon Web Services. + CompanyName []StringFilter + + // The unique identifier of a standard in which a control is enabled. This field + // consists of the resource portion of the Amazon Resource Name (ARN) returned for + // a standard in the DescribeStandards (https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_DescribeStandards.html) + // API response. + ComplianceAssociatedStandardsId []StringFilter + + // The security control ID for which a finding was generated. Security control IDs + // are the same across standards. + ComplianceSecurityControlId []StringFilter + + // The result of a security check. This field is only used for findings generated + // from controls. + ComplianceStatus []StringFilter + + // The likelihood that a finding accurately identifies the behavior or issue that + // it was intended to identify. Confidence is scored on a 0–100 basis using a + // ratio scale. A value of 0 means 0 percent confidence, and a value of 100 means + // 100 percent confidence. For example, a data exfiltration detection based on a + // statistical deviation of network traffic has low confidence because an actual + // exfiltration hasn't been verified. For more information, see Confidence (https://docs.aws.amazon.com/securityhub/latest/userguide/asff-top-level-attributes.html#asff-confidence) + // in the Security Hub User Guide. + Confidence []NumberFilter + + // A timestamp that indicates when this finding record was created. Uses the + // date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6) + // . The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z . + CreatedAt []DateFilter + + // The level of importance that is assigned to the resources that are associated + // with a finding. Criticality is scored on a 0–100 basis, using a ratio scale + // that supports only full integers. A score of 0 means that the underlying + // resources have no criticality, and a score of 100 is reserved for the most + // critical resources. For more information, see Criticality (https://docs.aws.amazon.com/securityhub/latest/userguide/asff-top-level-attributes.html#asff-criticality) + // in the Security Hub User Guide. + Criticality []NumberFilter + + // A finding's description. + Description []StringFilter + + // A timestamp that indicates when the potential security issue captured by a + // finding was first observed by the security findings product. Uses the date-time + // format specified in RFC 3339 section 5.6, Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6) + // . The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z . + FirstObservedAt []DateFilter + + // The identifier for the solution-specific component that generated a finding. + GeneratorId []StringFilter + + // The product-specific identifier for a finding. + Id []StringFilter + + // A timestamp that indicates when the potential security issue captured by a + // finding was most recently observed by the security findings product. Uses the + // date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6) + // . The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z . + LastObservedAt []DateFilter + + // The text of a user-defined note that's added to a finding. + NoteText []StringFilter + + // The timestamp of when the note was updated. Uses the date-time format specified + // in RFC 3339 section 5.6, Internet Date/Time Format (https://www.rfc-editor.org/rfc/rfc3339#section-5.6) + // . The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z . + NoteUpdatedAt []DateFilter + + // The principal that created a note. + NoteUpdatedBy []StringFilter + + // The Amazon Resource Name (ARN) for a third-party product that generated a + // finding in Security Hub. + ProductArn []StringFilter + + // Provides the name of the product that generated the finding. For control-based + // findings, the product name is Security Hub. + ProductName []StringFilter + + // Provides the current state of a finding. + RecordState []StringFilter + + // The product-generated identifier for a related finding. + RelatedFindingsId []StringFilter + + // The ARN for the product that generated a related finding. + RelatedFindingsProductArn []StringFilter + + // Custom fields and values about the resource that a finding pertains to. + ResourceDetailsOther []MapFilter + + // The identifier for the given resource type. For Amazon Web Services resources + // that are identified by Amazon Resource Names (ARNs), this is the ARN. For Amazon + // Web Services resources that lack ARNs, this is the identifier as defined by the + // Amazon Web Service that created the resource. For non-Amazon Web Services + // resources, this is a unique identifier that is associated with the resource. + ResourceId []StringFilter + + // The partition in which the resource that the finding pertains to is located. A + // partition is a group of Amazon Web Services Regions. Each Amazon Web Services + // account is scoped to one partition. + ResourcePartition []StringFilter + + // The Amazon Web Services Region where the resource that a finding pertains to is + // located. + ResourceRegion []StringFilter + + // A list of Amazon Web Services tags associated with a resource at the time the + // finding was processed. + ResourceTags []MapFilter + + // The type of resource that the finding pertains to. + ResourceType []StringFilter + + // The severity value of the finding. + SeverityLabel []StringFilter + + // Provides a URL that links to a page about the current finding in the finding + // product. + SourceUrl []StringFilter + + // A finding's title. + Title []StringFilter + + // One or more finding types in the format of namespace/category/classifier that + // classify a finding. For a list of namespaces, classifiers, and categories, see + // Types taxonomy for ASFF (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format-type-taxonomy.html) + // in the Security Hub User Guide. + Type []StringFilter + + // A timestamp that indicates when the finding record was most recently updated. + // Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time + // Format (https://tools.ietf.org/html/rfc3339#section-5.6) . The value cannot + // contain spaces. For example, 2020-03-22T13:22:13.933Z . + UpdatedAt []DateFilter + + // A list of user-defined name and value string pairs added to a finding. + UserDefinedFields []MapFilter + + // Provides the veracity of a finding. + VerificationState []StringFilter + + // Provides information about the status of the investigation into a finding. + WorkflowStatus []StringFilter + + noSmithyDocumentSerde +} + +// Metadata for automation rules in the calling account. The response includes +// rules with a RuleStatus of ENABLED and DISABLED . +type AutomationRulesMetadata struct { + + // A timestamp that indicates when the rule was created. Uses the date-time format + // specified in RFC 3339 section 5.6, Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6) + // . The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z . + CreatedAt *time.Time + + // The principal that created a rule. + CreatedBy *string + + // A description of the rule. + Description *string + + // Specifies whether a rule is the last to be applied with respect to a finding + // that matches the rule criteria. This is useful when a finding matches the + // criteria for multiple rules, and each rule has different actions. If the value + // of this field is set to true for a rule, Security Hub applies the rule action + // to a finding that matches the rule criteria and won't evaluate other rules for + // the finding.
 The default value of this field is false . + IsTerminal bool + + // The Amazon Resource Name (ARN) for the rule. + RuleArn *string + + // The name of the rule. + RuleName *string + + // An integer ranging from 1 to 1000 that represents the order in which the rule + // action is applied to findings. Security Hub applies rules with lower values for + // this parameter first. + RuleOrder int32 + + // Whether the rule is active after it is created. If this parameter is equal to + // ENABLED , Security Hub will apply the rule to findings and finding updates after + // the rule is created. To change the value of this parameter after creating a + // rule, use BatchUpdateAutomationRules . + RuleStatus RuleStatus + + // A timestamp that indicates when the rule was most recently updated. Uses the + // date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format (https://tools.ietf.org/html/rfc3339#section-5.6) + // . The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z . + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + // Information about an Availability Zone. type AvailabilityZone struct { @@ -14412,6 +14722,22 @@ type ThreatIntelIndicator struct { noSmithyDocumentSerde } +// A list of objects containing RuleArn , ErrorCode , and ErrorMessage . This +// parameter tells you which automation rules the request didn't process and why. +type UnprocessedAutomationRule struct { + + // The error code associated with the unprocessed automation rule. + ErrorCode int32 + + // An error message describing why a request didn't process a specific rule. + ErrorMessage *string + + // The Amazon Resource Name (ARN) for the unprocessed automation rule. + RuleArn *string + + noSmithyDocumentSerde +} + // Provides details about a security control for which a response couldn't be // returned. type UnprocessedSecurityControl struct { @@ -14484,6 +14810,52 @@ type UnprocessedStandardsControlAssociationUpdate struct { noSmithyDocumentSerde } +// Specifies the parameters to update in an existing automation rule. +type UpdateAutomationRulesRequestItem struct { + + // The Amazon Resource Name (ARN) for the rule. + // + // This member is required. + RuleArn *string + + // One or more actions to update finding fields if a finding matches the + // conditions specified in Criteria . + Actions []AutomationRulesAction + + // A set of ASFF finding field attributes and corresponding expected values that + // Security Hub uses to filter findings. If a finding matches the conditions + // specified in this parameter, Security Hub applies the rule action to the + // finding. + Criteria *AutomationRulesFindingFilters + + // A description of the rule. + Description *string + + // Specifies whether a rule is the last to be applied with respect to a finding + // that matches the rule criteria. This is useful when a finding matches the + // criteria for multiple rules, and each rule has different actions. If the value + // of this field is set to true for a rule, Security Hub applies the rule action + // to a finding that matches the rule criteria and won't evaluate other rules for + // the finding.
 The default value of this field is false . + IsTerminal bool + + // The name of the rule. + RuleName *string + + // An integer ranging from 1 to 1000 that represents the order in which the rule + // action is applied to findings. Security Hub applies rules with lower values for + // this parameter first. + RuleOrder int32 + + // Whether the rule is active after it is created. If this parameter is equal to + // ENABLED , Security Hub will apply the rule to findings and finding updates after + // the rule is created. To change the value of this parameter after creating a + // rule, use BatchUpdateAutomationRules . + RuleStatus RuleStatus + + noSmithyDocumentSerde +} + // Describes the mounting of a volume in a container. type VolumeMount struct { diff --git a/service/securityhub/validators.go b/service/securityhub/validators.go index 26891243b30..2f47902e560 100644 --- a/service/securityhub/validators.go +++ b/service/securityhub/validators.go @@ -50,6 +50,26 @@ func (m *validateOpAcceptInvitation) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpBatchDeleteAutomationRules struct { +} + +func (*validateOpBatchDeleteAutomationRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchDeleteAutomationRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchDeleteAutomationRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchDeleteAutomationRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpBatchDisableStandards struct { } @@ -90,6 +110,26 @@ func (m *validateOpBatchEnableStandards) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpBatchGetAutomationRules struct { +} + +func (*validateOpBatchGetAutomationRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchGetAutomationRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchGetAutomationRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchGetAutomationRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpBatchGetSecurityControls struct { } @@ -150,6 +190,26 @@ func (m *validateOpBatchImportFindings) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpBatchUpdateAutomationRules struct { +} + +func (*validateOpBatchUpdateAutomationRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchUpdateAutomationRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchUpdateAutomationRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchUpdateAutomationRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpBatchUpdateFindings struct { } @@ -210,6 +270,26 @@ func (m *validateOpCreateActionTarget) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpCreateAutomationRule struct { +} + +func (*validateOpCreateAutomationRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAutomationRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAutomationRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAutomationRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateFindingAggregator struct { } @@ -818,6 +898,10 @@ func addOpAcceptInvitationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAcceptInvitation{}, middleware.After) } +func addOpBatchDeleteAutomationRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchDeleteAutomationRules{}, middleware.After) +} + func addOpBatchDisableStandardsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchDisableStandards{}, middleware.After) } @@ -826,6 +910,10 @@ func addOpBatchEnableStandardsValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpBatchEnableStandards{}, middleware.After) } +func addOpBatchGetAutomationRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchGetAutomationRules{}, middleware.After) +} + func addOpBatchGetSecurityControlsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchGetSecurityControls{}, middleware.After) } @@ -838,6 +926,10 @@ func addOpBatchImportFindingsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpBatchImportFindings{}, middleware.After) } +func addOpBatchUpdateAutomationRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchUpdateAutomationRules{}, middleware.After) +} + func addOpBatchUpdateFindingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchUpdateFindings{}, middleware.After) } @@ -850,6 +942,10 @@ func addOpCreateActionTargetValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpCreateActionTarget{}, middleware.After) } +func addOpCreateAutomationRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAutomationRule{}, middleware.After) +} + func addOpCreateFindingAggregatorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateFindingAggregator{}, middleware.After) } @@ -1002,6 +1098,62 @@ func validateAccountDetailsList(v []types.AccountDetails) error { } } +func validateActionList(v []types.AutomationRulesAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActionList"} + for i := range v { + if err := validateAutomationRulesAction(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAutomationRulesAction(v *types.AutomationRulesAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AutomationRulesAction"} + if v.FindingFieldsUpdate != nil { + if err := validateAutomationRulesFindingFieldsUpdate(v.FindingFieldsUpdate); err != nil { + invalidParams.AddNested("FindingFieldsUpdate", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAutomationRulesFindingFieldsUpdate(v *types.AutomationRulesFindingFieldsUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AutomationRulesFindingFieldsUpdate"} + if v.Note != nil { + if err := validateNoteUpdate(v.Note); err != nil { + invalidParams.AddNested("Note", err.(smithy.InvalidParamsError)) + } + } + if v.RelatedFindings != nil { + if err := validateRelatedFindingList(v.RelatedFindings); err != nil { + invalidParams.AddNested("RelatedFindings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAwsSecurityFinding(v *types.AwsSecurityFinding) error { if v == nil { return nil @@ -1462,6 +1614,43 @@ func validateStatusReasonsList(v []types.StatusReason) error { } } +func validateUpdateAutomationRulesRequestItem(v *types.UpdateAutomationRulesRequestItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAutomationRulesRequestItem"} + if v.RuleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleArn")) + } + if v.Actions != nil { + if err := validateActionList(v.Actions); err != nil { + invalidParams.AddNested("Actions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdateAutomationRulesRequestItemsList(v []types.UpdateAutomationRulesRequestItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAutomationRulesRequestItemsList"} + for i := range v { + if err := validateUpdateAutomationRulesRequestItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateVulnerability(v *types.Vulnerability) error { if v == nil { return nil @@ -1550,6 +1739,21 @@ func validateOpAcceptInvitationInput(v *AcceptInvitationInput) error { } } +func validateOpBatchDeleteAutomationRulesInput(v *BatchDeleteAutomationRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteAutomationRulesInput"} + if v.AutomationRulesArns == nil { + invalidParams.Add(smithy.NewErrParamRequired("AutomationRulesArns")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpBatchDisableStandardsInput(v *BatchDisableStandardsInput) error { if v == nil { return nil @@ -1584,6 +1788,21 @@ func validateOpBatchEnableStandardsInput(v *BatchEnableStandardsInput) error { } } +func validateOpBatchGetAutomationRulesInput(v *BatchGetAutomationRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetAutomationRulesInput"} + if v.AutomationRulesArns == nil { + invalidParams.Add(smithy.NewErrParamRequired("AutomationRulesArns")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpBatchGetSecurityControlsInput(v *BatchGetSecurityControlsInput) error { if v == nil { return nil @@ -1637,6 +1856,25 @@ func validateOpBatchImportFindingsInput(v *BatchImportFindingsInput) error { } } +func validateOpBatchUpdateAutomationRulesInput(v *BatchUpdateAutomationRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchUpdateAutomationRulesInput"} + if v.UpdateAutomationRulesRequestItems == nil { + invalidParams.Add(smithy.NewErrParamRequired("UpdateAutomationRulesRequestItems")) + } else if v.UpdateAutomationRulesRequestItems != nil { + if err := validateUpdateAutomationRulesRequestItemsList(v.UpdateAutomationRulesRequestItems); err != nil { + invalidParams.AddNested("UpdateAutomationRulesRequestItems", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpBatchUpdateFindingsInput(v *BatchUpdateFindingsInput) error { if v == nil { return nil @@ -1706,6 +1944,34 @@ func validateOpCreateActionTargetInput(v *CreateActionTargetInput) error { } } +func validateOpCreateAutomationRuleInput(v *CreateAutomationRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAutomationRuleInput"} + if v.RuleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleName")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if v.Criteria == nil { + invalidParams.Add(smithy.NewErrParamRequired("Criteria")) + } + if v.Actions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Actions")) + } else if v.Actions != nil { + if err := validateActionList(v.Actions); err != nil { + invalidParams.AddNested("Actions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateFindingAggregatorInput(v *CreateFindingAggregatorInput) error { if v == nil { return nil diff --git a/service/simspaceweaver/api_op_CreateSnapshot.go b/service/simspaceweaver/api_op_CreateSnapshot.go index 11a70ac9900..8a926875448 100644 --- a/service/simspaceweaver/api_op_CreateSnapshot.go +++ b/service/simspaceweaver/api_op_CreateSnapshot.go @@ -48,7 +48,8 @@ func (c *Client) CreateSnapshot(ctx context.Context, params *CreateSnapshotInput type CreateSnapshotInput struct { // The Amazon S3 bucket and optional folder (object key prefix) where SimSpace - // Weaver creates the snapshot file. + // Weaver creates the snapshot file. The Amazon S3 bucket must be in the same + // Amazon Web Services Region as the simulation. // // This member is required. Destination *types.S3Destination diff --git a/service/simspaceweaver/api_op_StartSimulation.go b/service/simspaceweaver/api_op_StartSimulation.go index 146bc81fa40..267fe93961d 100644 --- a/service/simspaceweaver/api_op_StartSimulation.go +++ b/service/simspaceweaver/api_op_StartSimulation.go @@ -76,8 +76,10 @@ type StartSimulationInput struct { // The location of the snapshot .zip file in Amazon Simple Storage Service (Amazon // S3). For more information about Amazon S3, see the Amazon Simple Storage // Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) - // . Provide a SnapshotS3Location to start your simulation from a snapshot. If you - // provide a SnapshotS3Location then you can't provide a SchemaS3Location . + // . Provide a SnapshotS3Location to start your simulation from a snapshot. The + // Amazon S3 bucket must be in the same Amazon Web Services Region as the + // simulation. If you provide a SnapshotS3Location then you can't provide a + // SchemaS3Location . SnapshotS3Location *types.S3Location // A list of tags for the simulation. For more information about tags, see Tagging diff --git a/service/verifiedpermissions/LICENSE.txt b/service/verifiedpermissions/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/verifiedpermissions/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/verifiedpermissions/api_client.go b/service/verifiedpermissions/api_client.go new file mode 100644 index 00000000000..5efe08e1d80 --- /dev/null +++ b/service/verifiedpermissions/api_client.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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 = "VerifiedPermissions" +const ServiceAPIVersion = "2021-12-01" + +// Client provides the API client to make operations call for Amazon Verified +// Permissions. +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, "verifiedpermissions", 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) +} diff --git a/service/verifiedpermissions/api_client_test.go b/service/verifiedpermissions/api_client_test.go new file mode 100644 index 00000000000..13f125ca103 --- /dev/null +++ b/service/verifiedpermissions/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/verifiedpermissions/api_op_CreateIdentitySource.go b/service/verifiedpermissions/api_op_CreateIdentitySource.go new file mode 100644 index 00000000000..7115b8cfd9c --- /dev/null +++ b/service/verifiedpermissions/api_op_CreateIdentitySource.go @@ -0,0 +1,222 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a reference to an Amazon Cognito user pool as an external identity +// provider (IdP). After you create an identity source, you can use the identities +// provided by the IdP as proxies for the principal in authorization queries that +// use the IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// operation. These identities take the form of tokens that contain claims about +// the user, such as IDs, attributes and group memberships. Amazon Cognito provides +// both identity tokens and access tokens, and Verified Permissions can use either +// or both. Any combination of identity and access tokens results in the same Cedar +// principal. Verified Permissions automatically translates the information about +// the identities into the standard Cedar attributes that can be evaluated by your +// policies. Because the Amazon Cognito identity and access tokens can contain +// different information, the tokens you choose to use determine which principal +// attributes are available to access when evaluating Cedar policies. If you delete +// a Amazon Cognito user pool or user, tokens from that deleted pool or that +// deleted user continue to be usable until they expire. To reference a user from +// this identity source in your Cedar policies, use the following syntax. +// IdentityType::"| Where IdentityType +// is the string that you provide to the PrincipalEntityType parameter for this +// operation. The CognitoUserPoolId and CognitoClientId are defined by the Amazon +// Cognito user pool. +func (c *Client) CreateIdentitySource(ctx context.Context, params *CreateIdentitySourceInput, optFns ...func(*Options)) (*CreateIdentitySourceOutput, error) { + if params == nil { + params = &CreateIdentitySourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateIdentitySource", params, optFns, c.addOperationCreateIdentitySourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateIdentitySourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateIdentitySourceInput struct { + + // Specifies the details required to communicate with the identity provider (IdP) + // associated with this identity source. At this time, the only valid member of + // this structure is a Amazon Cognito user pool configuration. You must specify a + // UserPoolArn , and optionally, a ClientId . + // + // This member is required. + Configuration types.Configuration + + // Specifies the ID of the policy store in which you want to store this identity + // source. Only policies and requests made using this policy store can reference + // identities from the identity provider configured in the new identity source. + // + // This member is required. + PolicyStoreId *string + + // Specifies a unique, case-sensitive ID that you provide to ensure the + // idempotency of the request. This lets you safely retry the request without + // accidentally performing the same operation a second time. Passing the same value + // to a later call to an operation requires that you also pass the same value for + // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_Id) + // . If you don't provide this value, then Amazon Web Services generates a random + // one for you. If you retry the operation with the same ClientToken , but with + // different parameters, the retry fails with an IdempotentParameterMismatch error. + ClientToken *string + + // Specifies the namespace and data type of the principals generated for + // identities authenticated by the new identity source. + PrincipalEntityType *string + + noSmithyDocumentSerde +} + +type CreateIdentitySourceOutput struct { + + // The date and time the identity source was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The unique ID of the new identity source. + // + // This member is required. + IdentitySourceId *string + + // The date and time the identity source was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy store that contains the identity source. + // + // This member is required. + PolicyStoreId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateIdentitySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateIdentitySource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateIdentitySource{}, 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_opCreateIdentitySourceMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateIdentitySourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIdentitySource(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_initializeOpCreateIdentitySource struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateIdentitySource) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateIdentitySource) 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.(*CreateIdentitySourceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIdentitySourceInput ") + } + + 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_opCreateIdentitySourceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIdentitySource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateIdentitySource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "CreateIdentitySource", + } +} diff --git a/service/verifiedpermissions/api_op_CreatePolicy.go b/service/verifiedpermissions/api_op_CreatePolicy.go new file mode 100644 index 00000000000..1d710752ef6 --- /dev/null +++ b/service/verifiedpermissions/api_op_CreatePolicy.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a Cedar policy and saves it in the specified policy store. You can +// create either a static policy or a policy linked to a policy template. +// - To create a static policy, provide the Cedar policy text in the StaticPolicy +// section of the PolicyDefinition . +// - To create a policy that is dynamically linked to a policy template, specify +// the policy template ID and the principal and resource to associate with this +// policy in the templateLinked section of the PolicyDefinition . If the policy +// template is ever updated, any policies linked to the policy template +// automatically use the updated template. +// +// Creating a policy causes it to be validated against the schema in the policy +// store. If the policy doesn't pass validation, the operation fails and the policy +// isn't stored. +func (c *Client) CreatePolicy(ctx context.Context, params *CreatePolicyInput, optFns ...func(*Options)) (*CreatePolicyOutput, error) { + if params == nil { + params = &CreatePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePolicy", params, optFns, c.addOperationCreatePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePolicyInput struct { + + // A structure that specifies the policy type and content to use for the new + // policy. You must include either a static or a templateLinked element. The policy + // content must be written in the Cedar policy language. + // + // This member is required. + Definition types.PolicyDefinition + + // Specifies the PolicyStoreId of the policy store you want to store the policy in. + // + // This member is required. + PolicyStoreId *string + + // Specifies a unique, case-sensitive ID that you provide to ensure the + // idempotency of the request. This lets you safely retry the request without + // accidentally performing the same operation a second time. Passing the same value + // to a later call to an operation requires that you also pass the same value for + // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_Id) + // . If you don't provide this value, then Amazon Web Services generates a random + // one for you. If you retry the operation with the same ClientToken , but with + // different parameters, the retry fails with an IdempotentParameterMismatch error. + ClientToken *string + + noSmithyDocumentSerde +} + +type CreatePolicyOutput struct { + + // The date and time the policy was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time the policy was last updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The unique ID of the new policy. + // + // This member is required. + PolicyId *string + + // The ID of the policy store that contains the new policy. + // + // This member is required. + PolicyStoreId *string + + // The policy type of the new policy. + // + // This member is required. + PolicyType types.PolicyType + + // The principal specified in the new policy's scope. This response element isn't + // present when principal isn't specified in the policy content. + Principal *types.EntityIdentifier + + // The resource specified in the new policy's scope. This response element isn't + // present when the resource isn't specified in the policy content. + Resource *types.EntityIdentifier + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreatePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreatePolicy{}, 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_opCreatePolicyMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreatePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePolicy(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_initializeOpCreatePolicy struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreatePolicy) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreatePolicy) 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.(*CreatePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePolicyInput ") + } + + 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_opCreatePolicyMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreatePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "CreatePolicy", + } +} diff --git a/service/verifiedpermissions/api_op_CreatePolicyStore.go b/service/verifiedpermissions/api_op_CreatePolicyStore.go new file mode 100644 index 00000000000..b10161bc37b --- /dev/null +++ b/service/verifiedpermissions/api_op_CreatePolicyStore.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a policy store. A policy store is a container for policy resources. +func (c *Client) CreatePolicyStore(ctx context.Context, params *CreatePolicyStoreInput, optFns ...func(*Options)) (*CreatePolicyStoreOutput, error) { + if params == nil { + params = &CreatePolicyStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePolicyStore", params, optFns, c.addOperationCreatePolicyStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePolicyStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePolicyStoreInput struct { + + // Specifies the validation setting for this policy store. Currently, the only + // valid and required value is Mode . We recommend that you turn on STRICT mode + // only after you define a schema. If a schema doesn't exist, then STRICT mode + // causes any policy to fail validation, and Verified Permissions rejects the + // policy. You can turn off validation by using the UpdatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) + // . Then, when you have a schema defined, use UpdatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) + // again to turn validation back on. + // + // This member is required. + ValidationSettings *types.ValidationSettings + + // Specifies a unique, case-sensitive ID that you provide to ensure the + // idempotency of the request. This lets you safely retry the request without + // accidentally performing the same operation a second time. Passing the same value + // to a later call to an operation requires that you also pass the same value for + // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_Id) + // . If you don't provide this value, then Amazon Web Services generates a random + // one for you. If you retry the operation with the same ClientToken , but with + // different parameters, the retry fails with an IdempotentParameterMismatch error. + ClientToken *string + + noSmithyDocumentSerde +} + +type CreatePolicyStoreOutput struct { + + // The Amazon Resource Name (ARN) of the new policy store. + // + // This member is required. + Arn *string + + // The date and time the policy store was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time the policy store was last updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The unique ID of the new policy store. + // + // This member is required. + PolicyStoreId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePolicyStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreatePolicyStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreatePolicyStore{}, 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_opCreatePolicyStoreMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreatePolicyStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePolicyStore(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_initializeOpCreatePolicyStore struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreatePolicyStore) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreatePolicyStore) 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.(*CreatePolicyStoreInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePolicyStoreInput ") + } + + 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_opCreatePolicyStoreMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePolicyStore{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreatePolicyStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "CreatePolicyStore", + } +} diff --git a/service/verifiedpermissions/api_op_CreatePolicyTemplate.go b/service/verifiedpermissions/api_op_CreatePolicyTemplate.go new file mode 100644 index 00000000000..1c160b87042 --- /dev/null +++ b/service/verifiedpermissions/api_op_CreatePolicyTemplate.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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" + "time" +) + +// Creates a policy template. A template can use placeholders for the principal +// and resource. A template must be instantiated into a policy by associating it +// with specific principals and resources to use for the placeholders. That +// instantiated policy can then be considered in authorization decisions. The +// instantiated policy works identically to any other policy, except that it is +// dynamically linked to the template. If the template changes, then any policies +// that are linked to that template are immediately updated as well. +func (c *Client) CreatePolicyTemplate(ctx context.Context, params *CreatePolicyTemplateInput, optFns ...func(*Options)) (*CreatePolicyTemplateOutput, error) { + if params == nil { + params = &CreatePolicyTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePolicyTemplate", params, optFns, c.addOperationCreatePolicyTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePolicyTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePolicyTemplateInput struct { + + // The ID of the policy store in which to create the policy template. + // + // This member is required. + PolicyStoreId *string + + // Specifies the content that you want to use for the new policy template, written + // in the Cedar policy language. + // + // This member is required. + Statement *string + + // Specifies a unique, case-sensitive ID that you provide to ensure the + // idempotency of the request. This lets you safely retry the request without + // accidentally performing the same operation a second time. Passing the same value + // to a later call to an operation requires that you also pass the same value for + // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_Id) + // . If you don't provide this value, then Amazon Web Services generates a random + // one for you. If you retry the operation with the same ClientToken , but with + // different parameters, the retry fails with an IdempotentParameterMismatch error. + ClientToken *string + + // Specifies a description for the policy template. + Description *string + + noSmithyDocumentSerde +} + +type CreatePolicyTemplateOutput struct { + + // The date and time the policy template was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time the policy template was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy store that contains the policy template. + // + // This member is required. + PolicyStoreId *string + + // The unique ID of the new policy template. + // + // This member is required. + PolicyTemplateId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePolicyTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreatePolicyTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreatePolicyTemplate{}, 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_opCreatePolicyTemplateMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreatePolicyTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePolicyTemplate(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_initializeOpCreatePolicyTemplate struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreatePolicyTemplate) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreatePolicyTemplate) 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.(*CreatePolicyTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePolicyTemplateInput ") + } + + 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_opCreatePolicyTemplateMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePolicyTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreatePolicyTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "CreatePolicyTemplate", + } +} diff --git a/service/verifiedpermissions/api_op_DeleteIdentitySource.go b/service/verifiedpermissions/api_op_DeleteIdentitySource.go new file mode 100644 index 00000000000..68d3ae69238 --- /dev/null +++ b/service/verifiedpermissions/api_op_DeleteIdentitySource.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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 an identity source that references an identity provider (IdP) such as +// Amazon Cognito. After you delete the identity source, you can no longer use +// tokens for identities from that identity source to represent principals in +// authorization queries made using IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// . operations. +func (c *Client) DeleteIdentitySource(ctx context.Context, params *DeleteIdentitySourceInput, optFns ...func(*Options)) (*DeleteIdentitySourceOutput, error) { + if params == nil { + params = &DeleteIdentitySourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIdentitySource", params, optFns, c.addOperationDeleteIdentitySourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIdentitySourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteIdentitySourceInput struct { + + // Specifies the ID of the identity source that you want to delete. + // + // This member is required. + IdentitySourceId *string + + // Specifies the ID of the policy store that contains the identity source that you + // want to delete. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type DeleteIdentitySourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIdentitySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteIdentitySource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteIdentitySource{}, 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 = addOpDeleteIdentitySourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIdentitySource(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_opDeleteIdentitySource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "DeleteIdentitySource", + } +} diff --git a/service/verifiedpermissions/api_op_DeletePolicy.go b/service/verifiedpermissions/api_op_DeletePolicy.go new file mode 100644 index 00000000000..31ee9b18dc1 --- /dev/null +++ b/service/verifiedpermissions/api_op_DeletePolicy.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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 policy from the policy store. This operation is +// idempotent; if you specify a policy that doesn't exist, the request response +// returns a successful HTTP 200 status code. +func (c *Client) DeletePolicy(ctx context.Context, params *DeletePolicyInput, optFns ...func(*Options)) (*DeletePolicyOutput, error) { + if params == nil { + params = &DeletePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePolicy", params, optFns, c.addOperationDeletePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePolicyInput struct { + + // Specifies the ID of the policy that you want to delete. + // + // This member is required. + PolicyId *string + + // Specifies the ID of the policy store that contains the policy that you want to + // delete. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type DeletePolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeletePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeletePolicy{}, 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 = addOpDeletePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePolicy(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_opDeletePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "DeletePolicy", + } +} diff --git a/service/verifiedpermissions/api_op_DeletePolicyStore.go b/service/verifiedpermissions/api_op_DeletePolicyStore.go new file mode 100644 index 00000000000..d7dae6543ec --- /dev/null +++ b/service/verifiedpermissions/api_op_DeletePolicyStore.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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 policy store. This operation is idempotent. If you +// specify a policy store that does not exist, the request response will still +// return a successful HTTP 200 status code. +func (c *Client) DeletePolicyStore(ctx context.Context, params *DeletePolicyStoreInput, optFns ...func(*Options)) (*DeletePolicyStoreOutput, error) { + if params == nil { + params = &DeletePolicyStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePolicyStore", params, optFns, c.addOperationDeletePolicyStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePolicyStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePolicyStoreInput struct { + + // Specifies the ID of the policy store that you want to delete. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type DeletePolicyStoreOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePolicyStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeletePolicyStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeletePolicyStore{}, 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 = addOpDeletePolicyStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePolicyStore(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_opDeletePolicyStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "DeletePolicyStore", + } +} diff --git a/service/verifiedpermissions/api_op_DeletePolicyTemplate.go b/service/verifiedpermissions/api_op_DeletePolicyTemplate.go new file mode 100644 index 00000000000..17c2eff3ad8 --- /dev/null +++ b/service/verifiedpermissions/api_op_DeletePolicyTemplate.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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 policy template from the policy store. This operation +// also deletes any policies that were created from the specified policy template. +// Those policies are immediately removed from all future API responses, and are +// asynchronously deleted from the policy store. +func (c *Client) DeletePolicyTemplate(ctx context.Context, params *DeletePolicyTemplateInput, optFns ...func(*Options)) (*DeletePolicyTemplateOutput, error) { + if params == nil { + params = &DeletePolicyTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePolicyTemplate", params, optFns, c.addOperationDeletePolicyTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePolicyTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePolicyTemplateInput struct { + + // Specifies the ID of the policy store that contains the policy template that you + // want to delete. + // + // This member is required. + PolicyStoreId *string + + // Specifies the ID of the policy template that you want to delete. + // + // This member is required. + PolicyTemplateId *string + + noSmithyDocumentSerde +} + +type DeletePolicyTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePolicyTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeletePolicyTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeletePolicyTemplate{}, 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 = addOpDeletePolicyTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePolicyTemplate(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_opDeletePolicyTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "DeletePolicyTemplate", + } +} diff --git a/service/verifiedpermissions/api_op_GetIdentitySource.go b/service/verifiedpermissions/api_op_GetIdentitySource.go new file mode 100644 index 00000000000..55f7c8fcb63 --- /dev/null +++ b/service/verifiedpermissions/api_op_GetIdentitySource.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves the details about the specified identity source. +func (c *Client) GetIdentitySource(ctx context.Context, params *GetIdentitySourceInput, optFns ...func(*Options)) (*GetIdentitySourceOutput, error) { + if params == nil { + params = &GetIdentitySourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIdentitySource", params, optFns, c.addOperationGetIdentitySourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIdentitySourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetIdentitySourceInput struct { + + // Specifies the ID of the identity source you want information about. + // + // This member is required. + IdentitySourceId *string + + // Specifies the ID of the policy store that contains the identity source you want + // information about. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type GetIdentitySourceOutput struct { + + // The date and time that the identity source was originally created. + // + // This member is required. + CreatedDate *time.Time + + // A structure that describes the configuration of the identity source. + // + // This member is required. + Details *types.IdentitySourceDetails + + // The ID of the identity source. + // + // This member is required. + IdentitySourceId *string + + // The date and time that the identity source was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy store that contains the identity source. + // + // This member is required. + PolicyStoreId *string + + // The data type of principals generated for identities authenticated by this + // identity source. + // + // This member is required. + PrincipalEntityType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIdentitySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetIdentitySource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetIdentitySource{}, 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 = addOpGetIdentitySourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIdentitySource(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_opGetIdentitySource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "GetIdentitySource", + } +} diff --git a/service/verifiedpermissions/api_op_GetPolicy.go b/service/verifiedpermissions/api_op_GetPolicy.go new file mode 100644 index 00000000000..bf99cb310cf --- /dev/null +++ b/service/verifiedpermissions/api_op_GetPolicy.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the specified policy. +func (c *Client) GetPolicy(ctx context.Context, params *GetPolicyInput, optFns ...func(*Options)) (*GetPolicyOutput, error) { + if params == nil { + params = &GetPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPolicy", params, optFns, c.addOperationGetPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPolicyInput struct { + + // Specifies the ID of the policy you want information about. + // + // This member is required. + PolicyId *string + + // Specifies the ID of the policy store that contains the policy that you want + // information about. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type GetPolicyOutput struct { + + // The date and time that the policy was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The definition of the requested policy. + // + // This member is required. + Definition types.PolicyDefinitionDetail + + // The date and time that the policy was last updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The unique ID of the policy that you want information about. + // + // This member is required. + PolicyId *string + + // The ID of the policy store that contains the policy that you want information + // about. + // + // This member is required. + PolicyStoreId *string + + // The type of the policy. + // + // This member is required. + PolicyType types.PolicyType + + // The principal specified in the policy's scope. This element isn't included in + // the response when Principal isn't present in the policy content. + Principal *types.EntityIdentifier + + // The resource specified in the policy's scope. This element isn't included in + // the response when Resource isn't present in the policy content. + Resource *types.EntityIdentifier + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetPolicy{}, 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 = addOpGetPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPolicy(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_opGetPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "GetPolicy", + } +} diff --git a/service/verifiedpermissions/api_op_GetPolicyStore.go b/service/verifiedpermissions/api_op_GetPolicyStore.go new file mode 100644 index 00000000000..23eca4a266f --- /dev/null +++ b/service/verifiedpermissions/api_op_GetPolicyStore.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves details about a policy store. +func (c *Client) GetPolicyStore(ctx context.Context, params *GetPolicyStoreInput, optFns ...func(*Options)) (*GetPolicyStoreOutput, error) { + if params == nil { + params = &GetPolicyStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPolicyStore", params, optFns, c.addOperationGetPolicyStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPolicyStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPolicyStoreInput struct { + + // Specifies the ID of the policy store that you want information about. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type GetPolicyStoreOutput struct { + + // The Amazon Resource Name (ARN) of the policy store. + // + // This member is required. + Arn *string + + // The date and time that the policy store was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time that the policy store was last updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy store; + // + // This member is required. + PolicyStoreId *string + + // The current validation settings for the policy store. + // + // This member is required. + ValidationSettings *types.ValidationSettings + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPolicyStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetPolicyStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetPolicyStore{}, 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 = addOpGetPolicyStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPolicyStore(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_opGetPolicyStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "GetPolicyStore", + } +} diff --git a/service/verifiedpermissions/api_op_GetPolicyTemplate.go b/service/verifiedpermissions/api_op_GetPolicyTemplate.go new file mode 100644 index 00000000000..d580596b3e1 --- /dev/null +++ b/service/verifiedpermissions/api_op_GetPolicyTemplate.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieve the details for the specified policy template in the specified policy +// store. +func (c *Client) GetPolicyTemplate(ctx context.Context, params *GetPolicyTemplateInput, optFns ...func(*Options)) (*GetPolicyTemplateOutput, error) { + if params == nil { + params = &GetPolicyTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPolicyTemplate", params, optFns, c.addOperationGetPolicyTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPolicyTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPolicyTemplateInput struct { + + // Specifies the ID of the policy store that contains the policy template that you + // want information about. + // + // This member is required. + PolicyStoreId *string + + // Specifies the ID of the policy template that you want information about. + // + // This member is required. + PolicyTemplateId *string + + noSmithyDocumentSerde +} + +type GetPolicyTemplateOutput struct { + + // The date and time that the policy template was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time that the policy template was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy store that contains the policy template. + // + // This member is required. + PolicyStoreId *string + + // The ID of the policy template. + // + // This member is required. + PolicyTemplateId *string + + // The content of the body of the policy template written in the Cedar policy + // language. + // + // This member is required. + Statement *string + + // The description of the policy template. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPolicyTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetPolicyTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetPolicyTemplate{}, 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 = addOpGetPolicyTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPolicyTemplate(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_opGetPolicyTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "GetPolicyTemplate", + } +} diff --git a/service/verifiedpermissions/api_op_GetSchema.go b/service/verifiedpermissions/api_op_GetSchema.go new file mode 100644 index 00000000000..c7d8e1c86ea --- /dev/null +++ b/service/verifiedpermissions/api_op_GetSchema.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieve the details for the specified schema in the specified policy store. +func (c *Client) GetSchema(ctx context.Context, params *GetSchemaInput, optFns ...func(*Options)) (*GetSchemaOutput, error) { + if params == nil { + params = &GetSchemaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSchema", params, optFns, c.addOperationGetSchemaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSchemaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSchemaInput struct { + + // Specifies the ID of the policy store that contains the schema. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type GetSchemaOutput struct { + + // The date and time that the schema was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time that the schema was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy store that contains the schema. + // + // This member is required. + PolicyStoreId *string + + // The body of the schema, written in Cedar schema JSON. + // + // This member is required. + Schema *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSchemaMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetSchema{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetSchema{}, 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 = addOpGetSchemaValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSchema(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_opGetSchema(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "GetSchema", + } +} diff --git a/service/verifiedpermissions/api_op_IsAuthorized.go b/service/verifiedpermissions/api_op_IsAuthorized.go new file mode 100644 index 00000000000..fbba38d7b42 --- /dev/null +++ b/service/verifiedpermissions/api_op_IsAuthorized.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Makes an authorization decision about a service request described in the +// parameters. The information in the parameters can also define additional context +// that Verified Permissions can include in the evaluation. The request is +// evaluated against all matching policies in the specified policy store. The +// result of the decision is either Allow or Deny , along with a list of the +// policies that resulted in the decision. +func (c *Client) IsAuthorized(ctx context.Context, params *IsAuthorizedInput, optFns ...func(*Options)) (*IsAuthorizedOutput, error) { + if params == nil { + params = &IsAuthorizedInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "IsAuthorized", params, optFns, c.addOperationIsAuthorizedMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*IsAuthorizedOutput) + out.ResultMetadata = metadata + return out, nil +} + +type IsAuthorizedInput struct { + + // Specifies the ID of the policy store. Policies in this policy store will be + // used to make an authorization decision for the input. + // + // This member is required. + PolicyStoreId *string + + // Specifies the requested action to be authorized. For example, is the principal + // authorized to perform this action on the resource? + Action *types.ActionIdentifier + + // Specifies additional context that can be used to make more granular + // authorization decisions. + Context types.ContextDefinition + + // Specifies the list of entities and their associated attributes that Verified + // Permissions can examine when evaluating the policies. + Entities types.EntitiesDefinition + + // Specifies the principal for which the authorization decision is to be made. + Principal *types.EntityIdentifier + + // Specifies the resource for which the authorization decision is to be made. + Resource *types.EntityIdentifier + + noSmithyDocumentSerde +} + +type IsAuthorizedOutput struct { + + // An authorization decision that indicates if the authorization request should be + // allowed or denied. + // + // This member is required. + Decision types.Decision + + // The list of determining policies used to make the authorization decision. For + // example, if there are two matching policies, where one is a forbid and the other + // is a permit, then the forbid policy will be the determining policy. In the case + // of multiple matching permit policies then there would be multiple determining + // policies. In the case that no policies match, and hence the response is DENY, + // there would be no determining policies. + // + // This member is required. + DeterminingPolicies []types.DeterminingPolicyItem + + // Errors that occurred while making an authorization decision, for example, a + // policy references an Entity or entity Attribute that does not exist in the + // slice. + // + // This member is required. + Errors []types.EvaluationErrorItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationIsAuthorizedMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpIsAuthorized{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpIsAuthorized{}, 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 = addOpIsAuthorizedValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opIsAuthorized(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_opIsAuthorized(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "IsAuthorized", + } +} diff --git a/service/verifiedpermissions/api_op_IsAuthorizedWithToken.go b/service/verifiedpermissions/api_op_IsAuthorizedWithToken.go new file mode 100644 index 00000000000..a275a645254 --- /dev/null +++ b/service/verifiedpermissions/api_op_IsAuthorizedWithToken.go @@ -0,0 +1,181 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Makes an authorization decision about a service request described in the +// parameters. The principal in this request comes from an external identity +// source. The information in the parameters can also define additional context +// that Verified Permissions can include in the evaluation. The request is +// evaluated against all matching policies in the specified policy store. The +// result of the decision is either Allow or Deny , along with a list of the +// policies that resulted in the decision. If you delete a Amazon Cognito user pool +// or user, tokens from that deleted pool or that deleted user continue to be +// usable until they expire. +func (c *Client) IsAuthorizedWithToken(ctx context.Context, params *IsAuthorizedWithTokenInput, optFns ...func(*Options)) (*IsAuthorizedWithTokenOutput, error) { + if params == nil { + params = &IsAuthorizedWithTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "IsAuthorizedWithToken", params, optFns, c.addOperationIsAuthorizedWithTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*IsAuthorizedWithTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type IsAuthorizedWithTokenInput struct { + + // Specifies the ID of the policy store. Policies in this policy store will be + // used to make an authorization decision for the input. + // + // This member is required. + PolicyStoreId *string + + // Specifies an access token for the principal to be authorized. This token is + // provided to you by the identity provider (IdP) associated with the specified + // identity source. You must specify either an AccessToken or an IdentityToken , + // but not both. + AccessToken *string + + // Specifies the requested action to be authorized. Is the specified principal + // authorized to perform this action on the specified resource. + Action *types.ActionIdentifier + + // Specifies additional context that can be used to make more granular + // authorization decisions. + Context types.ContextDefinition + + // Specifies the list of entities and their associated attributes that Verified + // Permissions can examine when evaluating the policies. + Entities types.EntitiesDefinition + + // Specifies an identity token for the principal to be authorized. This token is + // provided to you by the identity provider (IdP) associated with the specified + // identity source. You must specify either an AccessToken or an IdentityToken , + // but not both. + IdentityToken *string + + // Specifies the resource for which the authorization decision is made. For + // example, is the principal allowed to perform the action on the resource? + Resource *types.EntityIdentifier + + noSmithyDocumentSerde +} + +type IsAuthorizedWithTokenOutput struct { + + // An authorization decision that indicates if the authorization request should be + // allowed or denied. + // + // This member is required. + Decision types.Decision + + // The list of determining policies used to make the authorization decision. For + // example, if there are multiple matching policies, where at least one is a forbid + // policy, then because forbid always overrides permit the forbid policies are the + // determining policies. If all matching policies are permit policies, then those + // policies are the determining policies. When no policies match and the response + // is the default DENY, there are no determining policies. + // + // This member is required. + DeterminingPolicies []types.DeterminingPolicyItem + + // Errors that occurred while making an authorization decision. For example, a + // policy references an entity or entity attribute that does not exist in the + // slice. + // + // This member is required. + Errors []types.EvaluationErrorItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationIsAuthorizedWithTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpIsAuthorizedWithToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpIsAuthorizedWithToken{}, 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 = addOpIsAuthorizedWithTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opIsAuthorizedWithToken(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_opIsAuthorizedWithToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "IsAuthorizedWithToken", + } +} diff --git a/service/verifiedpermissions/api_op_ListIdentitySources.go b/service/verifiedpermissions/api_op_ListIdentitySources.go new file mode 100644 index 00000000000..96e252f35a7 --- /dev/null +++ b/service/verifiedpermissions/api_op_ListIdentitySources.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of all of the identity sources defined in the +// specified policy store. +func (c *Client) ListIdentitySources(ctx context.Context, params *ListIdentitySourcesInput, optFns ...func(*Options)) (*ListIdentitySourcesOutput, error) { + if params == nil { + params = &ListIdentitySourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListIdentitySources", params, optFns, c.addOperationListIdentitySourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListIdentitySourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListIdentitySourcesInput struct { + + // Specifies the ID of the policy store that contains the identity sources that + // you want to list. + // + // This member is required. + PolicyStoreId *string + + // Specifies characteristics of an identity source that you can use to limit the + // output to matching identity sources. + Filters []types.IdentitySourceFilter + + // Specifies the total 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 that + // is specific to the operation. If additional items exist beyond the number you + // specify, the NextToken response element is returned with a value (not null). + // Include the specified value as the NextToken request parameter in the next call + // to the operation to get the next part of the results. Note that the service + // might 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 + + // Specifies that you want to receive the next page of results. Valid only if you + // received a NextToken response in the previous request. If you did, it indicates + // that more output is available. Set this parameter to the value provided by the + // previous call's NextToken response to request the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListIdentitySourcesOutput struct { + + // The list of identity sources stored in the specified policy store. + // + // This member is required. + IdentitySources []types.IdentitySourceItem + + // If present, this value 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 . This + // indicates that this is the last page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListIdentitySourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListIdentitySources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListIdentitySources{}, 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 = addOpListIdentitySourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIdentitySources(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 +} + +// ListIdentitySourcesAPIClient is a client that implements the +// ListIdentitySources operation. +type ListIdentitySourcesAPIClient interface { + ListIdentitySources(context.Context, *ListIdentitySourcesInput, ...func(*Options)) (*ListIdentitySourcesOutput, error) +} + +var _ ListIdentitySourcesAPIClient = (*Client)(nil) + +// ListIdentitySourcesPaginatorOptions is the paginator options for +// ListIdentitySources +type ListIdentitySourcesPaginatorOptions struct { + // Specifies the total 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 that + // is specific to the operation. If additional items exist beyond the number you + // specify, the NextToken response element is returned with a value (not null). + // Include the specified value as the NextToken request parameter in the next call + // to the operation to get the next part of the results. Note that the service + // might 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 +} + +// ListIdentitySourcesPaginator is a paginator for ListIdentitySources +type ListIdentitySourcesPaginator struct { + options ListIdentitySourcesPaginatorOptions + client ListIdentitySourcesAPIClient + params *ListIdentitySourcesInput + nextToken *string + firstPage bool +} + +// NewListIdentitySourcesPaginator returns a new ListIdentitySourcesPaginator +func NewListIdentitySourcesPaginator(client ListIdentitySourcesAPIClient, params *ListIdentitySourcesInput, optFns ...func(*ListIdentitySourcesPaginatorOptions)) *ListIdentitySourcesPaginator { + if params == nil { + params = &ListIdentitySourcesInput{} + } + + options := ListIdentitySourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListIdentitySourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIdentitySourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListIdentitySources page. +func (p *ListIdentitySourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIdentitySourcesOutput, 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.ListIdentitySources(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_opListIdentitySources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "ListIdentitySources", + } +} diff --git a/service/verifiedpermissions/api_op_ListPolicies.go b/service/verifiedpermissions/api_op_ListPolicies.go new file mode 100644 index 00000000000..e399cbca450 --- /dev/null +++ b/service/verifiedpermissions/api_op_ListPolicies.go @@ -0,0 +1,253 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of all policies stored in the specified policy store. +func (c *Client) ListPolicies(ctx context.Context, params *ListPoliciesInput, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if params == nil { + params = &ListPoliciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPolicies", params, optFns, c.addOperationListPoliciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPoliciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPoliciesInput struct { + + // Specifies the ID of the policy store you want to list policies from. + // + // This member is required. + PolicyStoreId *string + + // Specifies a filter that limits the response to only policies that match the + // specified criteria. For example, you list only the policies that reference a + // specified principal. + Filter *types.PolicyFilter + + // Specifies the total 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 that + // is specific to the operation. If additional items exist beyond the number you + // specify, the NextToken response element is returned with a value (not null). + // Include the specified value as the NextToken request parameter in the next call + // to the operation to get the next part of the results. Note that the service + // might 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 + + // Specifies that you want to receive the next page of results. Valid only if you + // received a NextToken response in the previous request. If you did, it indicates + // that more output is available. Set this parameter to the value provided by the + // previous call's NextToken response to request the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListPoliciesOutput struct { + + // Lists all policies that are available in the specified policy store. + // + // This member is required. + Policies []types.PolicyItem + + // If present, this value 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 . This + // indicates that this is the last page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListPolicies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListPolicies{}, 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 = addOpListPoliciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPolicies(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 +} + +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // Specifies the total 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 that + // is specific to the operation. If additional items exist beyond the number you + // specify, the NextToken response element is returned with a value (not null). + // Include the specified value as the NextToken request parameter in the next call + // to the operation to get the next part of the results. Note that the service + // might 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 +} + +// ListPoliciesPaginator is a paginator for ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + if params == nil { + params = &ListPoliciesInput{} + } + + options := ListPoliciesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, 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.ListPolicies(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_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "ListPolicies", + } +} diff --git a/service/verifiedpermissions/api_op_ListPolicyStores.go b/service/verifiedpermissions/api_op_ListPolicyStores.go new file mode 100644 index 00000000000..0c382a86d3f --- /dev/null +++ b/service/verifiedpermissions/api_op_ListPolicyStores.go @@ -0,0 +1,242 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of all policy stores in the calling Amazon Web +// Services account. +func (c *Client) ListPolicyStores(ctx context.Context, params *ListPolicyStoresInput, optFns ...func(*Options)) (*ListPolicyStoresOutput, error) { + if params == nil { + params = &ListPolicyStoresInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPolicyStores", params, optFns, c.addOperationListPolicyStoresMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPolicyStoresOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPolicyStoresInput struct { + + // Specifies the total 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 that + // is specific to the operation. If additional items exist beyond the number you + // specify, the NextToken response element is returned with a value (not null). + // Include the specified value as the NextToken request parameter in the next call + // to the operation to get the next part of the results. Note that the service + // might 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 + + // Specifies that you want to receive the next page of results. Valid only if you + // received a NextToken response in the previous request. If you did, it indicates + // that more output is available. Set this parameter to the value provided by the + // previous call's NextToken response to request the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListPolicyStoresOutput struct { + + // The list of policy stores in the account. + // + // This member is required. + PolicyStores []types.PolicyStoreItem + + // If present, this value 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 . This + // indicates that this is the last page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPolicyStoresMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListPolicyStores{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListPolicyStores{}, 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_opListPolicyStores(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 +} + +// ListPolicyStoresAPIClient is a client that implements the ListPolicyStores +// operation. +type ListPolicyStoresAPIClient interface { + ListPolicyStores(context.Context, *ListPolicyStoresInput, ...func(*Options)) (*ListPolicyStoresOutput, error) +} + +var _ ListPolicyStoresAPIClient = (*Client)(nil) + +// ListPolicyStoresPaginatorOptions is the paginator options for ListPolicyStores +type ListPolicyStoresPaginatorOptions struct { + // Specifies the total 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 that + // is specific to the operation. If additional items exist beyond the number you + // specify, the NextToken response element is returned with a value (not null). + // Include the specified value as the NextToken request parameter in the next call + // to the operation to get the next part of the results. Note that the service + // might 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 +} + +// ListPolicyStoresPaginator is a paginator for ListPolicyStores +type ListPolicyStoresPaginator struct { + options ListPolicyStoresPaginatorOptions + client ListPolicyStoresAPIClient + params *ListPolicyStoresInput + nextToken *string + firstPage bool +} + +// NewListPolicyStoresPaginator returns a new ListPolicyStoresPaginator +func NewListPolicyStoresPaginator(client ListPolicyStoresAPIClient, params *ListPolicyStoresInput, optFns ...func(*ListPolicyStoresPaginatorOptions)) *ListPolicyStoresPaginator { + if params == nil { + params = &ListPolicyStoresInput{} + } + + options := ListPolicyStoresPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPolicyStoresPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyStoresPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPolicyStores page. +func (p *ListPolicyStoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyStoresOutput, 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.ListPolicyStores(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_opListPolicyStores(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "ListPolicyStores", + } +} diff --git a/service/verifiedpermissions/api_op_ListPolicyTemplates.go b/service/verifiedpermissions/api_op_ListPolicyTemplates.go new file mode 100644 index 00000000000..6d90eafddb3 --- /dev/null +++ b/service/verifiedpermissions/api_op_ListPolicyTemplates.go @@ -0,0 +1,251 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of all policy templates in the specified policy store. +func (c *Client) ListPolicyTemplates(ctx context.Context, params *ListPolicyTemplatesInput, optFns ...func(*Options)) (*ListPolicyTemplatesOutput, error) { + if params == nil { + params = &ListPolicyTemplatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPolicyTemplates", params, optFns, c.addOperationListPolicyTemplatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPolicyTemplatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPolicyTemplatesInput struct { + + // Specifies the ID of the policy store that contains the policy templates you + // want to list. + // + // This member is required. + PolicyStoreId *string + + // Specifies the total 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 that + // is specific to the operation. If additional items exist beyond the number you + // specify, the NextToken response element is returned with a value (not null). + // Include the specified value as the NextToken request parameter in the next call + // to the operation to get the next part of the results. Note that the service + // might 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 + + // Specifies that you want to receive the next page of results. Valid only if you + // received a NextToken response in the previous request. If you did, it indicates + // that more output is available. Set this parameter to the value provided by the + // previous call's NextToken response to request the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListPolicyTemplatesOutput struct { + + // The list of the policy templates in the specified policy store. + // + // This member is required. + PolicyTemplates []types.PolicyTemplateItem + + // If present, this value 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 . This + // indicates that this is the last page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPolicyTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListPolicyTemplates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListPolicyTemplates{}, 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 = addOpListPolicyTemplatesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPolicyTemplates(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 +} + +// ListPolicyTemplatesAPIClient is a client that implements the +// ListPolicyTemplates operation. +type ListPolicyTemplatesAPIClient interface { + ListPolicyTemplates(context.Context, *ListPolicyTemplatesInput, ...func(*Options)) (*ListPolicyTemplatesOutput, error) +} + +var _ ListPolicyTemplatesAPIClient = (*Client)(nil) + +// ListPolicyTemplatesPaginatorOptions is the paginator options for +// ListPolicyTemplates +type ListPolicyTemplatesPaginatorOptions struct { + // Specifies the total 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 that + // is specific to the operation. If additional items exist beyond the number you + // specify, the NextToken response element is returned with a value (not null). + // Include the specified value as the NextToken request parameter in the next call + // to the operation to get the next part of the results. Note that the service + // might 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 +} + +// ListPolicyTemplatesPaginator is a paginator for ListPolicyTemplates +type ListPolicyTemplatesPaginator struct { + options ListPolicyTemplatesPaginatorOptions + client ListPolicyTemplatesAPIClient + params *ListPolicyTemplatesInput + nextToken *string + firstPage bool +} + +// NewListPolicyTemplatesPaginator returns a new ListPolicyTemplatesPaginator +func NewListPolicyTemplatesPaginator(client ListPolicyTemplatesAPIClient, params *ListPolicyTemplatesInput, optFns ...func(*ListPolicyTemplatesPaginatorOptions)) *ListPolicyTemplatesPaginator { + if params == nil { + params = &ListPolicyTemplatesInput{} + } + + options := ListPolicyTemplatesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPolicyTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyTemplatesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPolicyTemplates page. +func (p *ListPolicyTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyTemplatesOutput, 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.ListPolicyTemplates(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_opListPolicyTemplates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "ListPolicyTemplates", + } +} diff --git a/service/verifiedpermissions/api_op_PutSchema.go b/service/verifiedpermissions/api_op_PutSchema.go new file mode 100644 index 00000000000..4c1174e6ec4 --- /dev/null +++ b/service/verifiedpermissions/api_op_PutSchema.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates or updates the policy schema in the specified policy store. The schema +// is used to validate any Cedar policies and policy templates submitted to the +// policy store. Any changes to the schema validate only policies and templates +// submitted after the schema change. Existing policies and templates are not +// re-evaluated against the changed schema. If you later update a policy, then it +// is evaluated against the new schema at that time. +func (c *Client) PutSchema(ctx context.Context, params *PutSchemaInput, optFns ...func(*Options)) (*PutSchemaOutput, error) { + if params == nil { + params = &PutSchemaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutSchema", params, optFns, c.addOperationPutSchemaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutSchemaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutSchemaInput struct { + + // Specifies the definition of the schema to be stored. The schema definition must + // be written in Cedar schema JSON. + // + // This member is required. + Definition types.SchemaDefinition + + // Specifies the ID of the policy store in which to place the schema. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type PutSchemaOutput struct { + + // The date and time that the schema was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time that the schema was last updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // Identifies the namespaces of the entities referenced by this schema. + // + // This member is required. + Namespaces []string + + // The unique ID of the policy store that contains the schema. + // + // This member is required. + PolicyStoreId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutSchemaMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpPutSchema{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPutSchema{}, 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 = addOpPutSchemaValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSchema(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_opPutSchema(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "PutSchema", + } +} diff --git a/service/verifiedpermissions/api_op_UpdateIdentitySource.go b/service/verifiedpermissions/api_op_UpdateIdentitySource.go new file mode 100644 index 00000000000..0d1fbd27007 --- /dev/null +++ b/service/verifiedpermissions/api_op_UpdateIdentitySource.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Updates the specified identity source to use a new identity provider (IdP) +// source, or to change the mapping of identities from the IdP to a different +// principal entity type. +func (c *Client) UpdateIdentitySource(ctx context.Context, params *UpdateIdentitySourceInput, optFns ...func(*Options)) (*UpdateIdentitySourceOutput, error) { + if params == nil { + params = &UpdateIdentitySourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateIdentitySource", params, optFns, c.addOperationUpdateIdentitySourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateIdentitySourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateIdentitySourceInput struct { + + // Specifies the ID of the identity source that you want to update. + // + // This member is required. + IdentitySourceId *string + + // Specifies the ID of the policy store that contains the identity source that you + // want to update. + // + // This member is required. + PolicyStoreId *string + + // Specifies the details required to communicate with the identity provider (IdP) + // associated with this identity source. At this time, the only valid member of + // this structure is a Amazon Cognito user pool configuration. You must specify a + // userPoolArn , and optionally, a ClientId . + // + // This member is required. + UpdateConfiguration types.UpdateConfiguration + + // Specifies the data type of principals generated for identities authenticated by + // the identity source. + PrincipalEntityType *string + + noSmithyDocumentSerde +} + +type UpdateIdentitySourceOutput struct { + + // The date and time that the updated identity source was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The ID of the updated identity source. + // + // This member is required. + IdentitySourceId *string + + // The date and time that the identity source was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy store that contains the updated identity source. + // + // This member is required. + PolicyStoreId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateIdentitySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateIdentitySource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateIdentitySource{}, 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 = addOpUpdateIdentitySourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIdentitySource(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_opUpdateIdentitySource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "UpdateIdentitySource", + } +} diff --git a/service/verifiedpermissions/api_op_UpdatePolicy.go b/service/verifiedpermissions/api_op_UpdatePolicy.go new file mode 100644 index 00000000000..ce241149908 --- /dev/null +++ b/service/verifiedpermissions/api_op_UpdatePolicy.go @@ -0,0 +1,185 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Modifies a Cedar static policy in the specified policy store. You can change +// only certain elements of the UpdatePolicyDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyInput.html#amazonverifiedpermissions-UpdatePolicy-request-UpdatePolicyDefinition) +// parameter. You can directly update only static policies. To change a +// template-linked policy, you must update the template instead, using +// UpdatePolicyTemplate (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyTemplate.html) +// . If policy validation is enabled in the policy store, then updating a static +// policy causes Verified Permissions to validate the policy against the schema in +// the policy store. If the updated static policy doesn't pass validation, the +// operation fails and the update isn't stored. +func (c *Client) UpdatePolicy(ctx context.Context, params *UpdatePolicyInput, optFns ...func(*Options)) (*UpdatePolicyOutput, error) { + if params == nil { + params = &UpdatePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePolicy", params, optFns, c.addOperationUpdatePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePolicyInput struct { + + // Specifies the updated policy content that you want to replace on the specified + // policy. The content must be valid Cedar policy language text. You can change + // only the following elements from the policy definition: + // - The action referenced by the policy. + // - Any conditional clauses, such as when or unless clauses. + // You can't change the following elements: + // - Changing from static to templateLinked . + // - Changing the effect of the policy from permit or forbid . + // - The principal referenced by the policy. + // - The resource referenced by the policy. + // + // This member is required. + Definition types.UpdatePolicyDefinition + + // Specifies the ID of the policy that you want to update. To find this value, you + // can use ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) + // . + // + // This member is required. + PolicyId *string + + // Specifies the ID of the policy store that contains the policy that you want to + // update. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +type UpdatePolicyOutput struct { + + // The date and time that the policy was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time that the policy was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy that was updated. + // + // This member is required. + PolicyId *string + + // The ID of the policy store that contains the policy that was updated. + // + // This member is required. + PolicyStoreId *string + + // The type of the policy that was updated. + // + // This member is required. + PolicyType types.PolicyType + + // The principal specified in the policy's scope. This element isn't included in + // the response when Principal isn't present in the policy content. + Principal *types.EntityIdentifier + + // The resource specified in the policy's scope. This element isn't included in + // the response when Resource isn't present in the policy content. + Resource *types.EntityIdentifier + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdatePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdatePolicy{}, 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 = addOpUpdatePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePolicy(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_opUpdatePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "UpdatePolicy", + } +} diff --git a/service/verifiedpermissions/api_op_UpdatePolicyStore.go b/service/verifiedpermissions/api_op_UpdatePolicyStore.go new file mode 100644 index 00000000000..d823c2fa9c0 --- /dev/null +++ b/service/verifiedpermissions/api_op_UpdatePolicyStore.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Modifies the validation setting for a policy store. +func (c *Client) UpdatePolicyStore(ctx context.Context, params *UpdatePolicyStoreInput, optFns ...func(*Options)) (*UpdatePolicyStoreOutput, error) { + if params == nil { + params = &UpdatePolicyStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePolicyStore", params, optFns, c.addOperationUpdatePolicyStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePolicyStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePolicyStoreInput struct { + + // Specifies the ID of the policy store that you want to update + // + // This member is required. + PolicyStoreId *string + + // A structure that defines the validation settings that want to enable for the + // policy store. + // + // This member is required. + ValidationSettings *types.ValidationSettings + + noSmithyDocumentSerde +} + +type UpdatePolicyStoreOutput struct { + + // The Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // of the updated policy store. + // + // This member is required. + Arn *string + + // The date and time that the policy store was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time that the policy store was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the updated policy store. + // + // This member is required. + PolicyStoreId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePolicyStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdatePolicyStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdatePolicyStore{}, 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 = addOpUpdatePolicyStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePolicyStore(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_opUpdatePolicyStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "UpdatePolicyStore", + } +} diff --git a/service/verifiedpermissions/api_op_UpdatePolicyTemplate.go b/service/verifiedpermissions/api_op_UpdatePolicyTemplate.go new file mode 100644 index 00000000000..9e17cd77434 --- /dev/null +++ b/service/verifiedpermissions/api_op_UpdatePolicyTemplate.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Updates the specified policy template. You can update only the description and +// the some elements of the policyBody (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyTemplate.html#amazonverifiedpermissions-UpdatePolicyTemplate-request-policyBody) +// . Changes you make to the policy template content are immediately reflected in +// authorization decisions that involve all template-linked policies instantiated +// from this template. +func (c *Client) UpdatePolicyTemplate(ctx context.Context, params *UpdatePolicyTemplateInput, optFns ...func(*Options)) (*UpdatePolicyTemplateOutput, error) { + if params == nil { + params = &UpdatePolicyTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePolicyTemplate", params, optFns, c.addOperationUpdatePolicyTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePolicyTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePolicyTemplateInput struct { + + // Specifies the ID of the policy store that contains the policy template that you + // want to update. + // + // This member is required. + PolicyStoreId *string + + // Specifies the ID of the policy template that you want to update. + // + // This member is required. + PolicyTemplateId *string + + // Specifies new statement content written in Cedar policy language to replace the + // current body of the policy template. You can change only the following elements + // of the policy body: + // - The action referenced by the policy template. + // - Any conditional clauses, such as when or unless clauses. + // You can't change the following elements: + // - The effect ( permit or forbid ) of the policy template. + // - The principal referenced by the policy template. + // - The resource referenced by the policy template. + // + // This member is required. + Statement *string + + // Specifies a new description to apply to the policy template. + Description *string + + noSmithyDocumentSerde +} + +type UpdatePolicyTemplateOutput struct { + + // The date and time that the policy template was originally created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time that the policy template was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The ID of the policy store that contains the updated policy template. + // + // This member is required. + PolicyStoreId *string + + // The ID of the updated policy template. + // + // This member is required. + PolicyTemplateId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePolicyTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdatePolicyTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdatePolicyTemplate{}, 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 = addOpUpdatePolicyTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePolicyTemplate(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_opUpdatePolicyTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "verifiedpermissions", + OperationName: "UpdatePolicyTemplate", + } +} diff --git a/service/verifiedpermissions/deserializers.go b/service/verifiedpermissions/deserializers.go new file mode 100644 index 00000000000..874ca329b78 --- /dev/null +++ b/service/verifiedpermissions/deserializers.go @@ -0,0 +1,6521 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions/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" + "strings" +) + +type awsAwsjson10_deserializeOpCreateIdentitySource struct { +} + +func (*awsAwsjson10_deserializeOpCreateIdentitySource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCreateIdentitySource) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorCreateIdentitySource(response, &metadata) + } + output := &CreateIdentitySourceOutput{} + 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 = awsAwsjson10_deserializeOpDocumentCreateIdentitySourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorCreateIdentitySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpCreatePolicy struct { +} + +func (*awsAwsjson10_deserializeOpCreatePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCreatePolicy) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorCreatePolicy(response, &metadata) + } + output := &CreatePolicyOutput{} + 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 = awsAwsjson10_deserializeOpDocumentCreatePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorCreatePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpCreatePolicyStore struct { +} + +func (*awsAwsjson10_deserializeOpCreatePolicyStore) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCreatePolicyStore) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorCreatePolicyStore(response, &metadata) + } + output := &CreatePolicyStoreOutput{} + 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 = awsAwsjson10_deserializeOpDocumentCreatePolicyStoreOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorCreatePolicyStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpCreatePolicyTemplate struct { +} + +func (*awsAwsjson10_deserializeOpCreatePolicyTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCreatePolicyTemplate) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorCreatePolicyTemplate(response, &metadata) + } + output := &CreatePolicyTemplateOutput{} + 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 = awsAwsjson10_deserializeOpDocumentCreatePolicyTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorCreatePolicyTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpDeleteIdentitySource struct { +} + +func (*awsAwsjson10_deserializeOpDeleteIdentitySource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteIdentitySource) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorDeleteIdentitySource(response, &metadata) + } + output := &DeleteIdentitySourceOutput{} + 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 = awsAwsjson10_deserializeOpDocumentDeleteIdentitySourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeleteIdentitySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpDeletePolicy struct { +} + +func (*awsAwsjson10_deserializeOpDeletePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeletePolicy) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorDeletePolicy(response, &metadata) + } + output := &DeletePolicyOutput{} + 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 = awsAwsjson10_deserializeOpDocumentDeletePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpDeletePolicyStore struct { +} + +func (*awsAwsjson10_deserializeOpDeletePolicyStore) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeletePolicyStore) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorDeletePolicyStore(response, &metadata) + } + output := &DeletePolicyStoreOutput{} + 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 = awsAwsjson10_deserializeOpDocumentDeletePolicyStoreOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeletePolicyStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpDeletePolicyTemplate struct { +} + +func (*awsAwsjson10_deserializeOpDeletePolicyTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeletePolicyTemplate) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorDeletePolicyTemplate(response, &metadata) + } + output := &DeletePolicyTemplateOutput{} + 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 = awsAwsjson10_deserializeOpDocumentDeletePolicyTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeletePolicyTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetIdentitySource struct { +} + +func (*awsAwsjson10_deserializeOpGetIdentitySource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetIdentitySource) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorGetIdentitySource(response, &metadata) + } + output := &GetIdentitySourceOutput{} + 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 = awsAwsjson10_deserializeOpDocumentGetIdentitySourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorGetIdentitySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetPolicy struct { +} + +func (*awsAwsjson10_deserializeOpGetPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetPolicy) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorGetPolicy(response, &metadata) + } + output := &GetPolicyOutput{} + 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 = awsAwsjson10_deserializeOpDocumentGetPolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorGetPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetPolicyStore struct { +} + +func (*awsAwsjson10_deserializeOpGetPolicyStore) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetPolicyStore) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorGetPolicyStore(response, &metadata) + } + output := &GetPolicyStoreOutput{} + 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 = awsAwsjson10_deserializeOpDocumentGetPolicyStoreOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorGetPolicyStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetPolicyTemplate struct { +} + +func (*awsAwsjson10_deserializeOpGetPolicyTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetPolicyTemplate) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorGetPolicyTemplate(response, &metadata) + } + output := &GetPolicyTemplateOutput{} + 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 = awsAwsjson10_deserializeOpDocumentGetPolicyTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorGetPolicyTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetSchema struct { +} + +func (*awsAwsjson10_deserializeOpGetSchema) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetSchema) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorGetSchema(response, &metadata) + } + output := &GetSchemaOutput{} + 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 = awsAwsjson10_deserializeOpDocumentGetSchemaOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorGetSchema(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpIsAuthorized struct { +} + +func (*awsAwsjson10_deserializeOpIsAuthorized) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpIsAuthorized) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorIsAuthorized(response, &metadata) + } + output := &IsAuthorizedOutput{} + 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 = awsAwsjson10_deserializeOpDocumentIsAuthorizedOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorIsAuthorized(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpIsAuthorizedWithToken struct { +} + +func (*awsAwsjson10_deserializeOpIsAuthorizedWithToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpIsAuthorizedWithToken) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorIsAuthorizedWithToken(response, &metadata) + } + output := &IsAuthorizedWithTokenOutput{} + 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 = awsAwsjson10_deserializeOpDocumentIsAuthorizedWithTokenOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorIsAuthorizedWithToken(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListIdentitySources struct { +} + +func (*awsAwsjson10_deserializeOpListIdentitySources) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListIdentitySources) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorListIdentitySources(response, &metadata) + } + output := &ListIdentitySourcesOutput{} + 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 = awsAwsjson10_deserializeOpDocumentListIdentitySourcesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorListIdentitySources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListPolicies struct { +} + +func (*awsAwsjson10_deserializeOpListPolicies) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListPolicies) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorListPolicies(response, &metadata) + } + output := &ListPoliciesOutput{} + 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 = awsAwsjson10_deserializeOpDocumentListPoliciesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorListPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListPolicyStores struct { +} + +func (*awsAwsjson10_deserializeOpListPolicyStores) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListPolicyStores) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorListPolicyStores(response, &metadata) + } + output := &ListPolicyStoresOutput{} + 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 = awsAwsjson10_deserializeOpDocumentListPolicyStoresOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorListPolicyStores(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListPolicyTemplates struct { +} + +func (*awsAwsjson10_deserializeOpListPolicyTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListPolicyTemplates) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorListPolicyTemplates(response, &metadata) + } + output := &ListPolicyTemplatesOutput{} + 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 = awsAwsjson10_deserializeOpDocumentListPolicyTemplatesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorListPolicyTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpPutSchema struct { +} + +func (*awsAwsjson10_deserializeOpPutSchema) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpPutSchema) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorPutSchema(response, &metadata) + } + output := &PutSchemaOutput{} + 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 = awsAwsjson10_deserializeOpDocumentPutSchemaOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorPutSchema(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateIdentitySource struct { +} + +func (*awsAwsjson10_deserializeOpUpdateIdentitySource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateIdentitySource) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorUpdateIdentitySource(response, &metadata) + } + output := &UpdateIdentitySourceOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUpdateIdentitySourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateIdentitySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdatePolicy struct { +} + +func (*awsAwsjson10_deserializeOpUpdatePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdatePolicy) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorUpdatePolicy(response, &metadata) + } + output := &UpdatePolicyOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUpdatePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdatePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdatePolicyStore struct { +} + +func (*awsAwsjson10_deserializeOpUpdatePolicyStore) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdatePolicyStore) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorUpdatePolicyStore(response, &metadata) + } + output := &UpdatePolicyStoreOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUpdatePolicyStoreOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdatePolicyStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdatePolicyTemplate struct { +} + +func (*awsAwsjson10_deserializeOpUpdatePolicyTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdatePolicyTemplate) HandleDeserialize(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, awsAwsjson10_deserializeOpErrorUpdatePolicyTemplate(response, &metadata) + } + output := &UpdatePolicyTemplateOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUpdatePolicyTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdatePolicyTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson10_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AccessDeniedException{} + err := awsAwsjson10_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 awsAwsjson10_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConflictException{} + err := awsAwsjson10_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 awsAwsjson10_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InternalServerException{} + err := awsAwsjson10_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 awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceNotFoundException{} + err := awsAwsjson10_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 awsAwsjson10_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceQuotaExceededException{} + err := awsAwsjson10_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 awsAwsjson10_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson10_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 awsAwsjson10_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ValidationException{} + err := awsAwsjson10_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 awsAwsjson10_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentClientIds(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 ClientId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resources": + if err := awsAwsjson10_deserializeDocumentResourceConflictList(&sv.Resources, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentDeterminingPolicyItem(v **types.DeterminingPolicyItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DeterminingPolicyItem + if *v == nil { + sv = &types.DeterminingPolicyItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "policyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentDeterminingPolicyList(v *[]types.DeterminingPolicyItem, 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.DeterminingPolicyItem + if *v == nil { + cv = []types.DeterminingPolicyItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DeterminingPolicyItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentDeterminingPolicyItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentEntityIdentifier(v **types.EntityIdentifier, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EntityIdentifier + if *v == nil { + sv = &types.EntityIdentifier{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "entityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) + } + sv.EntityId = ptr.String(jtv) + } + + case "entityType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) + } + sv.EntityType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEvaluationErrorItem(v **types.EvaluationErrorItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EvaluationErrorItem + if *v == nil { + sv = &types.EvaluationErrorItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorDescription = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEvaluationErrorList(v *[]types.EvaluationErrorItem, 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.EvaluationErrorItem + if *v == nil { + cv = []types.EvaluationErrorItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EvaluationErrorItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentEvaluationErrorItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentIdentitySourceDetails(v **types.IdentitySourceDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.IdentitySourceDetails + if *v == nil { + sv = &types.IdentitySourceDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientIds": + if err := awsAwsjson10_deserializeDocumentClientIds(&sv.ClientIds, value); err != nil { + return err + } + + case "discoveryUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DiscoveryUrl to be of type string, got %T instead", value) + } + sv.DiscoveryUrl = ptr.String(jtv) + } + + case "openIdIssuer": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpenIdIssuer to be of type string, got %T instead", value) + } + sv.OpenIdIssuer = types.OpenIdIssuer(jtv) + } + + case "userPoolArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserPoolArn to be of type string, got %T instead", value) + } + sv.UserPoolArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentIdentitySourceItem(v **types.IdentitySourceItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.IdentitySourceItem + if *v == nil { + sv = &types.IdentitySourceItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "details": + if err := awsAwsjson10_deserializeDocumentIdentitySourceItemDetails(&sv.Details, value); err != nil { + return err + } + + case "identitySourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentitySourceId to be of type string, got %T instead", value) + } + sv.IdentitySourceId = ptr.String(jtv) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "principalEntityType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PrincipalEntityType to be of type string, got %T instead", value) + } + sv.PrincipalEntityType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentIdentitySourceItemDetails(v **types.IdentitySourceItemDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.IdentitySourceItemDetails + if *v == nil { + sv = &types.IdentitySourceItemDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientIds": + if err := awsAwsjson10_deserializeDocumentClientIds(&sv.ClientIds, value); err != nil { + return err + } + + case "discoveryUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DiscoveryUrl to be of type string, got %T instead", value) + } + sv.DiscoveryUrl = ptr.String(jtv) + } + + case "openIdIssuer": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpenIdIssuer to be of type string, got %T instead", value) + } + sv.OpenIdIssuer = types.OpenIdIssuer(jtv) + } + + case "userPoolArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserPoolArn to be of type string, got %T instead", value) + } + sv.UserPoolArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentIdentitySources(v *[]types.IdentitySourceItem, 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.IdentitySourceItem + if *v == nil { + cv = []types.IdentitySourceItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IdentitySourceItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentIdentitySourceItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentNamespaceList(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 Namespace to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentPolicyDefinitionDetail(v *types.PolicyDefinitionDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.PolicyDefinitionDetail +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "static": + var mv types.StaticPolicyDefinitionDetail + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentStaticPolicyDefinitionDetail(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.PolicyDefinitionDetailMemberStatic{Value: mv} + break loop + + case "templateLinked": + var mv types.TemplateLinkedPolicyDefinitionDetail + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentTemplateLinkedPolicyDefinitionDetail(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.PolicyDefinitionDetailMemberTemplateLinked{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsAwsjson10_deserializeDocumentPolicyDefinitionItem(v *types.PolicyDefinitionItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.PolicyDefinitionItem +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "static": + var mv types.StaticPolicyDefinitionItem + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentStaticPolicyDefinitionItem(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.PolicyDefinitionItemMemberStatic{Value: mv} + break loop + + case "templateLinked": + var mv types.TemplateLinkedPolicyDefinitionItem + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentTemplateLinkedPolicyDefinitionItem(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.PolicyDefinitionItemMemberTemplateLinked{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsAwsjson10_deserializeDocumentPolicyItem(v **types.PolicyItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PolicyItem + if *v == nil { + sv = &types.PolicyItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "definition": + if err := awsAwsjson10_deserializeDocumentPolicyDefinitionItem(&sv.Definition, value); err != nil { + return err + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + } + sv.PolicyType = types.PolicyType(jtv) + } + + case "principal": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Principal, value); err != nil { + return err + } + + case "resource": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentPolicyList(v *[]types.PolicyItem, 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.PolicyItem + if *v == nil { + cv = []types.PolicyItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PolicyItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentPolicyItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentPolicyStoreItem(v **types.PolicyStoreItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PolicyStoreItem + if *v == nil { + sv = &types.PolicyStoreItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentPolicyStoreList(v *[]types.PolicyStoreItem, 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.PolicyStoreItem + if *v == nil { + cv = []types.PolicyStoreItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PolicyStoreItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentPolicyStoreItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentPolicyTemplateItem(v **types.PolicyTemplateItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PolicyTemplateItem + if *v == nil { + sv = &types.PolicyTemplateItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyTemplateDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyTemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyTemplateId to be of type string, got %T instead", value) + } + sv.PolicyTemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentPolicyTemplatesList(v *[]types.PolicyTemplateItem, 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.PolicyTemplateItem + if *v == nil { + cv = []types.PolicyTemplateItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PolicyTemplateItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentPolicyTemplateItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceConflict(v **types.ResourceConflict, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResourceConflict + if *v == nil { + sv = &types.ResourceConflict{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 = types.ResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceConflictList(v *[]types.ResourceConflict, 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.ResourceConflict + if *v == nil { + cv = []types.ResourceConflict{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceConflict + destAddr := &col + if err := awsAwsjson10_deserializeDocumentResourceConflict(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 = types.ResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 = types.ResourceType(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentStaticPolicyDefinitionDetail(v **types.StaticPolicyDefinitionDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.StaticPolicyDefinitionDetail + if *v == nil { + sv = &types.StaticPolicyDefinitionDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StaticPolicyDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "statement": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStatement to be of type string, got %T instead", value) + } + sv.Statement = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentStaticPolicyDefinitionItem(v **types.StaticPolicyDefinitionItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.StaticPolicyDefinitionItem + if *v == nil { + sv = &types.StaticPolicyDefinitionItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StaticPolicyDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentTemplateLinkedPolicyDefinitionDetail(v **types.TemplateLinkedPolicyDefinitionDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TemplateLinkedPolicyDefinitionDetail + if *v == nil { + sv = &types.TemplateLinkedPolicyDefinitionDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "policyTemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyTemplateId to be of type string, got %T instead", value) + } + sv.PolicyTemplateId = ptr.String(jtv) + } + + case "principal": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Principal, value); err != nil { + return err + } + + case "resource": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentTemplateLinkedPolicyDefinitionItem(v **types.TemplateLinkedPolicyDefinitionItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TemplateLinkedPolicyDefinitionItem + if *v == nil { + sv = &types.TemplateLinkedPolicyDefinitionItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "policyTemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyTemplateId to be of type string, got %T instead", value) + } + sv.PolicyTemplateId = ptr.String(jtv) + } + + case "principal": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Principal, value); err != nil { + return err + } + + case "resource": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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 "fieldList": + if err := awsAwsjson10_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "path": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Path = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsAwsjson10_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentValidationSettings(v **types.ValidationSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ValidationSettings + if *v == nil { + sv = &types.ValidationSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "mode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationMode to be of type string, got %T instead", value) + } + sv.Mode = types.ValidationMode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentCreateIdentitySourceOutput(v **CreateIdentitySourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateIdentitySourceOutput + if *v == nil { + sv = &CreateIdentitySourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "identitySourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentitySourceId to be of type string, got %T instead", value) + } + sv.IdentitySourceId = ptr.String(jtv) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentCreatePolicyOutput(v **CreatePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreatePolicyOutput + if *v == nil { + sv = &CreatePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + } + sv.PolicyType = types.PolicyType(jtv) + } + + case "principal": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Principal, value); err != nil { + return err + } + + case "resource": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentCreatePolicyStoreOutput(v **CreatePolicyStoreOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreatePolicyStoreOutput + if *v == nil { + sv = &CreatePolicyStoreOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentCreatePolicyTemplateOutput(v **CreatePolicyTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreatePolicyTemplateOutput + if *v == nil { + sv = &CreatePolicyTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyTemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyTemplateId to be of type string, got %T instead", value) + } + sv.PolicyTemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDeleteIdentitySourceOutput(v **DeleteIdentitySourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteIdentitySourceOutput + if *v == nil { + sv = &DeleteIdentitySourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDeletePolicyOutput(v **DeletePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeletePolicyOutput + if *v == nil { + sv = &DeletePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDeletePolicyStoreOutput(v **DeletePolicyStoreOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeletePolicyStoreOutput + if *v == nil { + sv = &DeletePolicyStoreOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDeletePolicyTemplateOutput(v **DeletePolicyTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeletePolicyTemplateOutput + if *v == nil { + sv = &DeletePolicyTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetIdentitySourceOutput(v **GetIdentitySourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetIdentitySourceOutput + if *v == nil { + sv = &GetIdentitySourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "details": + if err := awsAwsjson10_deserializeDocumentIdentitySourceDetails(&sv.Details, value); err != nil { + return err + } + + case "identitySourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentitySourceId to be of type string, got %T instead", value) + } + sv.IdentitySourceId = ptr.String(jtv) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "principalEntityType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PrincipalEntityType to be of type string, got %T instead", value) + } + sv.PrincipalEntityType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetPolicyOutput + if *v == nil { + sv = &GetPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "definition": + if err := awsAwsjson10_deserializeDocumentPolicyDefinitionDetail(&sv.Definition, value); err != nil { + return err + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + } + sv.PolicyType = types.PolicyType(jtv) + } + + case "principal": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Principal, value); err != nil { + return err + } + + case "resource": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetPolicyStoreOutput(v **GetPolicyStoreOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetPolicyStoreOutput + if *v == nil { + sv = &GetPolicyStoreOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "validationSettings": + if err := awsAwsjson10_deserializeDocumentValidationSettings(&sv.ValidationSettings, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetPolicyTemplateOutput(v **GetPolicyTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetPolicyTemplateOutput + if *v == nil { + sv = &GetPolicyTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyTemplateDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyTemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyTemplateId to be of type string, got %T instead", value) + } + sv.PolicyTemplateId = ptr.String(jtv) + } + + case "statement": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStatement to be of type string, got %T instead", value) + } + sv.Statement = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetSchemaOutput(v **GetSchemaOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSchemaOutput + if *v == nil { + sv = &GetSchemaOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "schema": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SchemaJson to be of type string, got %T instead", value) + } + sv.Schema = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentIsAuthorizedOutput(v **IsAuthorizedOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *IsAuthorizedOutput + if *v == nil { + sv = &IsAuthorizedOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "decision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Decision to be of type string, got %T instead", value) + } + sv.Decision = types.Decision(jtv) + } + + case "determiningPolicies": + if err := awsAwsjson10_deserializeDocumentDeterminingPolicyList(&sv.DeterminingPolicies, value); err != nil { + return err + } + + case "errors": + if err := awsAwsjson10_deserializeDocumentEvaluationErrorList(&sv.Errors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentIsAuthorizedWithTokenOutput(v **IsAuthorizedWithTokenOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *IsAuthorizedWithTokenOutput + if *v == nil { + sv = &IsAuthorizedWithTokenOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "decision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Decision to be of type string, got %T instead", value) + } + sv.Decision = types.Decision(jtv) + } + + case "determiningPolicies": + if err := awsAwsjson10_deserializeDocumentDeterminingPolicyList(&sv.DeterminingPolicies, value); err != nil { + return err + } + + case "errors": + if err := awsAwsjson10_deserializeDocumentEvaluationErrorList(&sv.Errors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListIdentitySourcesOutput(v **ListIdentitySourcesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListIdentitySourcesOutput + if *v == nil { + sv = &ListIdentitySourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "identitySources": + if err := awsAwsjson10_deserializeDocumentIdentitySources(&sv.IdentitySources, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListPoliciesOutput(v **ListPoliciesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListPoliciesOutput + if *v == nil { + sv = &ListPoliciesOutput{} + } 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 "policies": + if err := awsAwsjson10_deserializeDocumentPolicyList(&sv.Policies, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListPolicyStoresOutput(v **ListPolicyStoresOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListPolicyStoresOutput + if *v == nil { + sv = &ListPolicyStoresOutput{} + } 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 "policyStores": + if err := awsAwsjson10_deserializeDocumentPolicyStoreList(&sv.PolicyStores, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListPolicyTemplatesOutput(v **ListPolicyTemplatesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListPolicyTemplatesOutput + if *v == nil { + sv = &ListPolicyTemplatesOutput{} + } 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 "policyTemplates": + if err := awsAwsjson10_deserializeDocumentPolicyTemplatesList(&sv.PolicyTemplates, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentPutSchemaOutput(v **PutSchemaOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutSchemaOutput + if *v == nil { + sv = &PutSchemaOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "namespaces": + if err := awsAwsjson10_deserializeDocumentNamespaceList(&sv.Namespaces, value); err != nil { + return err + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUpdateIdentitySourceOutput(v **UpdateIdentitySourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateIdentitySourceOutput + if *v == nil { + sv = &UpdateIdentitySourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "identitySourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentitySourceId to be of type string, got %T instead", value) + } + sv.IdentitySourceId = ptr.String(jtv) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUpdatePolicyOutput(v **UpdatePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdatePolicyOutput + if *v == nil { + sv = &UpdatePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + } + sv.PolicyType = types.PolicyType(jtv) + } + + case "principal": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Principal, value); err != nil { + return err + } + + case "resource": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUpdatePolicyStoreOutput(v **UpdatePolicyStoreOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdatePolicyStoreOutput + if *v == nil { + sv = &UpdatePolicyStoreOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUpdatePolicyTemplateOutput(v **UpdatePolicyTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdatePolicyTemplateOutput + if *v == nil { + sv = &UpdatePolicyTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyTemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyTemplateId to be of type string, got %T instead", value) + } + sv.PolicyTemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/verifiedpermissions/doc.go b/service/verifiedpermissions/doc.go new file mode 100644 index 00000000000..6c6b3926d56 --- /dev/null +++ b/service/verifiedpermissions/doc.go @@ -0,0 +1,51 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package verifiedpermissions provides the API client, operations, and parameter +// types for Amazon Verified Permissions. +// +// Amazon Verified Permissions is a permissions management service from Amazon Web +// Services. You can use Verified Permissions to manage permissions for your +// application, and authorize user access based on those permissions. Using +// Verified Permissions, application developers can grant access based on +// information about the users, resources, and requested actions. You can also +// evaluate additional information like group membership, attributes of the +// resources, and session context, such as time of request and IP addresses. +// Verified Permissions manages these permissions by letting you create and store +// authorization policies for your applications, such as consumer-facing web sites +// and enterprise business systems. Verified Permissions uses Cedar as the policy +// language to express your permission requirements. Cedar supports both role-based +// access control (RBAC) and attribute-based access control (ABAC) authorization +// models. For more information about configuring, administering, and using Amazon +// Verified Permissions in your applications, see the Amazon Verified Permissions +// User Guide (https://docs.aws.amazon.com/verifiedpermissions/latest/userguide/) . +// For more information about the Cedar policy language, see the Cedar Policy +// Language Guide . When you write Cedar policies that reference principals, +// resources and actions, you can define the unique identifiers used for each of +// those elements. We strongly recommend that you follow these best practices: +// - Use values like universally unique identifiers (UUIDs) for all principal +// and resource identifiers. For example, if user jane leaves the company, and +// you later let someone else use the name jane , then that new user +// automatically gets access to everything granted by policies that still reference +// User::"jane" . Cedar can’t distinguish between the new user and the old. This +// applies to both principal and resource identifiers. Always use identifiers that +// are guaranteed unique and never reused to ensure that you don’t unintentionally +// grant access because of the presence of an old identifier in a policy. Where you +// use a UUID for an entity, we recommend that you follow it with the // comment +// specifier and the ‘friendly’ name of your entity. This helps to make your +// policies easier to understand. For example: principal == +// User::"a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111", // alice +// - Do not include personally identifying, confidential, or sensitive +// information as part of the unique identifier for your principals or resources. +// These identifiers are included in log entries shared in CloudTrail trails. +// +// Several operations return structures that appear similar, but have different +// purposes. As new functionality is added to the product, the structure used in a +// parameter of one operation might need to change in a way that wouldn't make +// sense for the same parameter in a different operation. To help you understand +// the purpose of each, the following naming convention is used for the structures: +// +// - Parameters that end in Detail are used in Get operations. +// - Parameters that end in Item are used in List operations. +// - Parameters that use neither suffix are used in the mutating (create and +// update) operations. +package verifiedpermissions diff --git a/service/verifiedpermissions/endpoints.go b/service/verifiedpermissions/endpoints.go new file mode 100644 index 00000000000..8e377a7b050 --- /dev/null +++ b/service/verifiedpermissions/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/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 = "verifiedpermissions" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} diff --git a/service/verifiedpermissions/generated.json b/service/verifiedpermissions/generated.json new file mode 100644 index 00000000000..4b979fd664d --- /dev/null +++ b/service/verifiedpermissions/generated.json @@ -0,0 +1,52 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CreateIdentitySource.go", + "api_op_CreatePolicy.go", + "api_op_CreatePolicyStore.go", + "api_op_CreatePolicyTemplate.go", + "api_op_DeleteIdentitySource.go", + "api_op_DeletePolicy.go", + "api_op_DeletePolicyStore.go", + "api_op_DeletePolicyTemplate.go", + "api_op_GetIdentitySource.go", + "api_op_GetPolicy.go", + "api_op_GetPolicyStore.go", + "api_op_GetPolicyTemplate.go", + "api_op_GetSchema.go", + "api_op_IsAuthorized.go", + "api_op_IsAuthorizedWithToken.go", + "api_op_ListIdentitySources.go", + "api_op_ListPolicies.go", + "api_op_ListPolicyStores.go", + "api_op_ListPolicyTemplates.go", + "api_op_PutSchema.go", + "api_op_UpdateIdentitySource.go", + "api_op_UpdatePolicy.go", + "api_op_UpdatePolicyStore.go", + "api_op_UpdatePolicyTemplate.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "types/types_exported_test.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions", + "unstable": false +} diff --git a/service/verifiedpermissions/go.mod b/service/verifiedpermissions/go.mod new file mode 100644 index 00000000000..9d6a2ca5584 --- /dev/null +++ b/service/verifiedpermissions/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/verifiedpermissions + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.18.0 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 + github.com/aws/smithy-go v1.13.5 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/verifiedpermissions/go.sum b/service/verifiedpermissions/go.sum new file mode 100644 index 00000000000..6f859610e44 --- /dev/null +++ b/service/verifiedpermissions/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= +github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/verifiedpermissions/go_module_metadata.go b/service/verifiedpermissions/go_module_metadata.go new file mode 100644 index 00000000000..5b600347630 --- /dev/null +++ b/service/verifiedpermissions/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package verifiedpermissions + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/verifiedpermissions/internal/endpoints/endpoints.go b/service/verifiedpermissions/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..fd6cf293021 --- /dev/null +++ b/service/verifiedpermissions/internal/endpoints/endpoints.go @@ -0,0 +1,273 @@ +// 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 VerifiedPermissions 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 + 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+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "verifiedpermissions.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "verifiedpermissions-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "verifiedpermissions-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "verifiedpermissions.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "verifiedpermissions.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "verifiedpermissions-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "verifiedpermissions-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "verifiedpermissions.{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: "verifiedpermissions-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "verifiedpermissions.{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: "verifiedpermissions-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "verifiedpermissions.{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: "verifiedpermissions-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "verifiedpermissions.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "verifiedpermissions.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "verifiedpermissions-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "verifiedpermissions-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "verifiedpermissions.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/verifiedpermissions/internal/endpoints/endpoints_test.go b/service/verifiedpermissions/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/verifiedpermissions/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/verifiedpermissions/protocol_test.go b/service/verifiedpermissions/protocol_test.go new file mode 100644 index 00000000000..f9585cc6d89 --- /dev/null +++ b/service/verifiedpermissions/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions diff --git a/service/verifiedpermissions/serializers.go b/service/verifiedpermissions/serializers.go new file mode 100644 index 00000000000..435593a9d39 --- /dev/null +++ b/service/verifiedpermissions/serializers.go @@ -0,0 +1,2407 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions/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" + "path" +) + +type awsAwsjson10_serializeOpCreateIdentitySource struct { +} + +func (*awsAwsjson10_serializeOpCreateIdentitySource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateIdentitySource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateIdentitySourceInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.CreateIdentitySource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateIdentitySourceInput(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 awsAwsjson10_serializeOpCreatePolicy struct { +} + +func (*awsAwsjson10_serializeOpCreatePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreatePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreatePolicyInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.CreatePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreatePolicyInput(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 awsAwsjson10_serializeOpCreatePolicyStore struct { +} + +func (*awsAwsjson10_serializeOpCreatePolicyStore) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreatePolicyStore) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreatePolicyStoreInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.CreatePolicyStore") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreatePolicyStoreInput(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 awsAwsjson10_serializeOpCreatePolicyTemplate struct { +} + +func (*awsAwsjson10_serializeOpCreatePolicyTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreatePolicyTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreatePolicyTemplateInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.CreatePolicyTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreatePolicyTemplateInput(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 awsAwsjson10_serializeOpDeleteIdentitySource struct { +} + +func (*awsAwsjson10_serializeOpDeleteIdentitySource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteIdentitySource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteIdentitySourceInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.DeleteIdentitySource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteIdentitySourceInput(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 awsAwsjson10_serializeOpDeletePolicy struct { +} + +func (*awsAwsjson10_serializeOpDeletePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeletePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeletePolicyInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.DeletePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeletePolicyInput(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 awsAwsjson10_serializeOpDeletePolicyStore struct { +} + +func (*awsAwsjson10_serializeOpDeletePolicyStore) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeletePolicyStore) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeletePolicyStoreInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.DeletePolicyStore") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeletePolicyStoreInput(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 awsAwsjson10_serializeOpDeletePolicyTemplate struct { +} + +func (*awsAwsjson10_serializeOpDeletePolicyTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeletePolicyTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeletePolicyTemplateInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.DeletePolicyTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeletePolicyTemplateInput(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 awsAwsjson10_serializeOpGetIdentitySource struct { +} + +func (*awsAwsjson10_serializeOpGetIdentitySource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetIdentitySource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetIdentitySourceInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.GetIdentitySource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetIdentitySourceInput(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 awsAwsjson10_serializeOpGetPolicy struct { +} + +func (*awsAwsjson10_serializeOpGetPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPolicyInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.GetPolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetPolicyInput(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 awsAwsjson10_serializeOpGetPolicyStore struct { +} + +func (*awsAwsjson10_serializeOpGetPolicyStore) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetPolicyStore) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPolicyStoreInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.GetPolicyStore") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetPolicyStoreInput(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 awsAwsjson10_serializeOpGetPolicyTemplate struct { +} + +func (*awsAwsjson10_serializeOpGetPolicyTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetPolicyTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPolicyTemplateInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.GetPolicyTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetPolicyTemplateInput(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 awsAwsjson10_serializeOpGetSchema struct { +} + +func (*awsAwsjson10_serializeOpGetSchema) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetSchema) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSchemaInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.GetSchema") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetSchemaInput(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 awsAwsjson10_serializeOpIsAuthorized struct { +} + +func (*awsAwsjson10_serializeOpIsAuthorized) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpIsAuthorized) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*IsAuthorizedInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.IsAuthorized") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentIsAuthorizedInput(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 awsAwsjson10_serializeOpIsAuthorizedWithToken struct { +} + +func (*awsAwsjson10_serializeOpIsAuthorizedWithToken) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpIsAuthorizedWithToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*IsAuthorizedWithTokenInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.IsAuthorizedWithToken") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentIsAuthorizedWithTokenInput(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 awsAwsjson10_serializeOpListIdentitySources struct { +} + +func (*awsAwsjson10_serializeOpListIdentitySources) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListIdentitySources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListIdentitySourcesInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.ListIdentitySources") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListIdentitySourcesInput(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 awsAwsjson10_serializeOpListPolicies struct { +} + +func (*awsAwsjson10_serializeOpListPolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListPoliciesInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.ListPolicies") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListPoliciesInput(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 awsAwsjson10_serializeOpListPolicyStores struct { +} + +func (*awsAwsjson10_serializeOpListPolicyStores) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListPolicyStores) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListPolicyStoresInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.ListPolicyStores") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListPolicyStoresInput(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 awsAwsjson10_serializeOpListPolicyTemplates struct { +} + +func (*awsAwsjson10_serializeOpListPolicyTemplates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListPolicyTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListPolicyTemplatesInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.ListPolicyTemplates") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListPolicyTemplatesInput(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 awsAwsjson10_serializeOpPutSchema struct { +} + +func (*awsAwsjson10_serializeOpPutSchema) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpPutSchema) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutSchemaInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.PutSchema") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentPutSchemaInput(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 awsAwsjson10_serializeOpUpdateIdentitySource struct { +} + +func (*awsAwsjson10_serializeOpUpdateIdentitySource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateIdentitySource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateIdentitySourceInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.UpdateIdentitySource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateIdentitySourceInput(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 awsAwsjson10_serializeOpUpdatePolicy struct { +} + +func (*awsAwsjson10_serializeOpUpdatePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdatePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePolicyInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.UpdatePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdatePolicyInput(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 awsAwsjson10_serializeOpUpdatePolicyStore struct { +} + +func (*awsAwsjson10_serializeOpUpdatePolicyStore) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdatePolicyStore) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePolicyStoreInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.UpdatePolicyStore") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdatePolicyStoreInput(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 awsAwsjson10_serializeOpUpdatePolicyTemplate struct { +} + +func (*awsAwsjson10_serializeOpUpdatePolicyTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdatePolicyTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePolicyTemplateInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.UpdatePolicyTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdatePolicyTemplateInput(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 awsAwsjson10_serializeDocumentActionIdentifier(v *types.ActionIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActionId != nil { + ok := object.Key("actionId") + ok.String(*v.ActionId) + } + + if v.ActionType != nil { + ok := object.Key("actionType") + ok.String(*v.ActionType) + } + + return nil +} + +func awsAwsjson10_serializeDocumentAttributeValue(v types.AttributeValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.AttributeValueMemberBoolean: + av := object.Key("boolean") + av.Boolean(uv.Value) + + case *types.AttributeValueMemberEntityIdentifier: + av := object.Key("entityIdentifier") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(&uv.Value, av); err != nil { + return err + } + + case *types.AttributeValueMemberLong: + av := object.Key("long") + av.Long(uv.Value) + + case *types.AttributeValueMemberRecord: + av := object.Key("record") + if err := awsAwsjson10_serializeDocumentRecordAttribute(uv.Value, av); err != nil { + return err + } + + case *types.AttributeValueMemberSet: + av := object.Key("set") + if err := awsAwsjson10_serializeDocumentSetAttribute(uv.Value, av); err != nil { + return err + } + + case *types.AttributeValueMemberString: + av := object.Key("string") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentClientIds(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 awsAwsjson10_serializeDocumentCognitoUserPoolConfiguration(v *types.CognitoUserPoolConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientIds != nil { + ok := object.Key("clientIds") + if err := awsAwsjson10_serializeDocumentClientIds(v.ClientIds, ok); err != nil { + return err + } + } + + if v.UserPoolArn != nil { + ok := object.Key("userPoolArn") + ok.String(*v.UserPoolArn) + } + + return nil +} + +func awsAwsjson10_serializeDocumentConfiguration(v types.Configuration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ConfigurationMemberCognitoUserPoolConfiguration: + av := object.Key("cognitoUserPoolConfiguration") + if err := awsAwsjson10_serializeDocumentCognitoUserPoolConfiguration(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentContextDefinition(v types.ContextDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ContextDefinitionMemberContextMap: + av := object.Key("contextMap") + if err := awsAwsjson10_serializeDocumentContextMap(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentContextMap(v map[string]types.AttributeValue, 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 := awsAwsjson10_serializeDocumentAttributeValue(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentEntitiesDefinition(v types.EntitiesDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.EntitiesDefinitionMemberEntityList: + av := object.Key("entityList") + if err := awsAwsjson10_serializeDocumentEntityList(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentEntityAttributes(v map[string]types.AttributeValue, 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 := awsAwsjson10_serializeDocumentAttributeValue(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentEntityIdentifier(v *types.EntityIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EntityId != nil { + ok := object.Key("entityId") + ok.String(*v.EntityId) + } + + if v.EntityType != nil { + ok := object.Key("entityType") + ok.String(*v.EntityType) + } + + return nil +} + +func awsAwsjson10_serializeDocumentEntityItem(v *types.EntityItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Attributes != nil { + ok := object.Key("attributes") + if err := awsAwsjson10_serializeDocumentEntityAttributes(v.Attributes, ok); err != nil { + return err + } + } + + if v.Identifier != nil { + ok := object.Key("identifier") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(v.Identifier, ok); err != nil { + return err + } + } + + if v.Parents != nil { + ok := object.Key("parents") + if err := awsAwsjson10_serializeDocumentParentList(v.Parents, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentEntityList(v []types.EntityItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentEntityItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentEntityReference(v types.EntityReference, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.EntityReferenceMemberIdentifier: + av := object.Key("identifier") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(&uv.Value, av); err != nil { + return err + } + + case *types.EntityReferenceMemberUnspecified: + av := object.Key("unspecified") + av.Boolean(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentIdentitySourceFilter(v *types.IdentitySourceFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PrincipalEntityType != nil { + ok := object.Key("principalEntityType") + ok.String(*v.PrincipalEntityType) + } + + return nil +} + +func awsAwsjson10_serializeDocumentIdentitySourceFilters(v []types.IdentitySourceFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentIdentitySourceFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentParentList(v []types.EntityIdentifier, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentEntityIdentifier(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentPolicyDefinition(v types.PolicyDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.PolicyDefinitionMemberStatic: + av := object.Key("static") + if err := awsAwsjson10_serializeDocumentStaticPolicyDefinition(&uv.Value, av); err != nil { + return err + } + + case *types.PolicyDefinitionMemberTemplateLinked: + av := object.Key("templateLinked") + if err := awsAwsjson10_serializeDocumentTemplateLinkedPolicyDefinition(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentPolicyFilter(v *types.PolicyFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyTemplateId != nil { + ok := object.Key("policyTemplateId") + ok.String(*v.PolicyTemplateId) + } + + if len(v.PolicyType) > 0 { + ok := object.Key("policyType") + ok.String(string(v.PolicyType)) + } + + if v.Principal != nil { + ok := object.Key("principal") + if err := awsAwsjson10_serializeDocumentEntityReference(v.Principal, ok); err != nil { + return err + } + } + + if v.Resource != nil { + ok := object.Key("resource") + if err := awsAwsjson10_serializeDocumentEntityReference(v.Resource, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentRecordAttribute(v map[string]types.AttributeValue, 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 := awsAwsjson10_serializeDocumentAttributeValue(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentSchemaDefinition(v types.SchemaDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SchemaDefinitionMemberCedarJson: + av := object.Key("cedarJson") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentSetAttribute(v []types.AttributeValue, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsAwsjson10_serializeDocumentAttributeValue(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentStaticPolicyDefinition(v *types.StaticPolicyDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Statement != nil { + ok := object.Key("statement") + ok.String(*v.Statement) + } + + return nil +} + +func awsAwsjson10_serializeDocumentTemplateLinkedPolicyDefinition(v *types.TemplateLinkedPolicyDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyTemplateId != nil { + ok := object.Key("policyTemplateId") + ok.String(*v.PolicyTemplateId) + } + + if v.Principal != nil { + ok := object.Key("principal") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(v.Principal, ok); err != nil { + return err + } + } + + if v.Resource != nil { + ok := object.Key("resource") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(v.Resource, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentUpdateCognitoUserPoolConfiguration(v *types.UpdateCognitoUserPoolConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientIds != nil { + ok := object.Key("clientIds") + if err := awsAwsjson10_serializeDocumentClientIds(v.ClientIds, ok); err != nil { + return err + } + } + + if v.UserPoolArn != nil { + ok := object.Key("userPoolArn") + ok.String(*v.UserPoolArn) + } + + return nil +} + +func awsAwsjson10_serializeDocumentUpdateConfiguration(v types.UpdateConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.UpdateConfigurationMemberCognitoUserPoolConfiguration: + av := object.Key("cognitoUserPoolConfiguration") + if err := awsAwsjson10_serializeDocumentUpdateCognitoUserPoolConfiguration(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentUpdatePolicyDefinition(v types.UpdatePolicyDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.UpdatePolicyDefinitionMemberStatic: + av := object.Key("static") + if err := awsAwsjson10_serializeDocumentUpdateStaticPolicyDefinition(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsjson10_serializeDocumentUpdateStaticPolicyDefinition(v *types.UpdateStaticPolicyDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Statement != nil { + ok := object.Key("statement") + ok.String(*v.Statement) + } + + return nil +} + +func awsAwsjson10_serializeDocumentValidationSettings(v *types.ValidationSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Mode) > 0 { + ok := object.Key("mode") + ok.String(string(v.Mode)) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentCreateIdentitySourceInput(v *CreateIdentitySourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Configuration != nil { + ok := object.Key("configuration") + if err := awsAwsjson10_serializeDocumentConfiguration(v.Configuration, ok); err != nil { + return err + } + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.PrincipalEntityType != nil { + ok := object.Key("principalEntityType") + ok.String(*v.PrincipalEntityType) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentCreatePolicyInput(v *CreatePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Definition != nil { + ok := object.Key("definition") + if err := awsAwsjson10_serializeDocumentPolicyDefinition(v.Definition, ok); err != nil { + return err + } + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentCreatePolicyStoreInput(v *CreatePolicyStoreInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.ValidationSettings != nil { + ok := object.Key("validationSettings") + if err := awsAwsjson10_serializeDocumentValidationSettings(v.ValidationSettings, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentCreatePolicyTemplateInput(v *CreatePolicyTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.Statement != nil { + ok := object.Key("statement") + ok.String(*v.Statement) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeleteIdentitySourceInput(v *DeleteIdentitySourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IdentitySourceId != nil { + ok := object.Key("identitySourceId") + ok.String(*v.IdentitySourceId) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeletePolicyInput(v *DeletePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyId != nil { + ok := object.Key("policyId") + ok.String(*v.PolicyId) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeletePolicyStoreInput(v *DeletePolicyStoreInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeletePolicyTemplateInput(v *DeletePolicyTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.PolicyTemplateId != nil { + ok := object.Key("policyTemplateId") + ok.String(*v.PolicyTemplateId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetIdentitySourceInput(v *GetIdentitySourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IdentitySourceId != nil { + ok := object.Key("identitySourceId") + ok.String(*v.IdentitySourceId) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetPolicyInput(v *GetPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyId != nil { + ok := object.Key("policyId") + ok.String(*v.PolicyId) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetPolicyStoreInput(v *GetPolicyStoreInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetPolicyTemplateInput(v *GetPolicyTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.PolicyTemplateId != nil { + ok := object.Key("policyTemplateId") + ok.String(*v.PolicyTemplateId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetSchemaInput(v *GetSchemaInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentIsAuthorizedInput(v *IsAuthorizedInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("action") + if err := awsAwsjson10_serializeDocumentActionIdentifier(v.Action, ok); err != nil { + return err + } + } + + if v.Context != nil { + ok := object.Key("context") + if err := awsAwsjson10_serializeDocumentContextDefinition(v.Context, ok); err != nil { + return err + } + } + + if v.Entities != nil { + ok := object.Key("entities") + if err := awsAwsjson10_serializeDocumentEntitiesDefinition(v.Entities, ok); err != nil { + return err + } + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.Principal != nil { + ok := object.Key("principal") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(v.Principal, ok); err != nil { + return err + } + } + + if v.Resource != nil { + ok := object.Key("resource") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(v.Resource, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentIsAuthorizedWithTokenInput(v *IsAuthorizedWithTokenInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccessToken != nil { + ok := object.Key("accessToken") + ok.String(*v.AccessToken) + } + + if v.Action != nil { + ok := object.Key("action") + if err := awsAwsjson10_serializeDocumentActionIdentifier(v.Action, ok); err != nil { + return err + } + } + + if v.Context != nil { + ok := object.Key("context") + if err := awsAwsjson10_serializeDocumentContextDefinition(v.Context, ok); err != nil { + return err + } + } + + if v.Entities != nil { + ok := object.Key("entities") + if err := awsAwsjson10_serializeDocumentEntitiesDefinition(v.Entities, ok); err != nil { + return err + } + } + + if v.IdentityToken != nil { + ok := object.Key("identityToken") + ok.String(*v.IdentityToken) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.Resource != nil { + ok := object.Key("resource") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(v.Resource, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListIdentitySourcesInput(v *ListIdentitySourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsAwsjson10_serializeDocumentIdentitySourceFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListPoliciesInput(v *ListPoliciesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filter != nil { + ok := object.Key("filter") + if err := awsAwsjson10_serializeDocumentPolicyFilter(v.Filter, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListPolicyStoresInput(v *ListPolicyStoresInput, 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 awsAwsjson10_serializeOpDocumentListPolicyTemplatesInput(v *ListPolicyTemplatesInput, 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.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentPutSchemaInput(v *PutSchemaInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Definition != nil { + ok := object.Key("definition") + if err := awsAwsjson10_serializeDocumentSchemaDefinition(v.Definition, ok); err != nil { + return err + } + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdateIdentitySourceInput(v *UpdateIdentitySourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IdentitySourceId != nil { + ok := object.Key("identitySourceId") + ok.String(*v.IdentitySourceId) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.PrincipalEntityType != nil { + ok := object.Key("principalEntityType") + ok.String(*v.PrincipalEntityType) + } + + if v.UpdateConfiguration != nil { + ok := object.Key("updateConfiguration") + if err := awsAwsjson10_serializeDocumentUpdateConfiguration(v.UpdateConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdatePolicyInput(v *UpdatePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Definition != nil { + ok := object.Key("definition") + if err := awsAwsjson10_serializeDocumentUpdatePolicyDefinition(v.Definition, ok); err != nil { + return err + } + } + + if v.PolicyId != nil { + ok := object.Key("policyId") + ok.String(*v.PolicyId) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdatePolicyStoreInput(v *UpdatePolicyStoreInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.ValidationSettings != nil { + ok := object.Key("validationSettings") + if err := awsAwsjson10_serializeDocumentValidationSettings(v.ValidationSettings, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdatePolicyTemplateInput(v *UpdatePolicyTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.PolicyTemplateId != nil { + ok := object.Key("policyTemplateId") + ok.String(*v.PolicyTemplateId) + } + + if v.Statement != nil { + ok := object.Key("statement") + ok.String(*v.Statement) + } + + return nil +} diff --git a/service/verifiedpermissions/types/enums.go b/service/verifiedpermissions/types/enums.go new file mode 100644 index 00000000000..dded1fcebca --- /dev/null +++ b/service/verifiedpermissions/types/enums.go @@ -0,0 +1,97 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type Decision string + +// Enum values for Decision +const ( + DecisionAllow Decision = "ALLOW" + DecisionDeny Decision = "DENY" +) + +// Values returns all known values for Decision. 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 (Decision) Values() []Decision { + return []Decision{ + "ALLOW", + "DENY", + } +} + +type OpenIdIssuer string + +// Enum values for OpenIdIssuer +const ( + OpenIdIssuerCognito OpenIdIssuer = "COGNITO" +) + +// Values returns all known values for OpenIdIssuer. 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 (OpenIdIssuer) Values() []OpenIdIssuer { + return []OpenIdIssuer{ + "COGNITO", + } +} + +type PolicyType string + +// Enum values for PolicyType +const ( + PolicyTypeStatic PolicyType = "STATIC" + PolicyTypeTemplateLinked PolicyType = "TEMPLATE_LINKED" +) + +// Values returns all known values for PolicyType. 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 (PolicyType) Values() []PolicyType { + return []PolicyType{ + "STATIC", + "TEMPLATE_LINKED", + } +} + +type ResourceType string + +// Enum values for ResourceType +const ( + ResourceTypeIdentitySource ResourceType = "IDENTITY_SOURCE" + ResourceTypePolicyStore ResourceType = "POLICY_STORE" + ResourceTypePolicy ResourceType = "POLICY" + ResourceTypePolicyTemplate ResourceType = "POLICY_TEMPLATE" + ResourceTypeSchema ResourceType = "SCHEMA" +) + +// Values returns all known values for ResourceType. 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 (ResourceType) Values() []ResourceType { + return []ResourceType{ + "IDENTITY_SOURCE", + "POLICY_STORE", + "POLICY", + "POLICY_TEMPLATE", + "SCHEMA", + } +} + +type ValidationMode string + +// Enum values for ValidationMode +const ( + ValidationModeOff ValidationMode = "OFF" + ValidationModeStrict ValidationMode = "STRICT" +) + +// Values returns all known values for ValidationMode. 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 (ValidationMode) Values() []ValidationMode { + return []ValidationMode{ + "OFF", + "STRICT", + } +} diff --git a/service/verifiedpermissions/types/errors.go b/service/verifiedpermissions/types/errors.go new file mode 100644 index 00000000000..59fdc8b6a4a --- /dev/null +++ b/service/verifiedpermissions/types/errors.go @@ -0,0 +1,236 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You don't have sufficient access to perform this action. +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 } + +// The request failed because another request to modify a resource occurred at the +// same. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + Resources []ResourceConflict + + 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 request failed because of an internal error. Try your request again later +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 } + +// The request failed because it references a resource that doesn't exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType ResourceType + + 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 request failed because it would cause a service quota to be exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType ResourceType + ServiceCode *string + QuotaCode *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed because it exceeded a throttling quota. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + ServiceCode *string + QuotaCode *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.FaultClient } + +// The request failed because one or more input parameters don't satisfy their +// constraint requirements. The output is provided as a list of fields and a reason +// for each field that isn't valid. The possible reasons include the following: +// - UnrecognizedEntityType The policy includes an entity type that isn't found +// in the schema. +// - UnrecognizedActionId The policy includes an action id that isn't found in +// the schema. +// - InvalidActionApplication The policy includes an action that, according to +// the schema, doesn't support the specified principal and resource. +// - UnexpectedType The policy included an operand that isn't a valid type for +// the specified operation. +// - IncompatibleTypes The types of elements included in a set , or the types of +// expressions used in an if...then...else clause aren't compatible in this +// context. +// - MissingAttribute The policy attempts to access a record or entity attribute +// that isn't specified in the schema. Test for the existence of the attribute +// first before attempting to access its value. For more information, see the +// has (presence of attribute test) operator in the Cedar Policy Language Guide. +// - UnsafeOptionalAttributeAccess The policy attempts to access a record or +// entity attribute that is optional and isn't guaranteed to be present. Test for +// the existence of the attribute first before attempting to access its value. For +// more information, see the has (presence of attribute test) operator in the +// Cedar Policy Language Guide. +// - ImpossiblePolicy Cedar has determined that a policy condition always +// evaluates to false. If the policy is always false, it can never apply to any +// query, and so it can never affect an authorization decision. +// - WrongNumberArguments The policy references an extension type with the wrong +// number of arguments. +// - FunctionArgumentValidationError Cedar couldn't parse the argument passed to +// an extension type. For example, a string that is to be parsed as an IPv4 address +// can contain only digits and the period character. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + FieldList []ValidationExceptionField + + 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 } diff --git a/service/verifiedpermissions/types/types.go b/service/verifiedpermissions/types/types.go new file mode 100644 index 00000000000..d8b78103837 --- /dev/null +++ b/service/verifiedpermissions/types/types.go @@ -0,0 +1,945 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Contains information about an action for a request for which an authorization +// decision is made. This data type is used as an request parameter to the +// IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) +// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// operations. Example: { "actionId": "", "actionType": "Action" } +type ActionIdentifier struct { + + // The ID of an action. + // + // This member is required. + ActionId *string + + // The type of an action. + // + // This member is required. + ActionType *string + + noSmithyDocumentSerde +} + +// The value of an attribute. Contains information about the runtime context for a +// request for which an authorization decision is made. This data type is used as a +// member of the ContextDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ContextDefinition.html) +// structure which is uses as a request parameter for the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) +// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// operations. +// +// The following types satisfy this interface: +// +// AttributeValueMemberBoolean +// AttributeValueMemberEntityIdentifier +// AttributeValueMemberLong +// AttributeValueMemberRecord +// AttributeValueMemberSet +// AttributeValueMemberString +type AttributeValue interface { + isAttributeValue() +} + +// An attribute value of Boolean type. Example: {"boolean": true} +type AttributeValueMemberBoolean struct { + Value bool + + noSmithyDocumentSerde +} + +func (*AttributeValueMemberBoolean) isAttributeValue() {} + +// An attribute value of type EntityIdentifier (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_EntityIdentifier.html) +// . Example: "entityIdentifier": { "entityId": "", "entityType": ""} +type AttributeValueMemberEntityIdentifier struct { + Value EntityIdentifier + + noSmithyDocumentSerde +} + +func (*AttributeValueMemberEntityIdentifier) isAttributeValue() {} + +// An attribute value of Long type. Example: {"long": 0} +type AttributeValueMemberLong struct { + Value int64 + + noSmithyDocumentSerde +} + +func (*AttributeValueMemberLong) isAttributeValue() {} + +// An attribute value of Record type. Example: {"record": { "keyName": {} } } +type AttributeValueMemberRecord struct { + Value map[string]AttributeValue + + noSmithyDocumentSerde +} + +func (*AttributeValueMemberRecord) isAttributeValue() {} + +// An attribute value of Set type. Example: {"set": [ {} ] } +type AttributeValueMemberSet struct { + Value []AttributeValue + + noSmithyDocumentSerde +} + +func (*AttributeValueMemberSet) isAttributeValue() {} + +// An attribute value of String type. Example: {"string": "abc"} +type AttributeValueMemberString struct { + Value string + + noSmithyDocumentSerde +} + +func (*AttributeValueMemberString) isAttributeValue() {} + +// The configuration for an identity source that represents a connection to an +// Amazon Cognito user pool used as an identity provider for Verified Permissions. +// This data type is used as a field that is part of an Configuration (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_Configuration.html) +// structure that is used as a parameter to the Configuration (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_Configuration.html) +// . Example: +// "CognitoUserPoolConfiguration":{"UserPoolArn":"cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": +// ["a1b2c3d4e5f6g7h8i9j0kalbmc"]} +type CognitoUserPoolConfiguration struct { + + // The Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // of the Amazon Cognito user pool that contains the identities to be authorized. + // Example: "UserPoolArn": + // "cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5" + // + // This member is required. + UserPoolArn *string + + // The unique application client IDs that are associated with the specified Amazon + // Cognito user pool. Example: "ClientIds": ["&ExampleCogClientId;"] + ClientIds []string + + noSmithyDocumentSerde +} + +// Contains configuration information used when creating a new identity source. At +// this time, the only valid member of this structure is a Amazon Cognito user pool +// configuration. You must specify a userPoolArn , and optionally, a ClientId . +// This data type is used as a request parameter for the CreateIdentitySource (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html) +// operation. +// +// The following types satisfy this interface: +// +// ConfigurationMemberCognitoUserPoolConfiguration +type Configuration interface { + isConfiguration() +} + +// Contains configuration details of a Amazon Cognito user pool that Verified +// Permissions can use as a source of authenticated identities as entities. It +// specifies the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) +// of a Amazon Cognito user pool and one or more application client IDs. Example: +// "configuration":{"cognitoUserPoolConfiguration":{"userPoolArn":"cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds": +// ["a1b2c3d4e5f6g7h8i9j0kalbmc"]}} +type ConfigurationMemberCognitoUserPoolConfiguration struct { + Value CognitoUserPoolConfiguration + + noSmithyDocumentSerde +} + +func (*ConfigurationMemberCognitoUserPoolConfiguration) isConfiguration() {} + +// Contains additional details about the context of the request. Verified +// Permissions evaluates this information in an authorization request as part of +// the when and unless clauses in a policy. This data type is used as a request +// parameter for the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) +// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// operations. Example: +// "context":{"Context":{"":{"boolean":true},"":{"long":1234}}} +// +// The following types satisfy this interface: +// +// ContextDefinitionMemberContextMap +type ContextDefinition interface { + isContextDefinition() +} + +// An list of attributes that are needed to successfully evaluate an authorization +// request. Each attribute in this array must include a map of a data type and its +// value. Example: +// "Context":{"":{"boolean":true},"":{"long":1234}} +type ContextDefinitionMemberContextMap struct { + Value map[string]AttributeValue + + noSmithyDocumentSerde +} + +func (*ContextDefinitionMemberContextMap) isContextDefinition() {} + +// Contains information about one of the policies that determined an authorization +// decision. This data type is used as an element in a response parameter for the +// IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) +// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// operations. Example: +// "determiningPolicies":[{"policyId":"SPEXAMPLEabcdefg111111"}] +type DeterminingPolicyItem struct { + + // The Id of a policy that determined to an authorization decision. Example: + // "policyId":"SPEXAMPLEabcdefg111111" + // + // This member is required. + PolicyId *string + + noSmithyDocumentSerde +} + +// Contains the list of entities to be considered during an authorization request. +// This includes all principals, resources, and actions required to successfully +// evaluate the request. This data type is used as a field in the response +// parameter for the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) +// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// operations. +// +// The following types satisfy this interface: +// +// EntitiesDefinitionMemberEntityList +type EntitiesDefinition interface { + isEntitiesDefinition() +} + +// An array of entities that are needed to successfully evaluate an authorization +// request. Each entity in this array must include an identifier for the entity, +// the attributes of the entity, and a list of any parent entities. +type EntitiesDefinitionMemberEntityList struct { + Value []EntityItem + + noSmithyDocumentSerde +} + +func (*EntitiesDefinitionMemberEntityList) isEntitiesDefinition() {} + +// Contains the identifier of an entity, including its ID and type. This data type +// is used as a request parameter for IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) +// operation, and as a response parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) +// , GetPolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_GetPolicy.html) +// , and UpdatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicy.html) +// operations. Example: {"entityId":"string","entityType":"string"} +type EntityIdentifier struct { + + // The identifier of an entity. "entityId":"identifier" + // + // This member is required. + EntityId *string + + // The type of an entity. Example: "entityType":"typeName" + // + // This member is required. + EntityType *string + + noSmithyDocumentSerde +} + +// Contains information about an entity that can be referenced in a Cedar policy. +// This data type is used as one of the fields in the EntitiesDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_EntitiesDefinition.html) +// structure. { "id": { "entityType": "Photo", "entityId": "VacationPhoto94.jpg" +// }, "Attributes": {}, "Parents": [ { "entityType": "Album", "entityId": +// "alice_folder" } ] } +type EntityItem struct { + + // The identifier of the entity. + // + // This member is required. + Identifier *EntityIdentifier + + // A list of attributes for the entity. + Attributes map[string]AttributeValue + + // The parents in the hierarchy that contains the entity. + Parents []EntityIdentifier + + noSmithyDocumentSerde +} + +// Contains information about a principal or resource that can be referenced in a +// Cedar policy. This data type is used as part of the PolicyFilter (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyFilter.html) +// structure that is used as a request parameter for the ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) +// operation.. +// +// The following types satisfy this interface: +// +// EntityReferenceMemberIdentifier +// EntityReferenceMemberUnspecified +type EntityReference interface { + isEntityReference() +} + +// The identifier of the entity. It can consist of either an EntityType and +// EntityId, a principal, or a resource. +type EntityReferenceMemberIdentifier struct { + Value EntityIdentifier + + noSmithyDocumentSerde +} + +func (*EntityReferenceMemberIdentifier) isEntityReference() {} + +// Used to indicate that a principal or resource is not specified. This can be +// used to search for policies that are not associated with a specific principal or +// resource. +type EntityReferenceMemberUnspecified struct { + Value bool + + noSmithyDocumentSerde +} + +func (*EntityReferenceMemberUnspecified) isEntityReference() {} + +// Contains a description of an evaluation error. This data type is used as a +// request parameter in the IsAuthorized (https://docs.aws.amazon.com/amazon-verified-permissions/latest/APIReference/API_IsAuthorized.html) +// and IsAuthorizedWithToken (https://docs.aws.amazon.com/amazon-verified-permissions/latest/APIReference/API_IsAuthorizedWithToken.html) +// operations. +type EvaluationErrorItem struct { + + // The error description. + // + // This member is required. + ErrorDescription *string + + noSmithyDocumentSerde +} + +// A structure that contains configuration of the identity source. This data type +// is used as a response parameter for the CreateIdentitySource (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html) +// operation. +type IdentitySourceDetails struct { + + // The application client IDs associated with the specified Amazon Cognito user + // pool that are enabled for this identity source. + ClientIds []string + + // The well-known URL that points to this user pool's OIDC discovery endpoint. + // This is a URL string in the following format. This URL replaces the placeholders + // for both the Amazon Web Services Region and the user pool identifier with those + // appropriate for this user pool. + // https://cognito-idp..amazonaws.com//.well-known/openid-configuration + DiscoveryUrl *string + + // A string that identifies the type of OIDC service represented by this identity + // source. At this time, the only valid value is cognito . + OpenIdIssuer OpenIdIssuer + + // The Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // of the Amazon Cognito user pool whose identities are accessible to this Verified + // Permissions policy store. + UserPoolArn *string + + noSmithyDocumentSerde +} + +// A structure that defines characteristics of an identity source that you can use +// to filter. This data type is used as a request parameter for the +// ListIdentityStores (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListIdentityStores.html) +// operation. +type IdentitySourceFilter struct { + + // The Cedar entity type of the principals returned by the identity provider (IdP) + // associated with this identity source. + PrincipalEntityType *string + + noSmithyDocumentSerde +} + +// A structure that defines an identity source. This data type is used as a +// request parameter for the ListIdentityStores (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListIdentityStores.html) +// operation. +type IdentitySourceItem struct { + + // The date and time the identity source was originally created. + // + // This member is required. + CreatedDate *time.Time + + // A structure that contains the details of the associated identity provider (IdP). + // + // This member is required. + Details *IdentitySourceItemDetails + + // The unique identifier of the identity source. + // + // This member is required. + IdentitySourceId *string + + // The date and time the identity source was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The identifier of the policy store that contains the identity source. + // + // This member is required. + PolicyStoreId *string + + // The Cedar entity type of the principals returned from the IdP associated with + // this identity source. + // + // This member is required. + PrincipalEntityType *string + + noSmithyDocumentSerde +} + +// A structure that contains configuration of the identity source. This data type +// is used as a response parameter for the CreateIdentitySource (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html) +// operation. +type IdentitySourceItemDetails struct { + + // The application client IDs associated with the specified Amazon Cognito user + // pool that are enabled for this identity source. + ClientIds []string + + // The well-known URL that points to this user pool's OIDC discovery endpoint. + // This is a URL string in the following format. This URL replaces the placeholders + // for both the Amazon Web Services Region and the user pool identifier with those + // appropriate for this user pool. + // https://cognito-idp..amazonaws.com//.well-known/openid-configuration + DiscoveryUrl *string + + // A string that identifies the type of OIDC service represented by this identity + // source. At this time, the only valid value is cognito . + OpenIdIssuer OpenIdIssuer + + // The Amazon Cognito user pool whose identities are accessible to this Verified + // Permissions policy store. + UserPoolArn *string + + noSmithyDocumentSerde +} + +// A structure that contains the details for a Cedar policy definition. It +// includes the policy type, a description, and a policy body. This is a top level +// data type used to create a policy. This data type is used as a request parameter +// for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) +// operation. This structure must always have either an static or a templateLinked +// element. +// +// The following types satisfy this interface: +// +// PolicyDefinitionMemberStatic +// PolicyDefinitionMemberTemplateLinked +type PolicyDefinition interface { + isPolicyDefinition() +} + +// A structure that describes a static policy. An static policy doesn't use a +// template or allow placeholders for entities. +type PolicyDefinitionMemberStatic struct { + Value StaticPolicyDefinition + + noSmithyDocumentSerde +} + +func (*PolicyDefinitionMemberStatic) isPolicyDefinition() {} + +// A structure that describes a policy that was instantiated from a template. The +// template can specify placeholders for principal and resource . When you use +// CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) +// to create a policy from a template, you specify the exact principal and resource +// to use for the instantiated policy. +type PolicyDefinitionMemberTemplateLinked struct { + Value TemplateLinkedPolicyDefinition + + noSmithyDocumentSerde +} + +func (*PolicyDefinitionMemberTemplateLinked) isPolicyDefinition() {} + +// A structure that describes a policy definition. It must always have either an +// static or a templateLinked element. This data type is used as a response +// parameter for the GetPolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_GetPolicy.html) +// operation. +// +// The following types satisfy this interface: +// +// PolicyDefinitionDetailMemberStatic +// PolicyDefinitionDetailMemberTemplateLinked +type PolicyDefinitionDetail interface { + isPolicyDefinitionDetail() +} + +// Information about a static policy that wasn't created with a policy template. +type PolicyDefinitionDetailMemberStatic struct { + Value StaticPolicyDefinitionDetail + + noSmithyDocumentSerde +} + +func (*PolicyDefinitionDetailMemberStatic) isPolicyDefinitionDetail() {} + +// Information about a template-linked policy that was created by instantiating a +// policy template. +type PolicyDefinitionDetailMemberTemplateLinked struct { + Value TemplateLinkedPolicyDefinitionDetail + + noSmithyDocumentSerde +} + +func (*PolicyDefinitionDetailMemberTemplateLinked) isPolicyDefinitionDetail() {} + +// A structure that describes a PolicyDefinintion (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinintion.html) +// . It will always have either an StaticPolicy or a TemplateLinkedPolicy element. +// This data type is used as a response parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) +// and ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) +// operations. +// +// The following types satisfy this interface: +// +// PolicyDefinitionItemMemberStatic +// PolicyDefinitionItemMemberTemplateLinked +type PolicyDefinitionItem interface { + isPolicyDefinitionItem() +} + +// Information about a static policy that wasn't created with a policy template. +type PolicyDefinitionItemMemberStatic struct { + Value StaticPolicyDefinitionItem + + noSmithyDocumentSerde +} + +func (*PolicyDefinitionItemMemberStatic) isPolicyDefinitionItem() {} + +// Information about a template-linked policy that was created by instantiating a +// policy template. +type PolicyDefinitionItemMemberTemplateLinked struct { + Value TemplateLinkedPolicyDefinitionItem + + noSmithyDocumentSerde +} + +func (*PolicyDefinitionItemMemberTemplateLinked) isPolicyDefinitionItem() {} + +// Contains information about a filter to refine policies returned in a query. +// This data type is used as a response parameter for the ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) +// operation. +type PolicyFilter struct { + + // Filters the output to only template-linked policies that were instantiated from + // the specified policy template. + PolicyTemplateId *string + + // Filters the output to only policies of the specified type. + PolicyType PolicyType + + // Filters the output to only policies that reference the specified principal. + Principal EntityReference + + // Filters the output to only policies that reference the specified resource. + Resource EntityReference + + noSmithyDocumentSerde +} + +// Contains information about a policy. This data type is used as a response +// parameter for the ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) +// operation. +type PolicyItem struct { + + // The date and time the policy was created. + // + // This member is required. + CreatedDate *time.Time + + // The policy definition of an item in the list of policies returned. + // + // This member is required. + Definition PolicyDefinitionItem + + // The date and time the policy was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The identifier of the policy you want information about. + // + // This member is required. + PolicyId *string + + // The identifier of the PolicyStore where the policy you want information about + // is stored. + // + // This member is required. + PolicyStoreId *string + + // The type of the policy. This is one of the following values: + // - static + // - templateLinked + // + // This member is required. + PolicyType PolicyType + + // The principal associated with the policy. + Principal *EntityIdentifier + + // The resource associated with the policy. + Resource *EntityIdentifier + + noSmithyDocumentSerde +} + +// Contains information about a policy store. This data type is used as a response +// parameter for the ListPolicyStores (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicyStores.html) +// operation. +type PolicyStoreItem struct { + + // The Amazon Resource Name (ARN) of the policy store. + // + // This member is required. + Arn *string + + // The date and time the policy was created. + // + // This member is required. + CreatedDate *time.Time + + // The unique identifier of the policy store. + // + // This member is required. + PolicyStoreId *string + + noSmithyDocumentSerde +} + +// Contains details about a policy template This data type is used as a response +// parameter for the ListPolicyTemplates (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicyTemplates.html) +// operation. +type PolicyTemplateItem struct { + + // The date and time that the policy template was created. + // + // This member is required. + CreatedDate *time.Time + + // The date and time that the policy template was most recently updated. + // + // This member is required. + LastUpdatedDate *time.Time + + // The unique identifier of the policy store that contains the template. + // + // This member is required. + PolicyStoreId *string + + // The unique identifier of the policy template. + // + // This member is required. + PolicyTemplateId *string + + // The description attached to the policy template. + Description *string + + noSmithyDocumentSerde +} + +// Contains information about a resource conflict. +type ResourceConflict struct { + + // The unique identifier of the resource involved in a conflict. + // + // This member is required. + ResourceId *string + + // The type of the resource involved in a conflict. + // + // This member is required. + ResourceType ResourceType + + noSmithyDocumentSerde +} + +// Contains a list of principal types, resource types, and actions that can be +// specified in policies stored in the same policy store. If the validation mode +// for the policy store is set to STRICT , then policies that can't be validated by +// this schema are rejected by Verified Permissions and can't be stored in the +// policy store. +// +// The following types satisfy this interface: +// +// SchemaDefinitionMemberCedarJson +type SchemaDefinition interface { + isSchemaDefinition() +} + +// A JSON string representation of the schema supported by applications that use +// this policy store. For more information, see Policy store schema (https://docs.aws.amazon.com/verifiedpermissions/latest/userguide/schema.html) +// in the Amazon Verified Permissions User Guide. +type SchemaDefinitionMemberCedarJson struct { + Value string + + noSmithyDocumentSerde +} + +func (*SchemaDefinitionMemberCedarJson) isSchemaDefinition() {} + +// Contains information about a static policy. This data type is used as a field +// that is part of the PolicyDefinitionDetail (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinitionDetail.html) +// type. +type StaticPolicyDefinition struct { + + // The policy content of the static policy, written in the Cedar policy language. + // + // This member is required. + Statement *string + + // The description of the static policy. + Description *string + + noSmithyDocumentSerde +} + +// A structure that contains details about a static policy. It includes the +// description and policy body. This data type is used within a PolicyDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinition.html) +// structure as part of a request parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) +// operation. +type StaticPolicyDefinitionDetail struct { + + // The content of the static policy written in the Cedar policy language. + // + // This member is required. + Statement *string + + // A description of the static policy. + Description *string + + noSmithyDocumentSerde +} + +// A structure that contains details about a static policy. It includes the +// description and policy statement. This data type is used within a +// PolicyDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinition.html) +// structure as part of a request parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) +// operation. +type StaticPolicyDefinitionItem struct { + + // A description of the static policy. + Description *string + + noSmithyDocumentSerde +} + +// Contains information about a policy created by instantiating a policy template. +type TemplateLinkedPolicyDefinition struct { + + // The unique identifier of the policy template used to create this policy. + // + // This member is required. + PolicyTemplateId *string + + // The principal associated with this template-linked policy. Verified Permissions + // substitutes this principal for the ?principal placeholder in the policy + // template when it evaluates an authorization request. + Principal *EntityIdentifier + + // The resource associated with this template-linked policy. Verified Permissions + // substitutes this resource for the ?resource placeholder in the policy template + // when it evaluates an authorization request. + Resource *EntityIdentifier + + noSmithyDocumentSerde +} + +// Contains information about a policy that was created by instantiating a policy +// template. This +type TemplateLinkedPolicyDefinitionDetail struct { + + // The unique identifier of the policy template used to create this policy. + // + // This member is required. + PolicyTemplateId *string + + // The principal associated with this template-linked policy. Verified Permissions + // substitutes this principal for the ?principal placeholder in the policy + // template when it evaluates an authorization request. + Principal *EntityIdentifier + + // The resource associated with this template-linked policy. Verified Permissions + // substitutes this resource for the ?resource placeholder in the policy template + // when it evaluates an authorization request. + Resource *EntityIdentifier + + noSmithyDocumentSerde +} + +// Contains information about a policy created by instantiating a policy template. +// This +type TemplateLinkedPolicyDefinitionItem struct { + + // The unique identifier of the policy template used to create this policy. + // + // This member is required. + PolicyTemplateId *string + + // The principal associated with this template-linked policy. Verified Permissions + // substitutes this principal for the ?principal placeholder in the policy + // template when it evaluates an authorization request. + Principal *EntityIdentifier + + // The resource associated with this template-linked policy. Verified Permissions + // substitutes this resource for the ?resource placeholder in the policy template + // when it evaluates an authorization request. + Resource *EntityIdentifier + + noSmithyDocumentSerde +} + +// Contains configuration details of a Amazon Cognito user pool for use with an +// identity source. +type UpdateCognitoUserPoolConfiguration struct { + + // The Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // of the Amazon Cognito user pool associated with this identity source. + // + // This member is required. + UserPoolArn *string + + // The client ID of an app client that is configured for the specified Amazon + // Cognito user pool. + ClientIds []string + + noSmithyDocumentSerde +} + +// Contains an updated configuration to replace the configuration in an existing +// identity source. At this time, the only valid member of this structure is a +// Amazon Cognito user pool configuration. You must specify a userPoolArn , and +// optionally, a ClientId . +// +// The following types satisfy this interface: +// +// UpdateConfigurationMemberCognitoUserPoolConfiguration +type UpdateConfiguration interface { + isUpdateConfiguration() +} + +// Contains configuration details of a Amazon Cognito user pool. +type UpdateConfigurationMemberCognitoUserPoolConfiguration struct { + Value UpdateCognitoUserPoolConfiguration + + noSmithyDocumentSerde +} + +func (*UpdateConfigurationMemberCognitoUserPoolConfiguration) isUpdateConfiguration() {} + +// Contains information about updates to be applied to a policy. This data type is +// used as a request parameter in the UpdatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicy.html) +// operation. +// +// The following types satisfy this interface: +// +// UpdatePolicyDefinitionMemberStatic +type UpdatePolicyDefinition interface { + isUpdatePolicyDefinition() +} + +// Contains details about the updates to be applied to a static policy. +type UpdatePolicyDefinitionMemberStatic struct { + Value UpdateStaticPolicyDefinition + + noSmithyDocumentSerde +} + +func (*UpdatePolicyDefinitionMemberStatic) isUpdatePolicyDefinition() {} + +// Contains information about an update to a static policy. +type UpdateStaticPolicyDefinition struct { + + // Specifies the Cedar policy language text to be added to or replaced on the + // static policy. You can change only the following elements from the original + // content: + // - The action referenced by the policy. + // - Any conditional clauses, such as when or unless clauses. + // You can't change the following elements: + // - Changing from StaticPolicy to TemplateLinkedPolicy . + // - The effect ( permit or forbid ) of the policy. + // - The principal referenced by the policy. + // - The resource referenced by the policy. + // + // This member is required. + Statement *string + + // Specifies the description to be added to or replaced on the static policy. + Description *string + + noSmithyDocumentSerde +} + +// Details about a field that failed policy validation. +type ValidationExceptionField struct { + + // Describes the policy validation error. + // + // This member is required. + Message *string + + // The path to the specific element that Verified Permissions found to be not + // valid. + // + // This member is required. + Path *string + + noSmithyDocumentSerde +} + +// A structure that contains Cedar policy validation settings for the policy +// store. The validation mode determines which validation failures that Cedar +// considers serious enough to block acceptance of a new or edited static policy or +// policy template. This data type is used as a request parameter in the +// CreatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicyStore.html) +// and UpdatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore.html) +// operations. +type ValidationSettings struct { + + // The validation mode currently configured for this policy store. The valid + // values are: + // - OFF – Neither Verified Permissions nor Cedar perform any validation on + // policies. No validation errors are reported by either service. + // - STRICT – Requires a schema to be present in the policy store. Cedar + // performs validation on all submitted new or updated static policies and policy + // templates. Any that fail validation are rejected and Cedar doesn't store them in + // the policy store. + // If Mode=STRICT and the policy store doesn't contain a schema, Verified + // Permissions rejects all static policies and policy templates because there is no + // schema to validate against. To submit a static policy or policy template without + // a schema, you must turn off validation. + // + // This member is required. + Mode ValidationMode + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isAttributeValue() {} +func (*UnknownUnionMember) isConfiguration() {} +func (*UnknownUnionMember) isContextDefinition() {} +func (*UnknownUnionMember) isEntitiesDefinition() {} +func (*UnknownUnionMember) isEntityReference() {} +func (*UnknownUnionMember) isPolicyDefinition() {} +func (*UnknownUnionMember) isPolicyDefinitionDetail() {} +func (*UnknownUnionMember) isPolicyDefinitionItem() {} +func (*UnknownUnionMember) isSchemaDefinition() {} +func (*UnknownUnionMember) isUpdateConfiguration() {} +func (*UnknownUnionMember) isUpdatePolicyDefinition() {} diff --git a/service/verifiedpermissions/types/types_exported_test.go b/service/verifiedpermissions/types/types_exported_test.go new file mode 100644 index 00000000000..72a8b31c3dd --- /dev/null +++ b/service/verifiedpermissions/types/types_exported_test.go @@ -0,0 +1,242 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions/types" +) + +func ExampleAttributeValue_outputUsage() { + var union types.AttributeValue + // type switches can be used to check the union value + switch v := union.(type) { + case *types.AttributeValueMemberBoolean: + _ = v.Value // Value is bool + + case *types.AttributeValueMemberEntityIdentifier: + _ = v.Value // Value is types.EntityIdentifier + + case *types.AttributeValueMemberLong: + _ = v.Value // Value is int64 + + case *types.AttributeValueMemberRecord: + _ = v.Value // Value is map[string]types.AttributeValue + + case *types.AttributeValueMemberSet: + _ = v.Value // Value is []types.AttributeValue + + case *types.AttributeValueMemberString: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.EntityIdentifier +var _ *string +var _ map[string]types.AttributeValue +var _ *bool +var _ *int64 +var _ []types.AttributeValue + +func ExampleConfiguration_outputUsage() { + var union types.Configuration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ConfigurationMemberCognitoUserPoolConfiguration: + _ = v.Value // Value is types.CognitoUserPoolConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.CognitoUserPoolConfiguration + +func ExampleContextDefinition_outputUsage() { + var union types.ContextDefinition + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ContextDefinitionMemberContextMap: + _ = v.Value // Value is map[string]types.AttributeValue + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ map[string]types.AttributeValue + +func ExampleEntitiesDefinition_outputUsage() { + var union types.EntitiesDefinition + // type switches can be used to check the union value + switch v := union.(type) { + case *types.EntitiesDefinitionMemberEntityList: + _ = v.Value // Value is []types.EntityItem + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ []types.EntityItem + +func ExampleEntityReference_outputUsage() { + var union types.EntityReference + // type switches can be used to check the union value + switch v := union.(type) { + case *types.EntityReferenceMemberIdentifier: + _ = v.Value // Value is types.EntityIdentifier + + case *types.EntityReferenceMemberUnspecified: + _ = v.Value // Value is bool + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.EntityIdentifier +var _ *bool + +func ExamplePolicyDefinition_outputUsage() { + var union types.PolicyDefinition + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PolicyDefinitionMemberStatic: + _ = v.Value // Value is types.StaticPolicyDefinition + + case *types.PolicyDefinitionMemberTemplateLinked: + _ = v.Value // Value is types.TemplateLinkedPolicyDefinition + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.StaticPolicyDefinition +var _ *types.TemplateLinkedPolicyDefinition + +func ExamplePolicyDefinitionDetail_outputUsage() { + var union types.PolicyDefinitionDetail + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PolicyDefinitionDetailMemberStatic: + _ = v.Value // Value is types.StaticPolicyDefinitionDetail + + case *types.PolicyDefinitionDetailMemberTemplateLinked: + _ = v.Value // Value is types.TemplateLinkedPolicyDefinitionDetail + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.StaticPolicyDefinitionDetail +var _ *types.TemplateLinkedPolicyDefinitionDetail + +func ExamplePolicyDefinitionItem_outputUsage() { + var union types.PolicyDefinitionItem + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PolicyDefinitionItemMemberStatic: + _ = v.Value // Value is types.StaticPolicyDefinitionItem + + case *types.PolicyDefinitionItemMemberTemplateLinked: + _ = v.Value // Value is types.TemplateLinkedPolicyDefinitionItem + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.TemplateLinkedPolicyDefinitionItem +var _ *types.StaticPolicyDefinitionItem + +func ExampleSchemaDefinition_outputUsage() { + var union types.SchemaDefinition + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SchemaDefinitionMemberCedarJson: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string + +func ExampleUpdateConfiguration_outputUsage() { + var union types.UpdateConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.UpdateConfigurationMemberCognitoUserPoolConfiguration: + _ = v.Value // Value is types.UpdateCognitoUserPoolConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.UpdateCognitoUserPoolConfiguration + +func ExampleUpdatePolicyDefinition_outputUsage() { + var union types.UpdatePolicyDefinition + // type switches can be used to check the union value + switch v := union.(type) { + case *types.UpdatePolicyDefinitionMemberStatic: + _ = v.Value // Value is types.UpdateStaticPolicyDefinition + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.UpdateStaticPolicyDefinition diff --git a/service/verifiedpermissions/validators.go b/service/verifiedpermissions/validators.go new file mode 100644 index 00000000000..8498dd7f008 --- /dev/null +++ b/service/verifiedpermissions/validators.go @@ -0,0 +1,1489 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateIdentitySource struct { +} + +func (*validateOpCreateIdentitySource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateIdentitySource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateIdentitySourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateIdentitySourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreatePolicy struct { +} + +func (*validateOpCreatePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreatePolicyStore struct { +} + +func (*validateOpCreatePolicyStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePolicyStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePolicyStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePolicyStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreatePolicyTemplate struct { +} + +func (*validateOpCreatePolicyTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePolicyTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePolicyTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePolicyTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteIdentitySource struct { +} + +func (*validateOpDeleteIdentitySource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIdentitySource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIdentitySourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIdentitySourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeletePolicy struct { +} + +func (*validateOpDeletePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeletePolicyStore struct { +} + +func (*validateOpDeletePolicyStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePolicyStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePolicyStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePolicyStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeletePolicyTemplate struct { +} + +func (*validateOpDeletePolicyTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePolicyTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePolicyTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePolicyTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetIdentitySource struct { +} + +func (*validateOpGetIdentitySource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetIdentitySource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetIdentitySourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetIdentitySourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetPolicy struct { +} + +func (*validateOpGetPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetPolicyStore struct { +} + +func (*validateOpGetPolicyStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPolicyStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPolicyStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPolicyStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetPolicyTemplate struct { +} + +func (*validateOpGetPolicyTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPolicyTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPolicyTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPolicyTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSchema struct { +} + +func (*validateOpGetSchema) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSchema) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSchemaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSchemaInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpIsAuthorized struct { +} + +func (*validateOpIsAuthorized) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpIsAuthorized) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*IsAuthorizedInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpIsAuthorizedInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpIsAuthorizedWithToken struct { +} + +func (*validateOpIsAuthorizedWithToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpIsAuthorizedWithToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*IsAuthorizedWithTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpIsAuthorizedWithTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListIdentitySources struct { +} + +func (*validateOpListIdentitySources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListIdentitySources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListIdentitySourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListIdentitySourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListPolicies struct { +} + +func (*validateOpListPolicies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListPoliciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListPoliciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListPolicyTemplates struct { +} + +func (*validateOpListPolicyTemplates) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListPolicyTemplates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListPolicyTemplatesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListPolicyTemplatesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutSchema struct { +} + +func (*validateOpPutSchema) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutSchema) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutSchemaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutSchemaInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateIdentitySource struct { +} + +func (*validateOpUpdateIdentitySource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateIdentitySource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateIdentitySourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateIdentitySourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdatePolicy struct { +} + +func (*validateOpUpdatePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdatePolicyStore struct { +} + +func (*validateOpUpdatePolicyStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePolicyStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePolicyStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePolicyStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdatePolicyTemplate struct { +} + +func (*validateOpUpdatePolicyTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePolicyTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePolicyTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePolicyTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateIdentitySourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateIdentitySource{}, middleware.After) +} + +func addOpCreatePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePolicy{}, middleware.After) +} + +func addOpCreatePolicyStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePolicyStore{}, middleware.After) +} + +func addOpCreatePolicyTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePolicyTemplate{}, middleware.After) +} + +func addOpDeleteIdentitySourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIdentitySource{}, middleware.After) +} + +func addOpDeletePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePolicy{}, middleware.After) +} + +func addOpDeletePolicyStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePolicyStore{}, middleware.After) +} + +func addOpDeletePolicyTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePolicyTemplate{}, middleware.After) +} + +func addOpGetIdentitySourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetIdentitySource{}, middleware.After) +} + +func addOpGetPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPolicy{}, middleware.After) +} + +func addOpGetPolicyStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPolicyStore{}, middleware.After) +} + +func addOpGetPolicyTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPolicyTemplate{}, middleware.After) +} + +func addOpGetSchemaValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSchema{}, middleware.After) +} + +func addOpIsAuthorizedValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpIsAuthorized{}, middleware.After) +} + +func addOpIsAuthorizedWithTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpIsAuthorizedWithToken{}, middleware.After) +} + +func addOpListIdentitySourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListIdentitySources{}, middleware.After) +} + +func addOpListPoliciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListPolicies{}, middleware.After) +} + +func addOpListPolicyTemplatesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListPolicyTemplates{}, middleware.After) +} + +func addOpPutSchemaValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutSchema{}, middleware.After) +} + +func addOpUpdateIdentitySourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateIdentitySource{}, middleware.After) +} + +func addOpUpdatePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePolicy{}, middleware.After) +} + +func addOpUpdatePolicyStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePolicyStore{}, middleware.After) +} + +func addOpUpdatePolicyTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePolicyTemplate{}, middleware.After) +} + +func validateActionIdentifier(v *types.ActionIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActionIdentifier"} + if v.ActionType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionType")) + } + if v.ActionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAttributeValue(v types.AttributeValue) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AttributeValue"} + switch uv := v.(type) { + case *types.AttributeValueMemberEntityIdentifier: + if err := validateEntityIdentifier(&uv.Value); err != nil { + invalidParams.AddNested("[entityIdentifier]", err.(smithy.InvalidParamsError)) + } + + case *types.AttributeValueMemberRecord: + if err := validateRecordAttribute(uv.Value); err != nil { + invalidParams.AddNested("[record]", err.(smithy.InvalidParamsError)) + } + + case *types.AttributeValueMemberSet: + if err := validateSetAttribute(uv.Value); err != nil { + invalidParams.AddNested("[set]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCognitoUserPoolConfiguration(v *types.CognitoUserPoolConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CognitoUserPoolConfiguration"} + if v.UserPoolArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserPoolArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConfiguration(v types.Configuration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Configuration"} + switch uv := v.(type) { + case *types.ConfigurationMemberCognitoUserPoolConfiguration: + if err := validateCognitoUserPoolConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[cognitoUserPoolConfiguration]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateContextDefinition(v types.ContextDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ContextDefinition"} + switch uv := v.(type) { + case *types.ContextDefinitionMemberContextMap: + if err := validateContextMap(uv.Value); err != nil { + invalidParams.AddNested("[contextMap]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateContextMap(v map[string]types.AttributeValue) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ContextMap"} + for key := range v { + if err := validateAttributeValue(v[key]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEntitiesDefinition(v types.EntitiesDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntitiesDefinition"} + switch uv := v.(type) { + case *types.EntitiesDefinitionMemberEntityList: + if err := validateEntityList(uv.Value); err != nil { + invalidParams.AddNested("[entityList]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEntityAttributes(v map[string]types.AttributeValue) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntityAttributes"} + for key := range v { + if err := validateAttributeValue(v[key]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEntityIdentifier(v *types.EntityIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntityIdentifier"} + if v.EntityType == nil { + invalidParams.Add(smithy.NewErrParamRequired("EntityType")) + } + if v.EntityId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EntityId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEntityItem(v *types.EntityItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntityItem"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } else if v.Identifier != nil { + if err := validateEntityIdentifier(v.Identifier); err != nil { + invalidParams.AddNested("Identifier", err.(smithy.InvalidParamsError)) + } + } + if v.Attributes != nil { + if err := validateEntityAttributes(v.Attributes); err != nil { + invalidParams.AddNested("Attributes", err.(smithy.InvalidParamsError)) + } + } + if v.Parents != nil { + if err := validateParentList(v.Parents); err != nil { + invalidParams.AddNested("Parents", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEntityList(v []types.EntityItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntityList"} + for i := range v { + if err := validateEntityItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEntityReference(v types.EntityReference) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntityReference"} + switch uv := v.(type) { + case *types.EntityReferenceMemberIdentifier: + if err := validateEntityIdentifier(&uv.Value); err != nil { + invalidParams.AddNested("[identifier]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateParentList(v []types.EntityIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ParentList"} + for i := range v { + if err := validateEntityIdentifier(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePolicyDefinition(v types.PolicyDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PolicyDefinition"} + switch uv := v.(type) { + case *types.PolicyDefinitionMemberStatic: + if err := validateStaticPolicyDefinition(&uv.Value); err != nil { + invalidParams.AddNested("[static]", err.(smithy.InvalidParamsError)) + } + + case *types.PolicyDefinitionMemberTemplateLinked: + if err := validateTemplateLinkedPolicyDefinition(&uv.Value); err != nil { + invalidParams.AddNested("[templateLinked]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePolicyFilter(v *types.PolicyFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PolicyFilter"} + if v.Principal != nil { + if err := validateEntityReference(v.Principal); err != nil { + invalidParams.AddNested("Principal", err.(smithy.InvalidParamsError)) + } + } + if v.Resource != nil { + if err := validateEntityReference(v.Resource); err != nil { + invalidParams.AddNested("Resource", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRecordAttribute(v map[string]types.AttributeValue) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecordAttribute"} + for key := range v { + if err := validateAttributeValue(v[key]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSetAttribute(v []types.AttributeValue) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetAttribute"} + for i := range v { + if err := validateAttributeValue(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStaticPolicyDefinition(v *types.StaticPolicyDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StaticPolicyDefinition"} + if v.Statement == nil { + invalidParams.Add(smithy.NewErrParamRequired("Statement")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTemplateLinkedPolicyDefinition(v *types.TemplateLinkedPolicyDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TemplateLinkedPolicyDefinition"} + if v.PolicyTemplateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyTemplateId")) + } + if v.Principal != nil { + if err := validateEntityIdentifier(v.Principal); err != nil { + invalidParams.AddNested("Principal", err.(smithy.InvalidParamsError)) + } + } + if v.Resource != nil { + if err := validateEntityIdentifier(v.Resource); err != nil { + invalidParams.AddNested("Resource", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdateCognitoUserPoolConfiguration(v *types.UpdateCognitoUserPoolConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCognitoUserPoolConfiguration"} + if v.UserPoolArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserPoolArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdateConfiguration(v types.UpdateConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateConfiguration"} + switch uv := v.(type) { + case *types.UpdateConfigurationMemberCognitoUserPoolConfiguration: + if err := validateUpdateCognitoUserPoolConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[cognitoUserPoolConfiguration]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdatePolicyDefinition(v types.UpdatePolicyDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePolicyDefinition"} + switch uv := v.(type) { + case *types.UpdatePolicyDefinitionMemberStatic: + if err := validateUpdateStaticPolicyDefinition(&uv.Value); err != nil { + invalidParams.AddNested("[static]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdateStaticPolicyDefinition(v *types.UpdateStaticPolicyDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateStaticPolicyDefinition"} + if v.Statement == nil { + invalidParams.Add(smithy.NewErrParamRequired("Statement")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateValidationSettings(v *types.ValidationSettings) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ValidationSettings"} + if len(v.Mode) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Mode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateIdentitySourceInput(v *CreateIdentitySourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateIdentitySourceInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.Configuration == nil { + invalidParams.Add(smithy.NewErrParamRequired("Configuration")) + } else if v.Configuration != nil { + if err := validateConfiguration(v.Configuration); err != nil { + invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreatePolicyInput(v *CreatePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePolicyInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.Definition == nil { + invalidParams.Add(smithy.NewErrParamRequired("Definition")) + } else if v.Definition != nil { + if err := validatePolicyDefinition(v.Definition); err != nil { + invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreatePolicyStoreInput(v *CreatePolicyStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePolicyStoreInput"} + if v.ValidationSettings == nil { + invalidParams.Add(smithy.NewErrParamRequired("ValidationSettings")) + } else if v.ValidationSettings != nil { + if err := validateValidationSettings(v.ValidationSettings); err != nil { + invalidParams.AddNested("ValidationSettings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreatePolicyTemplateInput(v *CreatePolicyTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePolicyTemplateInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.Statement == nil { + invalidParams.Add(smithy.NewErrParamRequired("Statement")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteIdentitySourceInput(v *DeleteIdentitySourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIdentitySourceInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.IdentitySourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdentitySourceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeletePolicyInput(v *DeletePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePolicyInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.PolicyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeletePolicyStoreInput(v *DeletePolicyStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePolicyStoreInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeletePolicyTemplateInput(v *DeletePolicyTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePolicyTemplateInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.PolicyTemplateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyTemplateId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetIdentitySourceInput(v *GetIdentitySourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetIdentitySourceInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.IdentitySourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdentitySourceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetPolicyInput(v *GetPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPolicyInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.PolicyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetPolicyStoreInput(v *GetPolicyStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPolicyStoreInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetPolicyTemplateInput(v *GetPolicyTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPolicyTemplateInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.PolicyTemplateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyTemplateId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSchemaInput(v *GetSchemaInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSchemaInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpIsAuthorizedInput(v *IsAuthorizedInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsAuthorizedInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.Principal != nil { + if err := validateEntityIdentifier(v.Principal); err != nil { + invalidParams.AddNested("Principal", err.(smithy.InvalidParamsError)) + } + } + if v.Action != nil { + if err := validateActionIdentifier(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if v.Resource != nil { + if err := validateEntityIdentifier(v.Resource); err != nil { + invalidParams.AddNested("Resource", err.(smithy.InvalidParamsError)) + } + } + if v.Context != nil { + if err := validateContextDefinition(v.Context); err != nil { + invalidParams.AddNested("Context", err.(smithy.InvalidParamsError)) + } + } + if v.Entities != nil { + if err := validateEntitiesDefinition(v.Entities); err != nil { + invalidParams.AddNested("Entities", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpIsAuthorizedWithTokenInput(v *IsAuthorizedWithTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsAuthorizedWithTokenInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.Action != nil { + if err := validateActionIdentifier(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if v.Resource != nil { + if err := validateEntityIdentifier(v.Resource); err != nil { + invalidParams.AddNested("Resource", err.(smithy.InvalidParamsError)) + } + } + if v.Context != nil { + if err := validateContextDefinition(v.Context); err != nil { + invalidParams.AddNested("Context", err.(smithy.InvalidParamsError)) + } + } + if v.Entities != nil { + if err := validateEntitiesDefinition(v.Entities); err != nil { + invalidParams.AddNested("Entities", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListIdentitySourcesInput(v *ListIdentitySourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListIdentitySourcesInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListPoliciesInput(v *ListPoliciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListPoliciesInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.Filter != nil { + if err := validatePolicyFilter(v.Filter); err != nil { + invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListPolicyTemplatesInput(v *ListPolicyTemplatesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListPolicyTemplatesInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutSchemaInput(v *PutSchemaInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutSchemaInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.Definition == nil { + invalidParams.Add(smithy.NewErrParamRequired("Definition")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateIdentitySourceInput(v *UpdateIdentitySourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateIdentitySourceInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.IdentitySourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdentitySourceId")) + } + if v.UpdateConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("UpdateConfiguration")) + } else if v.UpdateConfiguration != nil { + if err := validateUpdateConfiguration(v.UpdateConfiguration); err != nil { + invalidParams.AddNested("UpdateConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdatePolicyInput(v *UpdatePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePolicyInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.PolicyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) + } + if v.Definition == nil { + invalidParams.Add(smithy.NewErrParamRequired("Definition")) + } else if v.Definition != nil { + if err := validateUpdatePolicyDefinition(v.Definition); err != nil { + invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdatePolicyStoreInput(v *UpdatePolicyStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePolicyStoreInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.ValidationSettings == nil { + invalidParams.Add(smithy.NewErrParamRequired("ValidationSettings")) + } else if v.ValidationSettings != nil { + if err := validateValidationSettings(v.ValidationSettings); err != nil { + invalidParams.AddNested("ValidationSettings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdatePolicyTemplateInput(v *UpdatePolicyTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePolicyTemplateInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.PolicyTemplateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyTemplateId")) + } + if v.Statement == nil { + invalidParams.Add(smithy.NewErrParamRequired("Statement")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/wafv2/api_op_GetWebACL.go b/service/wafv2/api_op_GetWebACL.go index 193e24a2ce4..318e31a1daf 100644 --- a/service/wafv2/api_op_GetWebACL.go +++ b/service/wafv2/api_op_GetWebACL.go @@ -61,10 +61,11 @@ type GetWebACLOutput struct { // The URL to use in SDK integrations with Amazon Web Services managed rule // groups. For example, you can use the integration SDKs with the account takeover - // prevention managed rule group AWSManagedRulesATPRuleSet . This is only populated - // if you are using a rule group in your web ACL that integrates with your - // applications in this way. For more information, see WAF client application - // integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html) + // prevention managed rule group AWSManagedRulesATPRuleSet and the account + // creation fraud prevention managed rule group AWSManagedRulesACFPRuleSet . This + // is only populated if you are using a rule group in your web ACL that integrates + // with your applications in this way. For more information, see WAF client + // application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html) // in the WAF Developer Guide. ApplicationIntegrationURL *string diff --git a/service/wafv2/deserializers.go b/service/wafv2/deserializers.go index 9acbf5d74b4..0ad7009319e 100644 --- a/service/wafv2/deserializers.go +++ b/service/wafv2/deserializers.go @@ -7301,6 +7301,80 @@ func awsAwsjson11_deserializeDocumentActionCondition(v **types.ActionCondition, return nil } +func awsAwsjson11_deserializeDocumentAddressField(v **types.AddressField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AddressField + if *v == nil { + sv = &types.AddressField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Identifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value) + } + sv.Identifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAddressFields(v *[]types.AddressField, 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.AddressField + if *v == nil { + cv = []types.AddressField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AddressField + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAddressField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentAll(v **types.All, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7579,6 +7653,74 @@ func awsAwsjson11_deserializeDocumentAssociationConfig(v **types.AssociationConf return nil } +func awsAwsjson11_deserializeDocumentAWSManagedRulesACFPRuleSet(v **types.AWSManagedRulesACFPRuleSet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AWSManagedRulesACFPRuleSet + if *v == nil { + sv = &types.AWSManagedRulesACFPRuleSet{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreationPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationPathString to be of type string, got %T instead", value) + } + sv.CreationPath = ptr.String(jtv) + } + + case "EnableRegexInPath": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableRegexInPath = jtv + } + + case "RegistrationPagePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistrationPagePathString to be of type string, got %T instead", value) + } + sv.RegistrationPagePath = ptr.String(jtv) + } + + case "RequestInspection": + if err := awsAwsjson11_deserializeDocumentRequestInspectionACFP(&sv.RequestInspection, value); err != nil { + return err + } + + case "ResponseInspection": + if err := awsAwsjson11_deserializeDocumentResponseInspection(&sv.ResponseInspection, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentAWSManagedRulesATPRuleSet(v **types.AWSManagedRulesATPRuleSet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7601,6 +7743,15 @@ func awsAwsjson11_deserializeDocumentAWSManagedRulesATPRuleSet(v **types.AWSMana for key, value := range shape { switch key { + case "EnableRegexInPath": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableRegexInPath = jtv + } + case "LoginPath": if value != nil { jtv, ok := value.(string) @@ -8669,6 +8820,46 @@ func awsAwsjson11_deserializeDocumentDefaultAction(v **types.DefaultAction, valu return nil } +func awsAwsjson11_deserializeDocumentEmailField(v **types.EmailField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EmailField + if *v == nil { + sv = &types.EmailField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Identifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value) + } + sv.Identifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentExcludedRule(v **types.ExcludedRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10588,6 +10779,11 @@ func awsAwsjson11_deserializeDocumentManagedRuleGroupConfig(v **types.ManagedRul for key, value := range shape { switch key { + case "AWSManagedRulesACFPRuleSet": + if err := awsAwsjson11_deserializeDocumentAWSManagedRulesACFPRuleSet(&sv.AWSManagedRulesACFPRuleSet, value); err != nil { + return err + } + case "AWSManagedRulesATPRuleSet": if err := awsAwsjson11_deserializeDocumentAWSManagedRulesATPRuleSet(&sv.AWSManagedRulesATPRuleSet, value); err != nil { return err @@ -11546,6 +11742,80 @@ func awsAwsjson11_deserializeDocumentPasswordField(v **types.PasswordField, valu return nil } +func awsAwsjson11_deserializeDocumentPhoneNumberField(v **types.PhoneNumberField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PhoneNumberField + if *v == nil { + sv = &types.PhoneNumberField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Identifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value) + } + sv.Identifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPhoneNumberFields(v *[]types.PhoneNumberField, 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.PhoneNumberField + if *v == nil { + cv = []types.PhoneNumberField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhoneNumberField + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPhoneNumberField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentPublishedVersions(v *map[string]types.ManagedRuleSetVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12739,6 +13009,71 @@ func awsAwsjson11_deserializeDocumentRequestInspection(v **types.RequestInspecti return nil } +func awsAwsjson11_deserializeDocumentRequestInspectionACFP(v **types.RequestInspectionACFP, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RequestInspectionACFP + if *v == nil { + sv = &types.RequestInspectionACFP{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AddressFields": + if err := awsAwsjson11_deserializeDocumentAddressFields(&sv.AddressFields, value); err != nil { + return err + } + + case "EmailField": + if err := awsAwsjson11_deserializeDocumentEmailField(&sv.EmailField, value); err != nil { + return err + } + + case "PasswordField": + if err := awsAwsjson11_deserializeDocumentPasswordField(&sv.PasswordField, value); err != nil { + return err + } + + case "PayloadType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PayloadType to be of type string, got %T instead", value) + } + sv.PayloadType = types.PayloadType(jtv) + } + + case "PhoneNumberFields": + if err := awsAwsjson11_deserializeDocumentPhoneNumberFields(&sv.PhoneNumberFields, value); err != nil { + return err + } + + case "UsernameField": + if err := awsAwsjson11_deserializeDocumentUsernameField(&sv.UsernameField, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/wafv2/serializers.go b/service/wafv2/serializers.go index c48d46cd42c..6d40ea446ca 100644 --- a/service/wafv2/serializers.go +++ b/service/wafv2/serializers.go @@ -2942,6 +2942,31 @@ func awsAwsjson11_serializeDocumentActionCondition(v *types.ActionCondition, val return nil } +func awsAwsjson11_serializeDocumentAddressField(v *types.AddressField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + return nil +} + +func awsAwsjson11_serializeDocumentAddressFields(v []types.AddressField, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentAddressField(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentAll(v *types.All, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3009,10 +3034,51 @@ func awsAwsjson11_serializeDocumentAssociationConfig(v *types.AssociationConfig, return nil } +func awsAwsjson11_serializeDocumentAWSManagedRulesACFPRuleSet(v *types.AWSManagedRulesACFPRuleSet, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CreationPath != nil { + ok := object.Key("CreationPath") + ok.String(*v.CreationPath) + } + + if v.EnableRegexInPath { + ok := object.Key("EnableRegexInPath") + ok.Boolean(v.EnableRegexInPath) + } + + if v.RegistrationPagePath != nil { + ok := object.Key("RegistrationPagePath") + ok.String(*v.RegistrationPagePath) + } + + if v.RequestInspection != nil { + ok := object.Key("RequestInspection") + if err := awsAwsjson11_serializeDocumentRequestInspectionACFP(v.RequestInspection, ok); err != nil { + return err + } + } + + if v.ResponseInspection != nil { + ok := object.Key("ResponseInspection") + if err := awsAwsjson11_serializeDocumentResponseInspection(v.ResponseInspection, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentAWSManagedRulesATPRuleSet(v *types.AWSManagedRulesATPRuleSet, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.EnableRegexInPath { + ok := object.Key("EnableRegexInPath") + ok.Boolean(v.EnableRegexInPath) + } + if v.LoginPath != nil { ok := object.Key("LoginPath") ok.String(*v.LoginPath) @@ -3402,6 +3468,18 @@ func awsAwsjson11_serializeDocumentDefaultAction(v *types.DefaultAction, value s return nil } +func awsAwsjson11_serializeDocumentEmailField(v *types.EmailField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + return nil +} + func awsAwsjson11_serializeDocumentExcludedRule(v *types.ExcludedRule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3912,6 +3990,13 @@ func awsAwsjson11_serializeDocumentManagedRuleGroupConfig(v *types.ManagedRuleGr object := value.Object() defer object.Close() + if v.AWSManagedRulesACFPRuleSet != nil { + ok := object.Key("AWSManagedRulesACFPRuleSet") + if err := awsAwsjson11_serializeDocumentAWSManagedRulesACFPRuleSet(v.AWSManagedRulesACFPRuleSet, ok); err != nil { + return err + } + } + if v.AWSManagedRulesATPRuleSet != nil { ok := object.Key("AWSManagedRulesATPRuleSet") if err := awsAwsjson11_serializeDocumentAWSManagedRulesATPRuleSet(v.AWSManagedRulesATPRuleSet, ok); err != nil { @@ -4091,6 +4176,31 @@ func awsAwsjson11_serializeDocumentPasswordField(v *types.PasswordField, value s return nil } +func awsAwsjson11_serializeDocumentPhoneNumberField(v *types.PhoneNumberField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + return nil +} + +func awsAwsjson11_serializeDocumentPhoneNumberFields(v []types.PhoneNumberField, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentPhoneNumberField(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentQueryString(v *types.QueryString, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4458,6 +4568,53 @@ func awsAwsjson11_serializeDocumentRequestInspection(v *types.RequestInspection, return nil } +func awsAwsjson11_serializeDocumentRequestInspectionACFP(v *types.RequestInspectionACFP, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddressFields != nil { + ok := object.Key("AddressFields") + if err := awsAwsjson11_serializeDocumentAddressFields(v.AddressFields, ok); err != nil { + return err + } + } + + if v.EmailField != nil { + ok := object.Key("EmailField") + if err := awsAwsjson11_serializeDocumentEmailField(v.EmailField, ok); err != nil { + return err + } + } + + if v.PasswordField != nil { + ok := object.Key("PasswordField") + if err := awsAwsjson11_serializeDocumentPasswordField(v.PasswordField, ok); err != nil { + return err + } + } + + if len(v.PayloadType) > 0 { + ok := object.Key("PayloadType") + ok.String(string(v.PayloadType)) + } + + if v.PhoneNumberFields != nil { + ok := object.Key("PhoneNumberFields") + if err := awsAwsjson11_serializeDocumentPhoneNumberFields(v.PhoneNumberFields, ok); err != nil { + return err + } + } + + if v.UsernameField != nil { + ok := object.Key("UsernameField") + if err := awsAwsjson11_serializeDocumentUsernameField(v.UsernameField, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentResponseInspection(v *types.ResponseInspection, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/wafv2/types/enums.go b/service/wafv2/types/enums.go index 5e438539f22..32e1d3288bb 100644 --- a/service/wafv2/types/enums.go +++ b/service/wafv2/types/enums.go @@ -887,6 +887,7 @@ const ( ParameterExceptionFieldAssociatedResourceType ParameterExceptionField = "ASSOCIATED_RESOURCE_TYPE" ParameterExceptionFieldScopeDown ParameterExceptionField = "SCOPE_DOWN" ParameterExceptionFieldCustomKeys ParameterExceptionField = "CUSTOM_KEYS" + ParameterExceptionFieldAcpRuleSetResponseInspection ParameterExceptionField = "ACP_RULE_SET_RESPONSE_INSPECTION" ) // Values returns all known values for ParameterExceptionField. Note that this can @@ -963,6 +964,7 @@ func (ParameterExceptionField) Values() []ParameterExceptionField { "ASSOCIATED_RESOURCE_TYPE", "SCOPE_DOWN", "CUSTOM_KEYS", + "ACP_RULE_SET_RESPONSE_INSPECTION", } } diff --git a/service/wafv2/types/types.go b/service/wafv2/types/types.go index 2c9f7f4a34c..199323cf469 100644 --- a/service/wafv2/types/types.go +++ b/service/wafv2/types/types.go @@ -23,6 +23,31 @@ type ActionCondition struct { noSmithyDocumentSerde } +// The name of a field in the request payload that contains part or all of your +// customer's primary physical address. This data type is used in the +// RequestInspectionACFP data type. +type AddressField struct { + + // The name of a single primary address field. How you specify the address fields + // depends on the request inspection payload type. + // - For JSON payloads, specify the field identifiers in JSON pointer syntax. + // For information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "primaryaddressline1": + // "THE_ADDRESS1", "primaryaddressline2": "THE_ADDRESS2", "primaryaddressline3": + // "THE_ADDRESS3" } } , the address field idenfiers are /form/primaryaddressline1 + // , /form/primaryaddressline2 , and /form/primaryaddressline3 . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with input elements named primaryaddressline1 , + // primaryaddressline2 , and primaryaddressline3 , the address fields identifiers + // are primaryaddressline1 , primaryaddressline2 , and primaryaddressline3 . + // + // This member is required. + Identifier *string + + noSmithyDocumentSerde +} + // Inspect all of the elements that WAF has parsed and extracted from the web // request component that you've identified in your FieldToMatch specifications. // This is used in the FieldToMatch specification for some web request component @@ -106,6 +131,51 @@ type AssociationConfig struct { noSmithyDocumentSerde } +// Details for your use of the account creation fraud prevention managed rule +// group, AWSManagedRulesACFPRuleSet . This configuration is used in +// ManagedRuleGroupConfig . +type AWSManagedRulesACFPRuleSet struct { + + // The path of the account creation endpoint for your application. This is the + // page on your website that accepts the completed registration form for a new + // user. This page must accept POST requests. For example, for the URL + // https://example.com/web/signup , you would provide the path /web/signup . + // + // This member is required. + CreationPath *string + + // The path of the account registration endpoint for your application. This is the + // page on your website that presents the registration form to new users. This page + // must accept GET text/html requests. For example, for the URL + // https://example.com/web/register , you would provide the path /web/register . + // + // This member is required. + RegistrationPagePath *string + + // The criteria for inspecting account creation requests, used by the ACFP rule + // group to validate and track account creation attempts. + // + // This member is required. + RequestInspection *RequestInspectionACFP + + // Allow the use of regular expressions in the registration page path and the + // account creation path. + EnableRegexInPath bool + + // The criteria for inspecting responses to account creation requests, used by the + // ACFP rule group to track account creation success rates. Response inspection is + // available only in web ACLs that protect Amazon CloudFront distributions. The + // ACFP rule group evaluates the responses that your protected resources send back + // to client account creation attempts, keeping count of successful and failed + // attempts from each IP address and client session. Using this information, the + // rule group labels and mitigates requests from client sessions and IP addresses + // that have had too many successful account creation attempts in a short amount of + // time. + ResponseInspection *ResponseInspection + + noSmithyDocumentSerde +} + // Details for your use of the account takeover prevention managed rule group, // AWSManagedRulesATPRuleSet . This configuration is used in ManagedRuleGroupConfig // . @@ -118,18 +188,21 @@ type AWSManagedRulesATPRuleSet struct { // This member is required. LoginPath *string + // Allow the use of regular expressions in the login page path. + EnableRegexInPath bool + // The criteria for inspecting login requests, used by the ATP rule group to // validate credentials usage. RequestInspection *RequestInspection // The criteria for inspecting responses to login requests, used by the ATP rule - // group to track login failure rates. The ATP rule group evaluates the responses - // that your protected resources send back to client login attempts, keeping count - // of successful and failed attempts from each IP address and client session. Using - // this information, the rule group labels and mitigates requests from client - // sessions and IP addresses that submit too many failed login attempts in a short - // amount of time. Response inspection is available only in web ACLs that protect - // Amazon CloudFront distributions. + // group to track login failure rates. Response inspection is available only in web + // ACLs that protect Amazon CloudFront distributions. The ATP rule group evaluates + // the responses that your protected resources send back to client login attempts, + // keeping count of successful and failed attempts for each IP address and client + // session. Using this information, the rule group labels and mitigates requests + // from client sessions and IP addresses that have had too many failed login + // attempts in a short amount of time. ResponseInspection *ResponseInspection noSmithyDocumentSerde @@ -583,6 +656,27 @@ type DefaultAction struct { noSmithyDocumentSerde } +// The name of the field in the request payload that contains your customer's +// email. This data type is used in the RequestInspectionACFP data type. +type EmailField struct { + + // The name of the email field. How you specify this depends on the request + // inspection payload type. + // - For JSON payloads, specify the field name in JSON pointer syntax. For + // information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "email": "THE_EMAIL" } } , the + // email field specification is /form/email . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with the input element named email1 , the email field + // specification is email1 . + // + // This member is required. + Identifier *string + + noSmithyDocumentSerde +} + // Specifies a single rule in a rule group whose action you want to override to // Count . Instead of this option, use RuleActionOverrides . It accepts any valid // action setting, including Count . @@ -633,8 +727,8 @@ type FieldToMatch struct { // Inspect a string containing the list of the request's header names, ordered as // they appear in the web request that WAF receives for inspection. WAF generates // the string and then uses that as the field to match component in its inspection. - // WAF separates the header names in the string using commas and no added spaces. - // Matches against the header order string are case insensitive. + // WAF separates the header names in the string using colons and no added spaces, + // for example host:user-agent:accept:authorization:referer . HeaderOrder *HeaderOrder // Inspect the request headers. You must configure scope and pattern matching @@ -867,8 +961,8 @@ type HeaderMatchPattern struct { // Inspect a string containing the list of the request's header names, ordered as // they appear in the web request that WAF receives for inspection. WAF generates // the string and then uses that as the field to match component in its inspection. -// WAF separates the header names in the string using commas and no added spaces. -// Matches against the header order string are case insensitive. +// WAF separates the header names in the string using colons and no added spaces, +// for example host:user-agent:accept:authorization:referer . type HeaderOrder struct { // What WAF should do if the headers of the request are more numerous or larger @@ -1365,8 +1459,11 @@ type LoggingConfiguration struct { // The parts of the request that you want to keep out of the logs. For example, if // you redact the SingleHeader field, the HEADER field in the logs will be REDACTED - // . You can specify only the following fields for redaction: UriPath , QueryString - // , SingleHeader , Method , and JsonBody . + // for all rules that use the SingleHeader FieldToMatch setting. Redaction applies + // only to the component that's specified in the rule's FieldToMatch setting, so + // the SingleHeader redaction doesn't apply to rules that use the Headers + // FieldToMatch . You can specify only the following fields for redaction: UriPath + // , QueryString , SingleHeader , and Method . RedactedFields []FieldToMatch noSmithyDocumentSerde @@ -1439,15 +1536,34 @@ type ManagedProductDescriptor struct { } // Additional information that's used by a managed rule group. Many managed rule -// groups don't require this. Use the AWSManagedRulesATPRuleSet configuration -// object for the account takeover prevention managed rule group, to provide -// information such as the sign-in page of your application and the type of content -// to accept or reject from the client. Use the AWSManagedRulesBotControlRuleSet -// configuration object to configure the protection level that you want the Bot -// Control rule group to use. For example specifications, see the examples section -// of CreateWebACL . +// groups don't require this. The rule groups used for intelligent threat +// mitigation require additional configuration: +// - Use the AWSManagedRulesACFPRuleSet configuration object to configure the +// account creation fraud prevention managed rule group. The configuration includes +// the registration and sign-up pages of your application and the locations in the +// account creation request payload of data, such as the user email and phone +// number fields. +// - Use the AWSManagedRulesATPRuleSet configuration object to configure the +// account takeover prevention managed rule group. The configuration includes the +// sign-in page of your application and the locations in the login request payload +// of data such as the username and password. +// - Use the AWSManagedRulesBotControlRuleSet configuration object to configure +// the protection level that you want the Bot Control rule group to use. +// +// For example specifications, see the examples section of CreateWebACL . type ManagedRuleGroupConfig struct { + // Additional configuration for using the account creation fraud prevention (ACFP) + // managed rule group, AWSManagedRulesACFPRuleSet . Use this to provide account + // creation request information to the rule group. For web ACLs that protect + // CloudFront distributions, use this to also provide the information about how + // your distribution responds to account creation requests. For information about + // using the ACFP managed rule group, see WAF Fraud Control account creation fraud + // prevention (ACFP) rule group (https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-acfp.html) + // and WAF Fraud Control account creation fraud prevention (ACFP) (https://docs.aws.amazon.com/waf/latest/developerguide/waf-acfp.html) + // in the WAF Developer Guide. + AWSManagedRulesACFPRuleSet *AWSManagedRulesACFPRuleSet + // Additional configuration for using the account takeover prevention (ATP) // managed rule group, AWSManagedRulesATPRuleSet . Use this to provide login // request information to the rule group. For web ACLs that protect CloudFront @@ -1473,22 +1589,25 @@ type ManagedRuleGroupConfig struct { // Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet LoginPath LoginPath *string - // Instead of this setting, provide your configuration under - // AWSManagedRulesATPRuleSet RequestInspection . + // Instead of this setting, provide your configuration under the request + // inspection configuration for AWSManagedRulesATPRuleSet or + // AWSManagedRulesACFPRuleSet . // // Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection // PasswordField PasswordField *PasswordField - // Instead of this setting, provide your configuration under - // AWSManagedRulesATPRuleSet RequestInspection . + // Instead of this setting, provide your configuration under the request + // inspection configuration for AWSManagedRulesATPRuleSet or + // AWSManagedRulesACFPRuleSet . // // Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection // PayloadType PayloadType PayloadType - // Instead of this setting, provide your configuration under - // AWSManagedRulesATPRuleSet RequestInspection . + // Instead of this setting, provide your configuration under the request + // inspection configuration for AWSManagedRulesATPRuleSet or + // AWSManagedRulesACFPRuleSet . // // Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection // UsernameField @@ -1504,9 +1623,11 @@ type ManagedRuleGroupConfig struct { // for example for use inside a NotStatement or OrStatement . It can only be // referenced as a top-level statement within a rule. You are charged additional // fees when you use the WAF Bot Control managed rule group -// AWSManagedRulesBotControlRuleSet or the WAF Fraud Control account takeover -// prevention (ATP) managed rule group AWSManagedRulesATPRuleSet . For more -// information, see WAF Pricing (http://aws.amazon.com/waf/pricing/) . +// AWSManagedRulesBotControlRuleSet , the WAF Fraud Control account takeover +// prevention (ATP) managed rule group AWSManagedRulesATPRuleSet , or the WAF Fraud +// Control account creation fraud prevention (ACFP) managed rule group +// AWSManagedRulesACFPRuleSet . For more information, see WAF Pricing (http://aws.amazon.com/waf/pricing/) +// . type ManagedRuleGroupStatement struct { // The name of the managed rule group. You use this, along with the vendor name, @@ -1527,12 +1648,19 @@ type ManagedRuleGroupStatement struct { ExcludedRules []ExcludedRule // Additional information that's used by a managed rule group. Many managed rule - // groups don't require this. Use the AWSManagedRulesATPRuleSet configuration - // object for the account takeover prevention managed rule group, to provide - // information such as the sign-in page of your application and the type of content - // to accept or reject from the client. Use the AWSManagedRulesBotControlRuleSet - // configuration object to configure the protection level that you want the Bot - // Control rule group to use. + // groups don't require this. The rule groups used for intelligent threat + // mitigation require additional configuration: + // - Use the AWSManagedRulesACFPRuleSet configuration object to configure the + // account creation fraud prevention managed rule group. The configuration includes + // the registration and sign-up pages of your application and the locations in the + // account creation request payload of data, such as the user email and phone + // number fields. + // - Use the AWSManagedRulesATPRuleSet configuration object to configure the + // account takeover prevention managed rule group. The configuration includes the + // sign-in page of your application and the locations in the login request payload + // of data such as the username and password. + // - Use the AWSManagedRulesBotControlRuleSet configuration object to configure + // the protection level that you want the Bot Control rule group to use. ManagedRuleGroupConfigs []ManagedRuleGroupConfig // Action settings to use in the place of the rule actions that are configured @@ -1835,11 +1963,47 @@ type OverrideAction struct { noSmithyDocumentSerde } -// Details about your login page password field for request inspection, used in -// the AWSManagedRulesATPRuleSet RequestInspection configuration. +// The name of the field in the request payload that contains your customer's +// password. This data type is used in the RequestInspection and +// RequestInspectionACFP data types. type PasswordField struct { - // The name of the password field. For example /form/password . + // The name of the password field. How you specify this depends on the request + // inspection payload type. + // - For JSON payloads, specify the field name in JSON pointer syntax. For + // information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } } + // , the password field specification is /form/password . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with the input element named password1 , the password field + // specification is password1 . + // + // This member is required. + Identifier *string + + noSmithyDocumentSerde +} + +// The name of a field in the request payload that contains part or all of your +// customer's primary phone number. This data type is used in the +// RequestInspectionACFP data type. +type PhoneNumberField struct { + + // The name of a single primary phone number field. How you specify the phone + // number fields depends on the request inspection payload type. + // - For JSON payloads, specify the field identifiers in JSON pointer syntax. + // For information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "primaryphoneline1": + // "THE_PHONE1", "primaryphoneline2": "THE_PHONE2", "primaryphoneline3": + // "THE_PHONE3" } } , the phone number field identifiers are + // /form/primaryphoneline1 , /form/primaryphoneline2 , and + // /form/primaryphoneline3 . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with input elements named primaryphoneline1 , primaryphoneline2 , + // and primaryphoneline3 , the phone number field identifiers are + // primaryphoneline1 , primaryphoneline2 , and primaryphoneline3 . // // This member is required. Identifier *string @@ -2386,18 +2550,16 @@ type RequestBodyAssociatedResourceTypeConfig struct { // password are provided. type RequestInspection struct { - // Details about your login page password field. How you specify this depends on - // the payload type. + // The name of the field in the request payload that contains your customer's + // password. How you specify this depends on the request inspection payload type. // - For JSON payloads, specify the field name in JSON pointer syntax. For // information about the JSON Pointer syntax, see the Internet Engineering Task // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) - // . For example, for the JSON payload { "login": { "username": "THE_USERNAME", - // "password": "THE_PASSWORD" } } , the username field specification is - // /login/username and the password field specification is /login/password . + // . For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } } + // , the password field specification is /form/password . // - For form encoded payload types, use the HTML form names. For example, for - // an HTML form with input elements named username1 and password1 , the username - // field specification is username1 and the password field specification is - // password1 . + // an HTML form with the input element named password1 , the password field + // specification is password1 . // // This member is required. PasswordField *PasswordField @@ -2407,51 +2569,141 @@ type RequestInspection struct { // This member is required. PayloadType PayloadType - // Details about your login page username field. How you specify this depends on - // the payload type. + // The name of the field in the request payload that contains your customer's + // username. How you specify this depends on the request inspection payload type. // - For JSON payloads, specify the field name in JSON pointer syntax. For // information about the JSON Pointer syntax, see the Internet Engineering Task // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) - // . For example, for the JSON payload { "login": { "username": "THE_USERNAME", - // "password": "THE_PASSWORD" } } , the username field specification is - // /login/username and the password field specification is /login/password . + // . For example, for the JSON payload { "form": { "username": "THE_USERNAME" } } + // , the username field specification is /form/username . // - For form encoded payload types, use the HTML form names. For example, for - // an HTML form with input elements named username1 and password1 , the username - // field specification is username1 and the password field specification is - // password1 . + // an HTML form with the input element named username1 , the username field + // specification is username1 + // + // This member is required. + UsernameField *UsernameField + + noSmithyDocumentSerde +} + +// The criteria for inspecting account creation requests, used by the ACFP rule +// group to validate and track account creation attempts. This is part of the +// AWSManagedRulesACFPRuleSet configuration in ManagedRuleGroupConfig . In these +// settings, you specify how your application accepts account creation attempts by +// providing the request payload type and the names of the fields within the +// request body where the username, password, email, and primary address and phone +// number fields are provided. +type RequestInspectionACFP struct { + + // The payload type for your account creation endpoint, either JSON or form + // encoded. // // This member is required. + PayloadType PayloadType + + // The names of the fields in the request payload that contain your customer's + // primary physical address. Order the address fields in the array exactly as they + // are ordered in the request payload. How you specify the address fields depends + // on the request inspection payload type. + // - For JSON payloads, specify the field identifiers in JSON pointer syntax. + // For information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "primaryaddressline1": + // "THE_ADDRESS1", "primaryaddressline2": "THE_ADDRESS2", "primaryaddressline3": + // "THE_ADDRESS3" } } , the address field idenfiers are /form/primaryaddressline1 + // , /form/primaryaddressline2 , and /form/primaryaddressline3 . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with input elements named primaryaddressline1 , + // primaryaddressline2 , and primaryaddressline3 , the address fields identifiers + // are primaryaddressline1 , primaryaddressline2 , and primaryaddressline3 . + AddressFields []AddressField + + // The name of the field in the request payload that contains your customer's + // email. How you specify this depends on the request inspection payload type. + // - For JSON payloads, specify the field name in JSON pointer syntax. For + // information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "email": "THE_EMAIL" } } , the + // email field specification is /form/email . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with the input element named email1 , the email field + // specification is email1 . + EmailField *EmailField + + // The name of the field in the request payload that contains your customer's + // password. How you specify this depends on the request inspection payload type. + // - For JSON payloads, specify the field name in JSON pointer syntax. For + // information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } } + // , the password field specification is /form/password . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with the input element named password1 , the password field + // specification is password1 . + PasswordField *PasswordField + + // The names of the fields in the request payload that contain your customer's + // primary phone number. Order the phone number fields in the array exactly as they + // are ordered in the request payload. How you specify the phone number fields + // depends on the request inspection payload type. + // - For JSON payloads, specify the field identifiers in JSON pointer syntax. + // For information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "primaryphoneline1": + // "THE_PHONE1", "primaryphoneline2": "THE_PHONE2", "primaryphoneline3": + // "THE_PHONE3" } } , the phone number field identifiers are + // /form/primaryphoneline1 , /form/primaryphoneline2 , and + // /form/primaryphoneline3 . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with input elements named primaryphoneline1 , primaryphoneline2 , + // and primaryphoneline3 , the phone number field identifiers are + // primaryphoneline1 , primaryphoneline2 , and primaryphoneline3 . + PhoneNumberFields []PhoneNumberField + + // The name of the field in the request payload that contains your customer's + // username. How you specify this depends on the request inspection payload type. + // - For JSON payloads, specify the field name in JSON pointer syntax. For + // information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "username": "THE_USERNAME" } } + // , the username field specification is /form/username . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with the input element named username1 , the username field + // specification is username1 UsernameField *UsernameField noSmithyDocumentSerde } -// The criteria for inspecting responses to login requests, used by the ATP rule -// group to track login failure rates. The ATP rule group evaluates the responses -// that your protected resources send back to client login attempts, keeping count -// of successful and failed attempts from each IP address and client session. Using -// this information, the rule group labels and mitigates requests from client -// sessions and IP addresses that submit too many failed login attempts in a short -// amount of time. Response inspection is available only in web ACLs that protect -// Amazon CloudFront distributions. This is part of the AWSManagedRulesATPRuleSet -// configuration in ManagedRuleGroupConfig . Enable login response inspection by -// configuring exactly one component of the response to inspect. You can't -// configure more than one. If you don't configure any of the response inspection -// options, response inspection is disabled. +// The criteria for inspecting responses to login requests and account creation +// requests, used by the ATP and ACFP rule groups to track login and account +// creation success and failure rates. Response inspection is available only in web +// ACLs that protect Amazon CloudFront distributions. The rule groups evaluates the +// responses that your protected resources send back to client login and account +// creation attempts, keeping count of successful and failed attempts from each IP +// address and client session. Using this information, the rule group labels and +// mitigates requests from client sessions and IP addresses with too much +// suspicious activity in a short amount of time. This is part of the +// AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet configurations in +// ManagedRuleGroupConfig . Enable response inspection by configuring exactly one +// component of the response to inspect, for example, Header or StatusCode . You +// can't configure more than one component for inspection. If you don't configure +// any of the response inspection options, response inspection is disabled. type ResponseInspection struct { - // Configures inspection of the response body. WAF can inspect the first 65,536 - // bytes (64 KB) of the response body. + // Configures inspection of the response body for success and failure indicators. + // WAF can inspect the first 65,536 bytes (64 KB) of the response body. BodyContains *ResponseInspectionBodyContains - // Configures inspection of the response header. + // Configures inspection of the response header for success and failure indicators. Header *ResponseInspectionHeader - // Configures inspection of the response JSON. WAF can inspect the first 65,536 - // bytes (64 KB) of the response JSON. + // Configures inspection of the response JSON for success and failure indicators. + // WAF can inspect the first 65,536 bytes (64 KB) of the response JSON. Json *ResponseInspectionJson - // Configures inspection of the response status code. + // Configures inspection of the response status code for success and failure + // indicators. StatusCode *ResponseInspectionStatusCode noSmithyDocumentSerde @@ -2459,23 +2711,26 @@ type ResponseInspection struct { // Configures inspection of the response body. WAF can inspect the first 65,536 // bytes (64 KB) of the response body. This is part of the ResponseInspection -// configuration for AWSManagedRulesATPRuleSet . Response inspection is available -// only in web ACLs that protect Amazon CloudFront distributions. +// configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet . +// Response inspection is available only in web ACLs that protect Amazon CloudFront +// distributions. type ResponseInspectionBodyContains struct { - // Strings in the body of the response that indicate a failed login attempt. To be - // counted as a failed login, the string can be anywhere in the body and must be an - // exact match, including case. Each string must be unique among the success and - // failure strings. JSON example: "FailureStrings": [ "Login failed" ] + // Strings in the body of the response that indicate a failed login or account + // creation attempt. To be counted as a failure, the string can be anywhere in the + // body and must be an exact match, including case. Each string must be unique + // among the success and failure strings. JSON example: "FailureStrings": [ + // "Request failed" ] // // This member is required. FailureStrings []string - // Strings in the body of the response that indicate a successful login attempt. - // To be counted as a successful login, the string can be anywhere in the body and - // must be an exact match, including case. Each string must be unique among the - // success and failure strings. JSON example: "SuccessStrings": [ "Login - // successful", "Welcome to our site!" ] + // Strings in the body of the response that indicate a successful login or account + // creation attempt. To be counted as a success, the string can be anywhere in the + // body and must be an exact match, including case. Each string must be unique + // among the success and failure strings. JSON examples: "SuccessStrings": [ + // "Login successful" ] and "SuccessStrings": [ "Account creation successful", + // "Welcome to our site!" ] // // This member is required. SuccessStrings []string @@ -2484,30 +2739,32 @@ type ResponseInspectionBodyContains struct { } // Configures inspection of the response header. This is part of the -// ResponseInspection configuration for AWSManagedRulesATPRuleSet . Response -// inspection is available only in web ACLs that protect Amazon CloudFront -// distributions. +// ResponseInspection configuration for AWSManagedRulesATPRuleSet and +// AWSManagedRulesACFPRuleSet . Response inspection is available only in web ACLs +// that protect Amazon CloudFront distributions. type ResponseInspectionHeader struct { // Values in the response header with the specified name that indicate a failed - // login attempt. To be counted as a failed login, the value must be an exact - // match, including case. Each value must be unique among the success and failure - // values. JSON example: "FailureValues": [ "LoginFailed", "Failed login" ] + // login or account creation attempt. To be counted as a failure, the value must be + // an exact match, including case. Each value must be unique among the success and + // failure values. JSON examples: "FailureValues": [ "LoginFailed", "Failed login" + // ] and "FailureValues": [ "AccountCreationFailed" ] // // This member is required. FailureValues []string // The name of the header to match against. The name must be an exact match, - // including case. JSON example: "Name": [ "LoginResult" ] + // including case. JSON example: "Name": [ "RequestResult" ] // // This member is required. Name *string // Values in the response header with the specified name that indicate a - // successful login attempt. To be counted as a successful login, the value must be - // an exact match, including case. Each value must be unique among the success and - // failure values. JSON example: "SuccessValues": [ "LoginPassed", "Successful - // login" ] + // successful login or account creation attempt. To be counted as a success, the + // value must be an exact match, including case. Each value must be unique among + // the success and failure values. JSON examples: "SuccessValues": [ + // "LoginPassed", "Successful login" ] and "SuccessValues": [ "AccountCreated", + // "Successful account creation" ] // // This member is required. SuccessValues []string @@ -2517,29 +2774,31 @@ type ResponseInspectionHeader struct { // Configures inspection of the response JSON. WAF can inspect the first 65,536 // bytes (64 KB) of the response JSON. This is part of the ResponseInspection -// configuration for AWSManagedRulesATPRuleSet . Response inspection is available -// only in web ACLs that protect Amazon CloudFront distributions. +// configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet . +// Response inspection is available only in web ACLs that protect Amazon CloudFront +// distributions. type ResponseInspectionJson struct { // Values for the specified identifier in the response JSON that indicate a failed - // login attempt. To be counted as a failed login, the value must be an exact - // match, including case. Each value must be unique among the success and failure - // values. JSON example: "FailureValues": [ "False", "Failed" ] + // login or account creation attempt. To be counted as a failure, the value must be + // an exact match, including case. Each value must be unique among the success and + // failure values. JSON example: "FailureValues": [ "False", "Failed" ] // // This member is required. FailureValues []string // The identifier for the value to match against in the JSON. The identifier must - // be an exact match, including case. JSON example: "Identifier": [ - // "/login/success" ] + // be an exact match, including case. JSON examples: "Identifier": [ + // "/login/success" ] and "Identifier": [ "/sign-up/success" ] // // This member is required. Identifier *string // Values for the specified identifier in the response JSON that indicate a - // successful login attempt. To be counted as a successful login, the value must be - // an exact match, including case. Each value must be unique among the success and - // failure values. JSON example: "SuccessValues": [ "True", "Succeeded" ] + // successful login or account creation attempt. To be counted as a success, the + // value must be an exact match, including case. Each value must be unique among + // the success and failure values. JSON example: "SuccessValues": [ "True", + // "Succeeded" ] // // This member is required. SuccessValues []string @@ -2548,23 +2807,23 @@ type ResponseInspectionJson struct { } // Configures inspection of the response status code. This is part of the -// ResponseInspection configuration for AWSManagedRulesATPRuleSet . Response -// inspection is available only in web ACLs that protect Amazon CloudFront -// distributions. +// ResponseInspection configuration for AWSManagedRulesATPRuleSet and +// AWSManagedRulesACFPRuleSet . Response inspection is available only in web ACLs +// that protect Amazon CloudFront distributions. type ResponseInspectionStatusCode struct { - // Status codes in the response that indicate a failed login attempt. To be - // counted as a failed login, the response status code must match one of these. - // Each code must be unique among the success and failure status codes. JSON + // Status codes in the response that indicate a failed login or account creation + // attempt. To be counted as a failure, the response status code must match one of + // these. Each code must be unique among the success and failure status codes. JSON // example: "FailureCodes": [ 400, 404 ] // // This member is required. FailureCodes []int32 - // Status codes in the response that indicate a successful login attempt. To be - // counted as a successful login, the response status code must match one of these. - // Each code must be unique among the success and failure status codes. JSON - // example: "SuccessCodes": [ 200, 201 ] + // Status codes in the response that indicate a successful login or account + // creation attempt. To be counted as a success, the response status code must + // match one of these. Each code must be unique among the success and failure + // status codes. JSON example: "SuccessCodes": [ 200, 201 ] // // This member is required. SuccessCodes []int32 @@ -3095,9 +3354,11 @@ type Statement struct { // for example for use inside a NotStatement or OrStatement . It can only be // referenced as a top-level statement within a rule. You are charged additional // fees when you use the WAF Bot Control managed rule group - // AWSManagedRulesBotControlRuleSet or the WAF Fraud Control account takeover - // prevention (ATP) managed rule group AWSManagedRulesATPRuleSet . For more - // information, see WAF Pricing (http://aws.amazon.com/waf/pricing/) . + // AWSManagedRulesBotControlRuleSet , the WAF Fraud Control account takeover + // prevention (ATP) managed rule group AWSManagedRulesATPRuleSet , or the WAF Fraud + // Control account creation fraud prevention (ACFP) managed rule group + // AWSManagedRulesACFPRuleSet . For more information, see WAF Pricing (http://aws.amazon.com/waf/pricing/) + // . ManagedRuleGroupStatement *ManagedRuleGroupStatement // A logical rule statement used to negate the results of another rule statement. @@ -3398,11 +3659,21 @@ type UriPath struct { noSmithyDocumentSerde } -// Details about your login page username field for request inspection, used in -// the AWSManagedRulesATPRuleSet RequestInspection configuration. +// The name of the field in the request payload that contains your customer's +// username. This data type is used in the RequestInspection and +// RequestInspectionACFP data types. type UsernameField struct { - // The name of the username field. For example /form/username . + // The name of the username field. How you specify this depends on the request + // inspection payload type. + // - For JSON payloads, specify the field name in JSON pointer syntax. For + // information about the JSON Pointer syntax, see the Internet Engineering Task + // Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) + // . For example, for the JSON payload { "form": { "username": "THE_USERNAME" } } + // , the username field specification is /form/username . + // - For form encoded payload types, use the HTML form names. For example, for + // an HTML form with the input element named username1 , the username field + // specification is username1 // // This member is required. Identifier *string diff --git a/service/wafv2/validators.go b/service/wafv2/validators.go index 130bed7b7f7..0fc186b829e 100644 --- a/service/wafv2/validators.go +++ b/service/wafv2/validators.go @@ -1273,6 +1273,38 @@ func validateActionCondition(v *types.ActionCondition) error { } } +func validateAddressField(v *types.AddressField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddressField"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAddressFields(v []types.AddressField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddressFields"} + for i := range v { + if err := validateAddressField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAllowAction(v *types.AllowAction) error { if v == nil { return nil @@ -1326,6 +1358,36 @@ func validateAssociationConfig(v *types.AssociationConfig) error { } } +func validateAWSManagedRulesACFPRuleSet(v *types.AWSManagedRulesACFPRuleSet) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AWSManagedRulesACFPRuleSet"} + if v.CreationPath == nil { + invalidParams.Add(smithy.NewErrParamRequired("CreationPath")) + } + if v.RegistrationPagePath == nil { + invalidParams.Add(smithy.NewErrParamRequired("RegistrationPagePath")) + } + if v.RequestInspection == nil { + invalidParams.Add(smithy.NewErrParamRequired("RequestInspection")) + } else if v.RequestInspection != nil { + if err := validateRequestInspectionACFP(v.RequestInspection); err != nil { + invalidParams.AddNested("RequestInspection", err.(smithy.InvalidParamsError)) + } + } + if v.ResponseInspection != nil { + if err := validateResponseInspection(v.ResponseInspection); err != nil { + invalidParams.AddNested("ResponseInspection", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAWSManagedRulesATPRuleSet(v *types.AWSManagedRulesATPRuleSet) error { if v == nil { return nil @@ -1692,6 +1754,21 @@ func validateDefaultAction(v *types.DefaultAction) error { } } +func validateEmailField(v *types.EmailField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EmailField"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateExcludedRule(v *types.ExcludedRule) error { if v == nil { return nil @@ -2093,6 +2170,11 @@ func validateManagedRuleGroupConfig(v *types.ManagedRuleGroupConfig) error { invalidParams.AddNested("AWSManagedRulesATPRuleSet", err.(smithy.InvalidParamsError)) } } + if v.AWSManagedRulesACFPRuleSet != nil { + if err := validateAWSManagedRulesACFPRuleSet(v.AWSManagedRulesACFPRuleSet); err != nil { + invalidParams.AddNested("AWSManagedRulesACFPRuleSet", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2225,6 +2307,38 @@ func validatePasswordField(v *types.PasswordField) error { } } +func validatePhoneNumberField(v *types.PhoneNumberField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PhoneNumberField"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePhoneNumberFields(v []types.PhoneNumberField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PhoneNumberFields"} + for i := range v { + if err := validatePhoneNumberField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRateBasedStatement(v *types.RateBasedStatement) error { if v == nil { return nil @@ -2546,6 +2660,46 @@ func validateRequestInspection(v *types.RequestInspection) error { } } +func validateRequestInspectionACFP(v *types.RequestInspectionACFP) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RequestInspectionACFP"} + if len(v.PayloadType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PayloadType")) + } + if v.UsernameField != nil { + if err := validateUsernameField(v.UsernameField); err != nil { + invalidParams.AddNested("UsernameField", err.(smithy.InvalidParamsError)) + } + } + if v.PasswordField != nil { + if err := validatePasswordField(v.PasswordField); err != nil { + invalidParams.AddNested("PasswordField", err.(smithy.InvalidParamsError)) + } + } + if v.EmailField != nil { + if err := validateEmailField(v.EmailField); err != nil { + invalidParams.AddNested("EmailField", err.(smithy.InvalidParamsError)) + } + } + if v.PhoneNumberFields != nil { + if err := validatePhoneNumberFields(v.PhoneNumberFields); err != nil { + invalidParams.AddNested("PhoneNumberFields", err.(smithy.InvalidParamsError)) + } + } + if v.AddressFields != nil { + if err := validateAddressFields(v.AddressFields); err != nil { + invalidParams.AddNested("AddressFields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateResponseInspection(v *types.ResponseInspection) error { if v == nil { return nil diff --git a/service/wellarchitected/api_op_AssociateProfiles.go b/service/wellarchitected/api_op_AssociateProfiles.go new file mode 100644 index 00000000000..a54de65f7c4 --- /dev/null +++ b/service/wellarchitected/api_op_AssociateProfiles.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Associate a profile with a workload. +func (c *Client) AssociateProfiles(ctx context.Context, params *AssociateProfilesInput, optFns ...func(*Options)) (*AssociateProfilesOutput, error) { + if params == nil { + params = &AssociateProfilesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateProfiles", params, optFns, c.addOperationAssociateProfilesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateProfilesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateProfilesInput struct { + + // The list of profile ARNs to associate with the workload. + // + // This member is required. + ProfileArns []string + + // The ID assigned to the workload. This ID is unique within an Amazon Web + // Services Region. + // + // This member is required. + WorkloadId *string + + noSmithyDocumentSerde +} + +type AssociateProfilesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateProfiles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateProfiles{}, 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 = addOpAssociateProfilesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateProfiles(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_opAssociateProfiles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "AssociateProfiles", + } +} diff --git a/service/wellarchitected/api_op_CreateLensShare.go b/service/wellarchitected/api_op_CreateLensShare.go index fe45a64fb11..e08986fb79f 100644 --- a/service/wellarchitected/api_op_CreateLensShare.go +++ b/service/wellarchitected/api_op_CreateLensShare.go @@ -65,7 +65,7 @@ type CreateLensShareInput struct { LensAlias *string // The Amazon Web Services account ID, IAM role, organization ID, or - // organizational unit (OU) ID with which the workload is shared. + // organizational unit (OU) ID with which the workload, lens, or profile is shared. // // This member is required. SharedWith *string @@ -75,7 +75,7 @@ type CreateLensShareInput struct { type CreateLensShareOutput struct { - // The ID associated with the workload share. + // The ID associated with the share. ShareId *string // Metadata pertaining to the operation's result. diff --git a/service/wellarchitected/api_op_CreateProfile.go b/service/wellarchitected/api_op_CreateProfile.go new file mode 100644 index 00000000000..b64686c33ee --- /dev/null +++ b/service/wellarchitected/api_op_CreateProfile.go @@ -0,0 +1,189 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a profile. +func (c *Client) CreateProfile(ctx context.Context, params *CreateProfileInput, optFns ...func(*Options)) (*CreateProfileOutput, error) { + if params == nil { + params = &CreateProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateProfile", params, optFns, c.addOperationCreateProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateProfileInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // The profile description. + // + // This member is required. + ProfileDescription *string + + // Name of the profile. + // + // This member is required. + ProfileName *string + + // The profile questions. + // + // This member is required. + ProfileQuestions []types.ProfileQuestionUpdate + + // The tags assigned to the profile. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateProfileOutput struct { + + // The profile ARN. + ProfileArn *string + + // Version of the profile. + ProfileVersion *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProfile{}, 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_opCreateProfileMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProfile(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_initializeOpCreateProfile struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateProfile) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateProfile) 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.(*CreateProfileInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProfileInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateProfileMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProfile{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "CreateProfile", + } +} diff --git a/service/wellarchitected/api_op_CreateProfileShare.go b/service/wellarchitected/api_op_CreateProfileShare.go new file mode 100644 index 00000000000..24ed1e3dc4b --- /dev/null +++ b/service/wellarchitected/api_op_CreateProfileShare.go @@ -0,0 +1,181 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Create a profile share. +func (c *Client) CreateProfileShare(ctx context.Context, params *CreateProfileShareInput, optFns ...func(*Options)) (*CreateProfileShareOutput, error) { + if params == nil { + params = &CreateProfileShareInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateProfileShare", params, optFns, c.addOperationCreateProfileShareMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateProfileShareOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateProfileShareInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // The profile ARN. + // + // This member is required. + ProfileArn *string + + // The Amazon Web Services account ID, IAM role, organization ID, or + // organizational unit (OU) ID with which the workload, lens, or profile is shared. + // + // This member is required. + SharedWith *string + + noSmithyDocumentSerde +} + +type CreateProfileShareOutput struct { + + // The profile ARN. + ProfileArn *string + + // The ID associated with the share. + ShareId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateProfileShareMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProfileShare{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProfileShare{}, 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_opCreateProfileShareMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateProfileShareValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProfileShare(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_initializeOpCreateProfileShare struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateProfileShare) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateProfileShare) 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.(*CreateProfileShareInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProfileShareInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateProfileShareMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProfileShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateProfileShare(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "CreateProfileShare", + } +} diff --git a/service/wellarchitected/api_op_CreateWorkload.go b/service/wellarchitected/api_op_CreateWorkload.go index 77879d26265..f372f1ec3ea 100644 --- a/service/wellarchitected/api_op_CreateWorkload.go +++ b/service/wellarchitected/api_op_CreateWorkload.go @@ -132,6 +132,9 @@ type CreateWorkloadInput struct { // plan. Each pillar is represented by its PillarReviewSummary$PillarId . PillarPriorities []string + // The list of profile ARNs associated with the workload. + ProfileArns []string + // The review owner of the workload. The name, email address, or identifier for // the primary group or individual that owns the workload review process. ReviewOwner *string diff --git a/service/wellarchitected/api_op_CreateWorkloadShare.go b/service/wellarchitected/api_op_CreateWorkloadShare.go index 67e8d8ef427..de1c4164889 100644 --- a/service/wellarchitected/api_op_CreateWorkloadShare.go +++ b/service/wellarchitected/api_op_CreateWorkloadShare.go @@ -49,13 +49,13 @@ type CreateWorkloadShareInput struct { // This member is required. ClientRequestToken *string - // Permission granted on a workload share. + // Permission granted on a share request. // // This member is required. PermissionType types.PermissionType // The Amazon Web Services account ID, IAM role, organization ID, or - // organizational unit (OU) ID with which the workload is shared. + // organizational unit (OU) ID with which the workload, lens, or profile is shared. // // This member is required. SharedWith *string @@ -72,7 +72,7 @@ type CreateWorkloadShareInput struct { // Input for Create Workload Share type CreateWorkloadShareOutput struct { - // The ID associated with the workload share. + // The ID associated with the share. ShareId *string // The ID assigned to the workload. This ID is unique within an Amazon Web diff --git a/service/wellarchitected/api_op_DeleteLensShare.go b/service/wellarchitected/api_op_DeleteLensShare.go index 563bce515ab..0e522e26e8f 100644 --- a/service/wellarchitected/api_op_DeleteLensShare.go +++ b/service/wellarchitected/api_op_DeleteLensShare.go @@ -60,7 +60,7 @@ type DeleteLensShareInput struct { // This member is required. LensAlias *string - // The ID associated with the workload share. + // The ID associated with the share. // // This member is required. ShareId *string diff --git a/service/wellarchitected/api_op_DeleteProfile.go b/service/wellarchitected/api_op_DeleteProfile.go new file mode 100644 index 00000000000..413eb064569 --- /dev/null +++ b/service/wellarchitected/api_op_DeleteProfile.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Delete a profile. Disclaimer By sharing your profile with other Amazon Web +// Services accounts, you acknowledge that Amazon Web Services will make your +// profile available to those other accounts. Those other accounts may continue to +// access and use your shared profile even if you delete the profile from your own +// Amazon Web Services account or terminate your Amazon Web Services account. +func (c *Client) DeleteProfile(ctx context.Context, params *DeleteProfileInput, optFns ...func(*Options)) (*DeleteProfileOutput, error) { + if params == nil { + params = &DeleteProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteProfile", params, optFns, c.addOperationDeleteProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProfileInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // The profile ARN. + // + // This member is required. + ProfileArn *string + + noSmithyDocumentSerde +} + +type DeleteProfileOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProfile{}, 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_opDeleteProfileMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfile(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_initializeOpDeleteProfile struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteProfile) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteProfile) 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.(*DeleteProfileInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteProfileInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opDeleteProfileMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteProfile{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "DeleteProfile", + } +} diff --git a/service/wellarchitected/api_op_DeleteProfileShare.go b/service/wellarchitected/api_op_DeleteProfileShare.go new file mode 100644 index 00000000000..fe2f3e4de39 --- /dev/null +++ b/service/wellarchitected/api_op_DeleteProfileShare.go @@ -0,0 +1,173 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Delete a profile share. +func (c *Client) DeleteProfileShare(ctx context.Context, params *DeleteProfileShareInput, optFns ...func(*Options)) (*DeleteProfileShareOutput, error) { + if params == nil { + params = &DeleteProfileShareInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteProfileShare", params, optFns, c.addOperationDeleteProfileShareMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProfileShareOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProfileShareInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // The profile ARN. + // + // This member is required. + ProfileArn *string + + // The ID associated with the share. + // + // This member is required. + ShareId *string + + noSmithyDocumentSerde +} + +type DeleteProfileShareOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteProfileShareMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProfileShare{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProfileShare{}, 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_opDeleteProfileShareMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteProfileShareValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfileShare(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_initializeOpDeleteProfileShare struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteProfileShare) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteProfileShare) 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.(*DeleteProfileShareInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteProfileShareInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opDeleteProfileShareMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteProfileShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteProfileShare(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "DeleteProfileShare", + } +} diff --git a/service/wellarchitected/api_op_DeleteWorkloadShare.go b/service/wellarchitected/api_op_DeleteWorkloadShare.go index d0705ddeae6..bd25996dd80 100644 --- a/service/wellarchitected/api_op_DeleteWorkloadShare.go +++ b/service/wellarchitected/api_op_DeleteWorkloadShare.go @@ -42,7 +42,7 @@ type DeleteWorkloadShareInput struct { // This member is required. ClientRequestToken *string - // The ID associated with the workload share. + // The ID associated with the share. // // This member is required. ShareId *string diff --git a/service/wellarchitected/api_op_DisassociateProfiles.go b/service/wellarchitected/api_op_DisassociateProfiles.go new file mode 100644 index 00000000000..02e6a307dbb --- /dev/null +++ b/service/wellarchitected/api_op_DisassociateProfiles.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Disassociate a profile from a workload. +func (c *Client) DisassociateProfiles(ctx context.Context, params *DisassociateProfilesInput, optFns ...func(*Options)) (*DisassociateProfilesOutput, error) { + if params == nil { + params = &DisassociateProfilesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateProfiles", params, optFns, c.addOperationDisassociateProfilesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateProfilesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateProfilesInput struct { + + // The list of profile ARNs to disassociate from the workload. + // + // This member is required. + ProfileArns []string + + // The ID assigned to the workload. This ID is unique within an Amazon Web + // Services Region. + // + // This member is required. + WorkloadId *string + + noSmithyDocumentSerde +} + +type DisassociateProfilesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociateProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateProfiles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateProfiles{}, 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 = addOpDisassociateProfilesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateProfiles(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_opDisassociateProfiles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "DisassociateProfiles", + } +} diff --git a/service/wellarchitected/api_op_GetProfile.go b/service/wellarchitected/api_op_GetProfile.go new file mode 100644 index 00000000000..072cd69df19 --- /dev/null +++ b/service/wellarchitected/api_op_GetProfile.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get profile information. +func (c *Client) GetProfile(ctx context.Context, params *GetProfileInput, optFns ...func(*Options)) (*GetProfileOutput, error) { + if params == nil { + params = &GetProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetProfile", params, optFns, c.addOperationGetProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetProfileInput struct { + + // The profile ARN. + // + // This member is required. + ProfileArn *string + + // The profile version. + ProfileVersion *string + + noSmithyDocumentSerde +} + +type GetProfileOutput struct { + + // The profile. + Profile *types.Profile + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProfile{}, 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 = addOpGetProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProfile(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_opGetProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetProfile", + } +} diff --git a/service/wellarchitected/api_op_GetProfileTemplate.go b/service/wellarchitected/api_op_GetProfileTemplate.go new file mode 100644 index 00000000000..8cd17342312 --- /dev/null +++ b/service/wellarchitected/api_op_GetProfileTemplate.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get profile template. +func (c *Client) GetProfileTemplate(ctx context.Context, params *GetProfileTemplateInput, optFns ...func(*Options)) (*GetProfileTemplateOutput, error) { + if params == nil { + params = &GetProfileTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetProfileTemplate", params, optFns, c.addOperationGetProfileTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetProfileTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetProfileTemplateInput struct { + noSmithyDocumentSerde +} + +type GetProfileTemplateOutput struct { + + // The profile template. + ProfileTemplate *types.ProfileTemplate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetProfileTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProfileTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProfileTemplate{}, 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_opGetProfileTemplate(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_opGetProfileTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetProfileTemplate", + } +} diff --git a/service/wellarchitected/api_op_ListAnswers.go b/service/wellarchitected/api_op_ListAnswers.go index ca0dd418dd1..28f3d087e33 100644 --- a/service/wellarchitected/api_op_ListAnswers.go +++ b/service/wellarchitected/api_op_ListAnswers.go @@ -61,6 +61,9 @@ type ListAnswersInput struct { // by its PillarReviewSummary$PillarId . PillarId *string + // The priority of the question. + QuestionPriority types.QuestionPriority + noSmithyDocumentSerde } diff --git a/service/wellarchitected/api_op_ListLensReviewImprovements.go b/service/wellarchitected/api_op_ListLensReviewImprovements.go index 1f13a69cdc9..89187ad3e7e 100644 --- a/service/wellarchitected/api_op_ListLensReviewImprovements.go +++ b/service/wellarchitected/api_op_ListLensReviewImprovements.go @@ -61,6 +61,9 @@ type ListLensReviewImprovementsInput struct { // by its PillarReviewSummary$PillarId . PillarId *string + // The priority of the question. + QuestionPriority types.QuestionPriority + noSmithyDocumentSerde } diff --git a/service/wellarchitected/api_op_ListLensShares.go b/service/wellarchitected/api_op_ListLensShares.go index fc90cf7d2f5..5b3fb8da4a5 100644 --- a/service/wellarchitected/api_op_ListLensShares.go +++ b/service/wellarchitected/api_op_ListLensShares.go @@ -51,7 +51,7 @@ type ListLensSharesInput struct { // organizational unit (OU) ID with which the lens is shared. SharedWithPrefix *string - // The status of a workload share. + // The status of the share request. Status types.ShareStatus noSmithyDocumentSerde diff --git a/service/wellarchitected/api_op_ListProfileNotifications.go b/service/wellarchitected/api_op_ListProfileNotifications.go new file mode 100644 index 00000000000..b9553df7adf --- /dev/null +++ b/service/wellarchitected/api_op_ListProfileNotifications.go @@ -0,0 +1,218 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List profile notifications. +func (c *Client) ListProfileNotifications(ctx context.Context, params *ListProfileNotificationsInput, optFns ...func(*Options)) (*ListProfileNotificationsOutput, error) { + if params == nil { + params = &ListProfileNotificationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProfileNotifications", params, optFns, c.addOperationListProfileNotificationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProfileNotificationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProfileNotificationsInput struct { + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID assigned to the workload. This ID is unique within an Amazon Web + // Services Region. + WorkloadId *string + + noSmithyDocumentSerde +} + +type ListProfileNotificationsOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // Notification summaries. + NotificationSummaries []types.ProfileNotificationSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListProfileNotificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProfileNotifications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProfileNotifications{}, 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_opListProfileNotifications(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 +} + +// ListProfileNotificationsAPIClient is a client that implements the +// ListProfileNotifications operation. +type ListProfileNotificationsAPIClient interface { + ListProfileNotifications(context.Context, *ListProfileNotificationsInput, ...func(*Options)) (*ListProfileNotificationsOutput, error) +} + +var _ ListProfileNotificationsAPIClient = (*Client)(nil) + +// ListProfileNotificationsPaginatorOptions is the paginator options for +// ListProfileNotifications +type ListProfileNotificationsPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListProfileNotificationsPaginator is a paginator for ListProfileNotifications +type ListProfileNotificationsPaginator struct { + options ListProfileNotificationsPaginatorOptions + client ListProfileNotificationsAPIClient + params *ListProfileNotificationsInput + nextToken *string + firstPage bool +} + +// NewListProfileNotificationsPaginator returns a new +// ListProfileNotificationsPaginator +func NewListProfileNotificationsPaginator(client ListProfileNotificationsAPIClient, params *ListProfileNotificationsInput, optFns ...func(*ListProfileNotificationsPaginatorOptions)) *ListProfileNotificationsPaginator { + if params == nil { + params = &ListProfileNotificationsInput{} + } + + options := ListProfileNotificationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListProfileNotificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProfileNotificationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListProfileNotifications page. +func (p *ListProfileNotificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfileNotificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListProfileNotifications(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_opListProfileNotifications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListProfileNotifications", + } +} diff --git a/service/wellarchitected/api_op_ListProfileShares.go b/service/wellarchitected/api_op_ListProfileShares.go new file mode 100644 index 00000000000..8d774b708e1 --- /dev/null +++ b/service/wellarchitected/api_op_ListProfileShares.go @@ -0,0 +1,227 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List profile shares. +func (c *Client) ListProfileShares(ctx context.Context, params *ListProfileSharesInput, optFns ...func(*Options)) (*ListProfileSharesOutput, error) { + if params == nil { + params = &ListProfileSharesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProfileShares", params, optFns, c.addOperationListProfileSharesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProfileSharesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProfileSharesInput struct { + + // The profile ARN. + // + // This member is required. + ProfileArn *string + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The Amazon Web Services account ID, IAM role, organization ID, or + // organizational unit (OU) ID with which the profile is shared. + SharedWithPrefix *string + + // The status of the share request. + Status types.ShareStatus + + noSmithyDocumentSerde +} + +type ListProfileSharesOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // Profile share summaries. + ProfileShareSummaries []types.ProfileShareSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListProfileSharesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProfileShares{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProfileShares{}, 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 = addOpListProfileSharesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProfileShares(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 +} + +// ListProfileSharesAPIClient is a client that implements the ListProfileShares +// operation. +type ListProfileSharesAPIClient interface { + ListProfileShares(context.Context, *ListProfileSharesInput, ...func(*Options)) (*ListProfileSharesOutput, error) +} + +var _ ListProfileSharesAPIClient = (*Client)(nil) + +// ListProfileSharesPaginatorOptions is the paginator options for ListProfileShares +type ListProfileSharesPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListProfileSharesPaginator is a paginator for ListProfileShares +type ListProfileSharesPaginator struct { + options ListProfileSharesPaginatorOptions + client ListProfileSharesAPIClient + params *ListProfileSharesInput + nextToken *string + firstPage bool +} + +// NewListProfileSharesPaginator returns a new ListProfileSharesPaginator +func NewListProfileSharesPaginator(client ListProfileSharesAPIClient, params *ListProfileSharesInput, optFns ...func(*ListProfileSharesPaginatorOptions)) *ListProfileSharesPaginator { + if params == nil { + params = &ListProfileSharesInput{} + } + + options := ListProfileSharesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListProfileSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProfileSharesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListProfileShares page. +func (p *ListProfileSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfileSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListProfileShares(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_opListProfileShares(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListProfileShares", + } +} diff --git a/service/wellarchitected/api_op_ListProfiles.go b/service/wellarchitected/api_op_ListProfiles.go new file mode 100644 index 00000000000..6089e0056c8 --- /dev/null +++ b/service/wellarchitected/api_op_ListProfiles.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List profiles. +func (c *Client) ListProfiles(ctx context.Context, params *ListProfilesInput, optFns ...func(*Options)) (*ListProfilesOutput, error) { + if params == nil { + params = &ListProfilesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProfiles", params, optFns, c.addOperationListProfilesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProfilesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProfilesInput struct { + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // Prefix for profile name. + ProfileNamePrefix *string + + // Profile owner type. + ProfileOwnerType types.ProfileOwnerType + + noSmithyDocumentSerde +} + +type ListProfilesOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // Profile summaries. + ProfileSummaries []types.ProfileSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProfiles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProfiles{}, 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_opListProfiles(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 +} + +// ListProfilesAPIClient is a client that implements the ListProfiles operation. +type ListProfilesAPIClient interface { + ListProfiles(context.Context, *ListProfilesInput, ...func(*Options)) (*ListProfilesOutput, error) +} + +var _ ListProfilesAPIClient = (*Client)(nil) + +// ListProfilesPaginatorOptions is the paginator options for ListProfiles +type ListProfilesPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListProfilesPaginator is a paginator for ListProfiles +type ListProfilesPaginator struct { + options ListProfilesPaginatorOptions + client ListProfilesAPIClient + params *ListProfilesInput + nextToken *string + firstPage bool +} + +// NewListProfilesPaginator returns a new ListProfilesPaginator +func NewListProfilesPaginator(client ListProfilesAPIClient, params *ListProfilesInput, optFns ...func(*ListProfilesPaginatorOptions)) *ListProfilesPaginator { + if params == nil { + params = &ListProfilesInput{} + } + + options := ListProfilesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProfilesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListProfiles page. +func (p *ListProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListProfiles(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_opListProfiles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListProfiles", + } +} diff --git a/service/wellarchitected/api_op_ListShareInvitations.go b/service/wellarchitected/api_op_ListShareInvitations.go index 2ceb001c644..ed6a25f7014 100644 --- a/service/wellarchitected/api_op_ListShareInvitations.go +++ b/service/wellarchitected/api_op_ListShareInvitations.go @@ -41,6 +41,9 @@ type ListShareInvitationsInput struct { // The token to use to retrieve the next set of results. NextToken *string + // Profile name prefix. + ProfileNamePrefix *string + // The type of share invitations to be returned. ShareResourceType types.ShareResourceType diff --git a/service/wellarchitected/api_op_ListTagsForResource.go b/service/wellarchitected/api_op_ListTagsForResource.go index f15acb34842..aa1f9b3908d 100644 --- a/service/wellarchitected/api_op_ListTagsForResource.go +++ b/service/wellarchitected/api_op_ListTagsForResource.go @@ -10,8 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List the tags for a resource. The WorkloadArn parameter can be either a -// workload ARN or a custom lens ARN. +// List the tags for a resource. The WorkloadArn parameter can be a workload ARN, +// a custom lens ARN, or a profile ARN. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} diff --git a/service/wellarchitected/api_op_ListWorkloadShares.go b/service/wellarchitected/api_op_ListWorkloadShares.go index 01272db23c4..4117e93eb2c 100644 --- a/service/wellarchitected/api_op_ListWorkloadShares.go +++ b/service/wellarchitected/api_op_ListWorkloadShares.go @@ -47,7 +47,7 @@ type ListWorkloadSharesInput struct { // organizational unit (OU) ID with which the workload is shared. SharedWithPrefix *string - // The status of a workload share. + // The status of the share request. Status types.ShareStatus noSmithyDocumentSerde diff --git a/service/wellarchitected/api_op_TagResource.go b/service/wellarchitected/api_op_TagResource.go index ce394b9c09b..6f57c0c4193 100644 --- a/service/wellarchitected/api_op_TagResource.go +++ b/service/wellarchitected/api_op_TagResource.go @@ -11,7 +11,7 @@ import ( ) // Adds one or more tags to the specified resource. The WorkloadArn parameter can -// be either a workload ARN or a custom lens ARN. +// be a workload ARN, a custom lens ARN, or a profile ARN. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} diff --git a/service/wellarchitected/api_op_UntagResource.go b/service/wellarchitected/api_op_UntagResource.go index 0690a30ac90..f6a0e5086a9 100644 --- a/service/wellarchitected/api_op_UntagResource.go +++ b/service/wellarchitected/api_op_UntagResource.go @@ -10,9 +10,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes specified tags from a resource. The WorkloadArn parameter can be either -// a workload ARN or a custom lens ARN. To specify multiple tags, use separate -// tagKeys parameters, for example: DELETE +// Deletes specified tags from a resource. The WorkloadArn parameter can be a +// workload ARN, a custom lens ARN, or a profile ARN. To specify multiple tags, use +// separate tagKeys parameters, for example: DELETE // /tags/WorkloadArn?tagKeys=key1&tagKeys=key2 func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { diff --git a/service/wellarchitected/api_op_UpdateProfile.go b/service/wellarchitected/api_op_UpdateProfile.go new file mode 100644 index 00000000000..83c52f61d6f --- /dev/null +++ b/service/wellarchitected/api_op_UpdateProfile.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a profile. +func (c *Client) UpdateProfile(ctx context.Context, params *UpdateProfileInput, optFns ...func(*Options)) (*UpdateProfileOutput, error) { + if params == nil { + params = &UpdateProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateProfile", params, optFns, c.addOperationUpdateProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateProfileInput struct { + + // The profile ARN. + // + // This member is required. + ProfileArn *string + + // The profile description. + ProfileDescription *string + + // Profile questions. + ProfileQuestions []types.ProfileQuestionUpdate + + noSmithyDocumentSerde +} + +type UpdateProfileOutput struct { + + // The profile. + Profile *types.Profile + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateProfile{}, 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 = addOpUpdateProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProfile(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_opUpdateProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateProfile", + } +} diff --git a/service/wellarchitected/api_op_UpdateWorkloadShare.go b/service/wellarchitected/api_op_UpdateWorkloadShare.go index 4d6696f0aae..e427e73d489 100644 --- a/service/wellarchitected/api_op_UpdateWorkloadShare.go +++ b/service/wellarchitected/api_op_UpdateWorkloadShare.go @@ -30,12 +30,12 @@ func (c *Client) UpdateWorkloadShare(ctx context.Context, params *UpdateWorkload // Input for Update Workload Share type UpdateWorkloadShareInput struct { - // Permission granted on a workload share. + // Permission granted on a share request. // // This member is required. PermissionType types.PermissionType - // The ID associated with the workload share. + // The ID associated with the share. // // This member is required. ShareId *string diff --git a/service/wellarchitected/api_op_UpgradeProfileVersion.go b/service/wellarchitected/api_op_UpgradeProfileVersion.go new file mode 100644 index 00000000000..13a756645d1 --- /dev/null +++ b/service/wellarchitected/api_op_UpgradeProfileVersion.go @@ -0,0 +1,176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Upgrade a profile. +func (c *Client) UpgradeProfileVersion(ctx context.Context, params *UpgradeProfileVersionInput, optFns ...func(*Options)) (*UpgradeProfileVersionOutput, error) { + if params == nil { + params = &UpgradeProfileVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpgradeProfileVersion", params, optFns, c.addOperationUpgradeProfileVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpgradeProfileVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpgradeProfileVersionInput struct { + + // The profile ARN. + // + // This member is required. + ProfileArn *string + + // The ID assigned to the workload. This ID is unique within an Amazon Web + // Services Region. + // + // This member is required. + WorkloadId *string + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. + ClientRequestToken *string + + // The name of the milestone in a workload. Milestone names must be unique within + // a workload. + MilestoneName *string + + noSmithyDocumentSerde +} + +type UpgradeProfileVersionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpgradeProfileVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpgradeProfileVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpgradeProfileVersion{}, 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_opUpgradeProfileVersionMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpgradeProfileVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpgradeProfileVersion(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_initializeOpUpgradeProfileVersion struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpgradeProfileVersion) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpgradeProfileVersion) 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.(*UpgradeProfileVersionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpgradeProfileVersionInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opUpgradeProfileVersionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpgradeProfileVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpgradeProfileVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpgradeProfileVersion", + } +} diff --git a/service/wellarchitected/deserializers.go b/service/wellarchitected/deserializers.go index 9f05da68bcf..cc83a32a8c9 100644 --- a/service/wellarchitected/deserializers.go +++ b/service/wellarchitected/deserializers.go @@ -124,6 +124,110 @@ func awsRestjson1_deserializeOpErrorAssociateLenses(response *smithyhttp.Respons } } +type awsRestjson1_deserializeOpAssociateProfiles struct { +} + +func (*awsRestjson1_deserializeOpAssociateProfiles) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateProfiles) HandleDeserialize(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_deserializeOpErrorAssociateProfiles(response, &metadata) + } + output := &AssociateProfilesOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociateProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + } +} + type awsRestjson1_deserializeOpCreateLensShare struct { } @@ -653,14 +757,14 @@ func awsRestjson1_deserializeOpDocumentCreateMilestoneOutput(v **CreateMilestone return nil } -type awsRestjson1_deserializeOpCreateWorkload struct { +type awsRestjson1_deserializeOpCreateProfile struct { } -func (*awsRestjson1_deserializeOpCreateWorkload) ID() string { +func (*awsRestjson1_deserializeOpCreateProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -674,9 +778,9 @@ func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkload(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateProfile(response, &metadata) } - output := &CreateWorkloadOutput{} + output := &CreateProfileOutput{} out.Result = output var buff [1024]byte @@ -697,7 +801,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -710,7 +814,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -760,9 +864,6 @@ func awsRestjson1_deserializeOpErrorCreateWorkload(response *smithyhttp.Response case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) @@ -782,7 +883,7 @@ func awsRestjson1_deserializeOpErrorCreateWorkload(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(v **CreateWorkloadOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateProfileOutput(v **CreateProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -795,31 +896,31 @@ func awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(v **CreateWorkloadOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateWorkloadOutput + var sv *CreateProfileOutput if *v == nil { - sv = &CreateWorkloadOutput{} + sv = &CreateProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "WorkloadArn": + case "ProfileArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) } - sv.WorkloadArn = ptr.String(jtv) + sv.ProfileArn = ptr.String(jtv) } - case "WorkloadId": + case "ProfileVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.ProfileVersion = ptr.String(jtv) } default: @@ -831,14 +932,14 @@ func awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(v **CreateWorkloadOu return nil } -type awsRestjson1_deserializeOpCreateWorkloadShare struct { +type awsRestjson1_deserializeOpCreateProfileShare struct { } -func (*awsRestjson1_deserializeOpCreateWorkloadShare) ID() string { +func (*awsRestjson1_deserializeOpCreateProfileShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateProfileShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -852,9 +953,9 @@ func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkloadShare(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateProfileShare(response, &metadata) } - output := &CreateWorkloadShareOutput{} + output := &CreateProfileShareOutput{} out.Result = output var buff [1024]byte @@ -875,7 +976,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateProfileShareOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -888,7 +989,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateProfileShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -960,7 +1061,7 @@ func awsRestjson1_deserializeOpErrorCreateWorkloadShare(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(v **CreateWorkloadShareOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateProfileShareOutput(v **CreateProfileShareOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -973,31 +1074,31 @@ func awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(v **CreateWorkl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateWorkloadShareOutput + var sv *CreateProfileShareOutput if *v == nil { - sv = &CreateWorkloadShareOutput{} + sv = &CreateProfileShareOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ShareId": + case "ProfileArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) } - sv.ShareId = ptr.String(jtv) + sv.ProfileArn = ptr.String(jtv) } - case "WorkloadId": + case "ShareId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.ShareId = ptr.String(jtv) } default: @@ -1009,14 +1110,14 @@ func awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(v **CreateWorkl return nil } -type awsRestjson1_deserializeOpDeleteLens struct { +type awsRestjson1_deserializeOpCreateWorkload struct { } -func (*awsRestjson1_deserializeOpDeleteLens) ID() string { +func (*awsRestjson1_deserializeOpCreateWorkload) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteLens) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1030,21 +1131,43 @@ func (m *awsRestjson1_deserializeOpDeleteLens) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteLens(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkload(response, &metadata) } - output := &DeleteLensOutput{} + output := &CreateWorkloadOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentCreateWorkloadOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteLens(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1097,6 +1220,9 @@ func awsRestjson1_deserializeOpErrorDeleteLens(response *smithyhttp.Response, me 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) @@ -1113,14 +1239,63 @@ func awsRestjson1_deserializeOpErrorDeleteLens(response *smithyhttp.Response, me } } -type awsRestjson1_deserializeOpDeleteLensShare struct { +func awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(v **CreateWorkloadOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWorkloadOutput + if *v == nil { + sv = &CreateWorkloadOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "WorkloadArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadArn to be of type string, got %T instead", value) + } + sv.WorkloadArn = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteLensShare) ID() string { +type awsRestjson1_deserializeOpCreateWorkloadShare struct { +} + +func (*awsRestjson1_deserializeOpCreateWorkloadShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteLensShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1134,21 +1309,43 @@ func (m *awsRestjson1_deserializeOpDeleteLensShare) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteLensShare(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkloadShare(response, &metadata) } - output := &DeleteLensShareOutput{} + output := &CreateWorkloadShareOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + 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 } - return out, metadata, err -} + err = awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(&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(), + } + } -func awsRestjson1_deserializeOpErrorDeleteLensShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1201,6 +1398,9 @@ func awsRestjson1_deserializeOpErrorDeleteLensShare(response *smithyhttp.Respons 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) @@ -1217,14 +1417,63 @@ func awsRestjson1_deserializeOpErrorDeleteLensShare(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteWorkload struct { +func awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(v **CreateWorkloadShareOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWorkloadShareOutput + if *v == nil { + sv = &CreateWorkloadShareOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ShareId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) + } + sv.ShareId = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteWorkload) ID() string { +type awsRestjson1_deserializeOpDeleteLens struct { +} + +func (*awsRestjson1_deserializeOpDeleteLens) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteLens) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1238,9 +1487,9 @@ func (m *awsRestjson1_deserializeOpDeleteWorkload) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkload(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteLens(response, &metadata) } - output := &DeleteWorkloadOutput{} + output := &DeleteLensOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1252,7 +1501,7 @@ func (m *awsRestjson1_deserializeOpDeleteWorkload) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteLens(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1321,14 +1570,14 @@ func awsRestjson1_deserializeOpErrorDeleteWorkload(response *smithyhttp.Response } } -type awsRestjson1_deserializeOpDeleteWorkloadShare struct { +type awsRestjson1_deserializeOpDeleteLensShare struct { } -func (*awsRestjson1_deserializeOpDeleteWorkloadShare) ID() string { +func (*awsRestjson1_deserializeOpDeleteLensShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteWorkloadShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteLensShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1342,9 +1591,9 @@ func (m *awsRestjson1_deserializeOpDeleteWorkloadShare) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkloadShare(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteLensShare(response, &metadata) } - output := &DeleteWorkloadShareOutput{} + output := &DeleteLensShareOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1356,7 +1605,7 @@ func (m *awsRestjson1_deserializeOpDeleteWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteLensShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1425,14 +1674,14 @@ func awsRestjson1_deserializeOpErrorDeleteWorkloadShare(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpDisassociateLenses struct { +type awsRestjson1_deserializeOpDeleteProfile struct { } -func (*awsRestjson1_deserializeOpDisassociateLenses) ID() string { +func (*awsRestjson1_deserializeOpDeleteProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1446,9 +1695,9 @@ func (m *awsRestjson1_deserializeOpDisassociateLenses) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateLenses(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteProfile(response, &metadata) } - output := &DisassociateLensesOutput{} + output := &DeleteProfileOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1460,7 +1709,7 @@ func (m *awsRestjson1_deserializeOpDisassociateLenses) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateLenses(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1529,14 +1778,14 @@ func awsRestjson1_deserializeOpErrorDisassociateLenses(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpExportLens struct { +type awsRestjson1_deserializeOpDeleteProfileShare struct { } -func (*awsRestjson1_deserializeOpExportLens) ID() string { +func (*awsRestjson1_deserializeOpDeleteProfileShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpExportLens) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteProfileShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1550,43 +1799,21 @@ func (m *awsRestjson1_deserializeOpExportLens) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorExportLens(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteProfileShare(response, &metadata) } - output := &ExportLensOutput{} + output := &DeleteProfileShareOutput{} 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_deserializeOpDocumentExportLensOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorExportLens(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteProfileShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1630,6 +1857,9 @@ func awsRestjson1_deserializeOpErrorExportLens(response *smithyhttp.Response, me 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) @@ -1652,54 +1882,14 @@ func awsRestjson1_deserializeOpErrorExportLens(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentExportLensOutput(v **ExportLensOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ExportLensOutput - if *v == nil { - sv = &ExportLensOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "LensJSON": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensJSON to be of type string, got %T instead", value) - } - sv.LensJSON = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetAnswer struct { +type awsRestjson1_deserializeOpDeleteWorkload struct { } -func (*awsRestjson1_deserializeOpGetAnswer) ID() string { +func (*awsRestjson1_deserializeOpDeleteWorkload) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1713,43 +1903,21 @@ func (m *awsRestjson1_deserializeOpGetAnswer) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAnswer(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkload(response, &metadata) } - output := &GetAnswerOutput{} + output := &DeleteWorkloadOutput{} 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_deserializeOpDocumentGetAnswerOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1793,6 +1961,9 @@ func awsRestjson1_deserializeOpErrorGetAnswer(response *smithyhttp.Response, met 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) @@ -1815,90 +1986,118 @@ func awsRestjson1_deserializeOpErrorGetAnswer(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentGetAnswerOutput(v **GetAnswerOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil +type awsRestjson1_deserializeOpDeleteWorkloadShare struct { +} + +func (*awsRestjson1_deserializeOpDeleteWorkloadShare) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWorkloadShare) HandleDeserialize(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 } - shape, ok := value.(map[string]interface{}) + response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - var sv *GetAnswerOutput - if *v == nil { - sv = &GetAnswerOutput{} - } else { - sv = *v + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkloadShare(response, &metadata) } + output := &DeleteWorkloadShareOutput{} + out.Result = output - for key, value := range shape { - switch key { - case "Answer": - if err := awsRestjson1_deserializeDocumentAnswer(&sv.Answer, value); err != nil { - return err - } + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } - case "LensAlias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) - } - sv.LensAlias = ptr.String(jtv) - } + return out, metadata, err +} - case "LensArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) - } - sv.LensArn = ptr.String(jtv) - } +func awsRestjson1_deserializeOpErrorDeleteWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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()) - case "MilestoneNumber": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MilestoneNumber = int32(i64) - } + errorCode := "UnknownError" + errorMessage := errorCode - case "WorkloadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) - } - sv.WorkloadId = ptr.String(jtv) - } + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } - default: - _, _ = key, value + 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 + } - *v = sv - return nil } -type awsRestjson1_deserializeOpGetConsolidatedReport struct { +type awsRestjson1_deserializeOpDisassociateLenses struct { } -func (*awsRestjson1_deserializeOpGetConsolidatedReport) ID() string { +func (*awsRestjson1_deserializeOpDisassociateLenses) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetConsolidatedReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1912,43 +2111,21 @@ func (m *awsRestjson1_deserializeOpGetConsolidatedReport) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetConsolidatedReport(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateLenses(response, &metadata) } - output := &GetConsolidatedReportOutput{} + output := &DisassociateLensesOutput{} 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_deserializeOpDocumentGetConsolidatedReportOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetConsolidatedReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateLenses(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1998,6 +2175,9 @@ func awsRestjson1_deserializeOpErrorGetConsolidatedReport(response *smithyhttp.R 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) @@ -2014,68 +2194,14 @@ func awsRestjson1_deserializeOpErrorGetConsolidatedReport(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentGetConsolidatedReportOutput(v **GetConsolidatedReportOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetConsolidatedReportOutput - if *v == nil { - sv = &GetConsolidatedReportOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Base64String": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Base64String to be of type string, got %T instead", value) - } - sv.Base64String = ptr.String(jtv) - } - - case "Metrics": - if err := awsRestjson1_deserializeDocumentConsolidatedReportMetrics(&sv.Metrics, 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_deserializeOpGetLens struct { +type awsRestjson1_deserializeOpDisassociateProfiles struct { } -func (*awsRestjson1_deserializeOpGetLens) ID() string { +func (*awsRestjson1_deserializeOpDisassociateProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetLens) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2089,43 +2215,21 @@ func (m *awsRestjson1_deserializeOpGetLens) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetLens(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateProfiles(response, &metadata) } - output := &GetLensOutput{} + output := &DisassociateProfilesOutput{} 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_deserializeOpDocumentGetLensOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetLens(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2169,6 +2273,9 @@ func awsRestjson1_deserializeOpErrorGetLens(response *smithyhttp.Response, metad 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) @@ -2191,66 +2298,30 @@ func awsRestjson1_deserializeOpErrorGetLens(response *smithyhttp.Response, metad } } -func awsRestjson1_deserializeOpDocumentGetLensOutput(v **GetLensOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil +type awsRestjson1_deserializeOpExportLens struct { +} + +func (*awsRestjson1_deserializeOpExportLens) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpExportLens) HandleDeserialize(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 } - shape, ok := value.(map[string]interface{}) + response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetLensOutput - if *v == nil { - sv = &GetLensOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Lens": - if err := awsRestjson1_deserializeDocumentLens(&sv.Lens, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetLensReview struct { -} - -func (*awsRestjson1_deserializeOpGetLensReview) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetLensReview) HandleDeserialize(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)} + 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_deserializeOpErrorGetLensReview(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorExportLens(response, &metadata) } - output := &GetLensReviewOutput{} + output := &ExportLensOutput{} out.Result = output var buff [1024]byte @@ -2271,7 +2342,7 @@ func (m *awsRestjson1_deserializeOpGetLensReview) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetLensReviewOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentExportLensOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2284,7 +2355,7 @@ func (m *awsRestjson1_deserializeOpGetLensReview) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorExportLens(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2350,7 +2421,7 @@ func awsRestjson1_deserializeOpErrorGetLensReview(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetLensReviewOutput(v **GetLensReviewOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentExportLensOutput(v **ExportLensOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2363,40 +2434,22 @@ func awsRestjson1_deserializeOpDocumentGetLensReviewOutput(v **GetLensReviewOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetLensReviewOutput + var sv *ExportLensOutput if *v == nil { - sv = &GetLensReviewOutput{} + sv = &ExportLensOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensReview": - if err := awsRestjson1_deserializeDocumentLensReview(&sv.LensReview, value); err != nil { - return err - } - - case "MilestoneNumber": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MilestoneNumber = int32(i64) - } - - case "WorkloadId": + case "LensJSON": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + return fmt.Errorf("expected LensJSON to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.LensJSON = ptr.String(jtv) } default: @@ -2408,14 +2461,14 @@ func awsRestjson1_deserializeOpDocumentGetLensReviewOutput(v **GetLensReviewOutp return nil } -type awsRestjson1_deserializeOpGetLensReviewReport struct { +type awsRestjson1_deserializeOpGetAnswer struct { } -func (*awsRestjson1_deserializeOpGetLensReviewReport) ID() string { +func (*awsRestjson1_deserializeOpGetAnswer) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetLensReviewReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2429,9 +2482,9 @@ func (m *awsRestjson1_deserializeOpGetLensReviewReport) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetLensReviewReport(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAnswer(response, &metadata) } - output := &GetLensReviewReportOutput{} + output := &GetAnswerOutput{} out.Result = output var buff [1024]byte @@ -2452,7 +2505,7 @@ func (m *awsRestjson1_deserializeOpGetLensReviewReport) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAnswerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2465,7 +2518,7 @@ func (m *awsRestjson1_deserializeOpGetLensReviewReport) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetLensReviewReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2531,7 +2584,7 @@ func awsRestjson1_deserializeOpErrorGetLensReviewReport(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(v **GetLensReviewReportOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAnswerOutput(v **GetAnswerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2544,20 +2597,38 @@ func awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(v **GetLensRevi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetLensReviewReportOutput + var sv *GetAnswerOutput if *v == nil { - sv = &GetLensReviewReportOutput{} + sv = &GetAnswerOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensReviewReport": - if err := awsRestjson1_deserializeDocumentLensReviewReport(&sv.LensReviewReport, value); err != nil { + case "Answer": + if err := awsRestjson1_deserializeDocumentAnswer(&sv.Answer, value); err != nil { return err } + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "LensArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + } + sv.LensArn = ptr.String(jtv) + } + case "MilestoneNumber": if value != nil { jtv, ok := value.(json.Number) @@ -2589,14 +2660,14 @@ func awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(v **GetLensRevi return nil } -type awsRestjson1_deserializeOpGetLensVersionDifference struct { +type awsRestjson1_deserializeOpGetConsolidatedReport struct { } -func (*awsRestjson1_deserializeOpGetLensVersionDifference) ID() string { +func (*awsRestjson1_deserializeOpGetConsolidatedReport) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetLensVersionDifference) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetConsolidatedReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2610,9 +2681,9 @@ func (m *awsRestjson1_deserializeOpGetLensVersionDifference) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetLensVersionDifference(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetConsolidatedReport(response, &metadata) } - output := &GetLensVersionDifferenceOutput{} + output := &GetConsolidatedReportOutput{} out.Result = output var buff [1024]byte @@ -2633,7 +2704,7 @@ func (m *awsRestjson1_deserializeOpGetLensVersionDifference) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetConsolidatedReportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2646,7 +2717,7 @@ func (m *awsRestjson1_deserializeOpGetLensVersionDifference) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetLensVersionDifference(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetConsolidatedReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2690,12 +2761,12 @@ func awsRestjson1_deserializeOpErrorGetLensVersionDifference(response *smithyhtt case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -2712,7 +2783,7 @@ func awsRestjson1_deserializeOpErrorGetLensVersionDifference(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(v **GetLensVersionDifferenceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetConsolidatedReportOutput(v **GetConsolidatedReportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2725,63 +2796,36 @@ func awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(v **GetLen return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetLensVersionDifferenceOutput + var sv *GetConsolidatedReportOutput if *v == nil { - sv = &GetLensVersionDifferenceOutput{} + sv = &GetConsolidatedReportOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "BaseLensVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) - } - sv.BaseLensVersion = ptr.String(jtv) - } - - case "LatestLensVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) - } - sv.LatestLensVersion = ptr.String(jtv) - } - - case "LensAlias": + case "Base64String": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + return fmt.Errorf("expected Base64String to be of type string, got %T instead", value) } - sv.LensAlias = ptr.String(jtv) + sv.Base64String = ptr.String(jtv) } - case "LensArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) - } - sv.LensArn = ptr.String(jtv) + case "Metrics": + if err := awsRestjson1_deserializeDocumentConsolidatedReportMetrics(&sv.Metrics, value); err != nil { + return err } - case "TargetLensVersion": + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.TargetLensVersion = ptr.String(jtv) - } - - case "VersionDifferences": - if err := awsRestjson1_deserializeDocumentVersionDifferences(&sv.VersionDifferences, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } default: @@ -2793,14 +2837,14 @@ func awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(v **GetLen return nil } -type awsRestjson1_deserializeOpGetMilestone struct { +type awsRestjson1_deserializeOpGetLens struct { } -func (*awsRestjson1_deserializeOpGetMilestone) ID() string { +func (*awsRestjson1_deserializeOpGetLens) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetMilestone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetLens) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2814,9 +2858,9 @@ func (m *awsRestjson1_deserializeOpGetMilestone) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetMilestone(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetLens(response, &metadata) } - output := &GetMilestoneOutput{} + output := &GetLensOutput{} out.Result = output var buff [1024]byte @@ -2837,7 +2881,7 @@ func (m *awsRestjson1_deserializeOpGetMilestone) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetMilestoneOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLensOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2850,7 +2894,7 @@ func (m *awsRestjson1_deserializeOpGetMilestone) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetMilestone(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetLens(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2916,7 +2960,7 @@ func awsRestjson1_deserializeOpErrorGetMilestone(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetMilestoneOutput(v **GetMilestoneOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLensOutput(v **GetLensOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2929,29 +2973,20 @@ func awsRestjson1_deserializeOpDocumentGetMilestoneOutput(v **GetMilestoneOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetMilestoneOutput + var sv *GetLensOutput if *v == nil { - sv = &GetMilestoneOutput{} + sv = &GetLensOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Milestone": - if err := awsRestjson1_deserializeDocumentMilestone(&sv.Milestone, value); err != nil { + case "Lens": + if err := awsRestjson1_deserializeDocumentLens(&sv.Lens, value); err != nil { return err } - case "WorkloadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) - } - sv.WorkloadId = ptr.String(jtv) - } - default: _, _ = key, value @@ -2961,14 +2996,14 @@ func awsRestjson1_deserializeOpDocumentGetMilestoneOutput(v **GetMilestoneOutput return nil } -type awsRestjson1_deserializeOpGetWorkload struct { +type awsRestjson1_deserializeOpGetLensReview struct { } -func (*awsRestjson1_deserializeOpGetWorkload) ID() string { +func (*awsRestjson1_deserializeOpGetLensReview) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2982,9 +3017,9 @@ func (m *awsRestjson1_deserializeOpGetWorkload) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetWorkload(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetLensReview(response, &metadata) } - output := &GetWorkloadOutput{} + output := &GetLensReviewOutput{} out.Result = output var buff [1024]byte @@ -3005,7 +3040,7 @@ func (m *awsRestjson1_deserializeOpGetWorkload) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetWorkloadOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLensReviewOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3018,7 +3053,7 @@ func (m *awsRestjson1_deserializeOpGetWorkload) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3084,7 +3119,7 @@ func awsRestjson1_deserializeOpErrorGetWorkload(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentGetWorkloadOutput(v **GetWorkloadOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLensReviewOutput(v **GetLensReviewOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3097,37 +3132,59 @@ func awsRestjson1_deserializeOpDocumentGetWorkloadOutput(v **GetWorkloadOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetWorkloadOutput + var sv *GetLensReviewOutput if *v == nil { - sv = &GetWorkloadOutput{} + sv = &GetLensReviewOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Workload": - if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { + case "LensReview": + if err := awsRestjson1_deserializeDocumentLensReview(&sv.LensReview, value); err != nil { return err } - default: - _, _ = key, value - - } - } - *v = sv + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv return nil } -type awsRestjson1_deserializeOpImportLens struct { +type awsRestjson1_deserializeOpGetLensReviewReport struct { } -func (*awsRestjson1_deserializeOpImportLens) ID() string { +func (*awsRestjson1_deserializeOpGetLensReviewReport) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpImportLens) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetLensReviewReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3141,9 +3198,9 @@ func (m *awsRestjson1_deserializeOpImportLens) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorImportLens(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetLensReviewReport(response, &metadata) } - output := &ImportLensOutput{} + output := &GetLensReviewReportOutput{} out.Result = output var buff [1024]byte @@ -3164,7 +3221,7 @@ func (m *awsRestjson1_deserializeOpImportLens) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentImportLensOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3177,7 +3234,7 @@ func (m *awsRestjson1_deserializeOpImportLens) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorImportLens(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetLensReviewReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3221,18 +3278,12 @@ func awsRestjson1_deserializeOpErrorImportLens(response *smithyhttp.Response, me 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) @@ -3249,7 +3300,7 @@ func awsRestjson1_deserializeOpErrorImportLens(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentImportLensOutput(v **ImportLensOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(v **GetLensReviewReportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3262,31 +3313,40 @@ func awsRestjson1_deserializeOpDocumentImportLensOutput(v **ImportLensOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ImportLensOutput + var sv *GetLensReviewReportOutput if *v == nil { - sv = &ImportLensOutput{} + sv = &GetLensReviewReportOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensArn": + case "LensReviewReport": + if err := awsRestjson1_deserializeDocumentLensReviewReport(&sv.LensReviewReport, value); err != nil { + return err + } + + case "MilestoneNumber": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) } - case "Status": + case "WorkloadId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImportLensStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) } - sv.Status = types.ImportLensStatus(jtv) + sv.WorkloadId = ptr.String(jtv) } default: @@ -3298,14 +3358,14 @@ func awsRestjson1_deserializeOpDocumentImportLensOutput(v **ImportLensOutput, va return nil } -type awsRestjson1_deserializeOpListAnswers struct { +type awsRestjson1_deserializeOpGetLensVersionDifference struct { } -func (*awsRestjson1_deserializeOpListAnswers) ID() string { +func (*awsRestjson1_deserializeOpGetLensVersionDifference) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAnswers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetLensVersionDifference) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3319,9 +3379,9 @@ func (m *awsRestjson1_deserializeOpListAnswers) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAnswers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetLensVersionDifference(response, &metadata) } - output := &ListAnswersOutput{} + output := &GetLensVersionDifferenceOutput{} out.Result = output var buff [1024]byte @@ -3342,7 +3402,7 @@ func (m *awsRestjson1_deserializeOpListAnswers) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAnswersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3355,7 +3415,7 @@ func (m *awsRestjson1_deserializeOpListAnswers) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAnswers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetLensVersionDifference(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3421,7 +3481,7 @@ func awsRestjson1_deserializeOpErrorListAnswers(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(v **GetLensVersionDifferenceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3434,67 +3494,63 @@ func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAnswersOutput + var sv *GetLensVersionDifferenceOutput if *v == nil { - sv = &ListAnswersOutput{} + sv = &GetLensVersionDifferenceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AnswerSummaries": - if err := awsRestjson1_deserializeDocumentAnswerSummaries(&sv.AnswerSummaries, value); err != nil { - return err - } - - case "LensAlias": + case "BaseLensVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) } - sv.LensAlias = ptr.String(jtv) + sv.BaseLensVersion = ptr.String(jtv) } - case "LensArn": + case "LatestLensVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.LatestLensVersion = ptr.String(jtv) } - case "MilestoneNumber": + case "LensAlias": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) } - sv.MilestoneNumber = int32(i64) + sv.LensAlias = ptr.String(jtv) } - case "NextToken": + case "LensArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.LensArn = ptr.String(jtv) } - case "WorkloadId": + case "TargetLensVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.TargetLensVersion = ptr.String(jtv) + } + + case "VersionDifferences": + if err := awsRestjson1_deserializeDocumentVersionDifferences(&sv.VersionDifferences, value); err != nil { + return err } default: @@ -3506,14 +3562,14 @@ func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, return nil } -type awsRestjson1_deserializeOpListCheckDetails struct { +type awsRestjson1_deserializeOpGetMilestone struct { } -func (*awsRestjson1_deserializeOpListCheckDetails) ID() string { +func (*awsRestjson1_deserializeOpGetMilestone) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCheckDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetMilestone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3527,9 +3583,9 @@ func (m *awsRestjson1_deserializeOpListCheckDetails) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCheckDetails(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetMilestone(response, &metadata) } - output := &ListCheckDetailsOutput{} + output := &GetMilestoneOutput{} out.Result = output var buff [1024]byte @@ -3550,7 +3606,7 @@ func (m *awsRestjson1_deserializeOpListCheckDetails) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetMilestoneOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3563,7 +3619,7 @@ func (m *awsRestjson1_deserializeOpListCheckDetails) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCheckDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetMilestone(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3629,7 +3685,7 @@ func awsRestjson1_deserializeOpErrorListCheckDetails(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(v **ListCheckDetailsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetMilestoneOutput(v **GetMilestoneOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3642,27 +3698,27 @@ func awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(v **ListCheckDetai return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCheckDetailsOutput + var sv *GetMilestoneOutput if *v == nil { - sv = &ListCheckDetailsOutput{} + sv = &GetMilestoneOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CheckDetails": - if err := awsRestjson1_deserializeDocumentCheckDetails(&sv.CheckDetails, value); err != nil { + case "Milestone": + if err := awsRestjson1_deserializeDocumentMilestone(&sv.Milestone, value); err != nil { return err } - case "NextToken": + case "WorkloadId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.WorkloadId = ptr.String(jtv) } default: @@ -3674,14 +3730,14 @@ func awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(v **ListCheckDetai return nil } -type awsRestjson1_deserializeOpListCheckSummaries struct { +type awsRestjson1_deserializeOpGetProfile struct { } -func (*awsRestjson1_deserializeOpListCheckSummaries) ID() string { +func (*awsRestjson1_deserializeOpGetProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCheckSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3695,9 +3751,9 @@ func (m *awsRestjson1_deserializeOpListCheckSummaries) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCheckSummaries(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetProfile(response, &metadata) } - output := &ListCheckSummariesOutput{} + output := &GetProfileOutput{} out.Result = output var buff [1024]byte @@ -3718,7 +3774,7 @@ func (m *awsRestjson1_deserializeOpListCheckSummaries) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3731,7 +3787,7 @@ func (m *awsRestjson1_deserializeOpListCheckSummaries) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCheckSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3797,7 +3853,7 @@ func awsRestjson1_deserializeOpErrorListCheckSummaries(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(v **ListCheckSummariesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetProfileOutput(v **GetProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3810,29 +3866,20 @@ func awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(v **ListCheckSum return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCheckSummariesOutput + var sv *GetProfileOutput if *v == nil { - sv = &ListCheckSummariesOutput{} + sv = &GetProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CheckSummaries": - if err := awsRestjson1_deserializeDocumentCheckSummaries(&sv.CheckSummaries, value); err != nil { + case "Profile": + if err := awsRestjson1_deserializeDocumentProfile(&sv.Profile, 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 @@ -3842,14 +3889,14 @@ func awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(v **ListCheckSum return nil } -type awsRestjson1_deserializeOpListLenses struct { +type awsRestjson1_deserializeOpGetProfileTemplate struct { } -func (*awsRestjson1_deserializeOpListLenses) ID() string { +func (*awsRestjson1_deserializeOpGetProfileTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetProfileTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3863,9 +3910,9 @@ func (m *awsRestjson1_deserializeOpListLenses) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListLenses(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetProfileTemplate(response, &metadata) } - output := &ListLensesOutput{} + output := &GetProfileTemplateOutput{} out.Result = output var buff [1024]byte @@ -3886,7 +3933,7 @@ func (m *awsRestjson1_deserializeOpListLenses) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLensesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetProfileTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3899,7 +3946,7 @@ func (m *awsRestjson1_deserializeOpListLenses) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLenses(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetProfileTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3946,6 +3993,9 @@ func awsRestjson1_deserializeOpErrorListLenses(response *smithyhttp.Response, me 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) @@ -3962,7 +4012,7 @@ func awsRestjson1_deserializeOpErrorListLenses(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetProfileTemplateOutput(v **GetProfileTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3975,29 +4025,20 @@ func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLensesOutput + var sv *GetProfileTemplateOutput if *v == nil { - sv = &ListLensesOutput{} + sv = &GetProfileTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensSummaries": - if err := awsRestjson1_deserializeDocumentLensSummaries(&sv.LensSummaries, value); err != nil { + case "ProfileTemplate": + if err := awsRestjson1_deserializeDocumentProfileTemplate(&sv.ProfileTemplate, 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 @@ -4007,14 +4048,14 @@ func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, va return nil } -type awsRestjson1_deserializeOpListLensReviewImprovements struct { +type awsRestjson1_deserializeOpGetWorkload struct { } -func (*awsRestjson1_deserializeOpListLensReviewImprovements) ID() string { +func (*awsRestjson1_deserializeOpGetWorkload) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4028,9 +4069,9 @@ func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListLensReviewImprovements(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetWorkload(response, &metadata) } - output := &ListLensReviewImprovementsOutput{} + output := &GetWorkloadOutput{} out.Result = output var buff [1024]byte @@ -4051,7 +4092,7 @@ func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetWorkloadOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4064,7 +4105,7 @@ func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLensReviewImprovements(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4130,7 +4171,7 @@ func awsRestjson1_deserializeOpErrorListLensReviewImprovements(response *smithyh } } -func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **ListLensReviewImprovementsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetWorkloadOutput(v **GetWorkloadOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4143,71 +4184,22 @@ func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **List return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLensReviewImprovementsOutput + var sv *GetWorkloadOutput if *v == nil { - sv = &ListLensReviewImprovementsOutput{} + sv = &GetWorkloadOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ImprovementSummaries": - if err := awsRestjson1_deserializeDocumentImprovementSummaries(&sv.ImprovementSummaries, value); err != nil { + case "Workload": + if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { return err } - case "LensAlias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) - } - sv.LensAlias = ptr.String(jtv) - } - - case "LensArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) - } - sv.LensArn = ptr.String(jtv) - } - - case "MilestoneNumber": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MilestoneNumber = int32(i64) - } - - 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 "WorkloadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) - } - sv.WorkloadId = ptr.String(jtv) - } - - default: - _, _ = key, value + default: + _, _ = key, value } } @@ -4215,14 +4207,14 @@ func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **List return nil } -type awsRestjson1_deserializeOpListLensReviews struct { +type awsRestjson1_deserializeOpImportLens struct { } -func (*awsRestjson1_deserializeOpListLensReviews) ID() string { +func (*awsRestjson1_deserializeOpImportLens) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLensReviews) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpImportLens) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4236,9 +4228,9 @@ func (m *awsRestjson1_deserializeOpListLensReviews) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListLensReviews(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorImportLens(response, &metadata) } - output := &ListLensReviewsOutput{} + output := &ImportLensOutput{} out.Result = output var buff [1024]byte @@ -4259,7 +4251,7 @@ func (m *awsRestjson1_deserializeOpListLensReviews) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLensReviewsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentImportLensOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4272,7 +4264,7 @@ func (m *awsRestjson1_deserializeOpListLensReviews) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLensReviews(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorImportLens(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4316,12 +4308,18 @@ func awsRestjson1_deserializeOpErrorListLensReviews(response *smithyhttp.Respons case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4338,7 +4336,7 @@ func awsRestjson1_deserializeOpErrorListLensReviews(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviewsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentImportLensOutput(v **ImportLensOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4351,49 +4349,31 @@ func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviews return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLensReviewsOutput + var sv *ImportLensOutput if *v == nil { - sv = &ListLensReviewsOutput{} + sv = &ImportLensOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensReviewSummaries": - if err := awsRestjson1_deserializeDocumentLensReviewSummaries(&sv.LensReviewSummaries, value); err != nil { - return err - } - - case "MilestoneNumber": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MilestoneNumber = int32(i64) - } - - case "NextToken": + case "LensArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.LensArn = ptr.String(jtv) } - case "WorkloadId": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + return fmt.Errorf("expected ImportLensStatus to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.Status = types.ImportLensStatus(jtv) } default: @@ -4405,14 +4385,14 @@ func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviews return nil } -type awsRestjson1_deserializeOpListLensShares struct { +type awsRestjson1_deserializeOpListAnswers struct { } -func (*awsRestjson1_deserializeOpListLensShares) ID() string { +func (*awsRestjson1_deserializeOpListAnswers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLensShares) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAnswers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4426,9 +4406,9 @@ func (m *awsRestjson1_deserializeOpListLensShares) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListLensShares(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAnswers(response, &metadata) } - output := &ListLensSharesOutput{} + output := &ListAnswersOutput{} out.Result = output var buff [1024]byte @@ -4449,7 +4429,7 @@ func (m *awsRestjson1_deserializeOpListLensShares) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLensSharesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAnswersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4462,7 +4442,7 @@ func (m *awsRestjson1_deserializeOpListLensShares) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLensShares(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAnswers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4528,7 +4508,7 @@ func awsRestjson1_deserializeOpErrorListLensShares(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4541,20 +4521,51 @@ func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLensSharesOutput + var sv *ListAnswersOutput if *v == nil { - sv = &ListLensSharesOutput{} + sv = &ListAnswersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensShareSummaries": - if err := awsRestjson1_deserializeDocumentLensShareSummaries(&sv.LensShareSummaries, value); err != nil { + case "AnswerSummaries": + if err := awsRestjson1_deserializeDocumentAnswerSummaries(&sv.AnswerSummaries, value); err != nil { return err } + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "LensArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + } + sv.LensArn = ptr.String(jtv) + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -4564,6 +4575,15 @@ func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOu sv.NextToken = ptr.String(jtv) } + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + default: _, _ = key, value @@ -4573,14 +4593,14 @@ func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOu return nil } -type awsRestjson1_deserializeOpListMilestones struct { +type awsRestjson1_deserializeOpListCheckDetails struct { } -func (*awsRestjson1_deserializeOpListMilestones) ID() string { +func (*awsRestjson1_deserializeOpListCheckDetails) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMilestones) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCheckDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4594,9 +4614,9 @@ func (m *awsRestjson1_deserializeOpListMilestones) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListMilestones(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCheckDetails(response, &metadata) } - output := &ListMilestonesOutput{} + output := &ListCheckDetailsOutput{} out.Result = output var buff [1024]byte @@ -4617,7 +4637,7 @@ func (m *awsRestjson1_deserializeOpListMilestones) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMilestonesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4630,7 +4650,7 @@ func (m *awsRestjson1_deserializeOpListMilestones) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMilestones(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCheckDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4696,7 +4716,7 @@ func awsRestjson1_deserializeOpErrorListMilestones(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(v **ListCheckDetailsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4709,17 +4729,17 @@ func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMilestonesOutput + var sv *ListCheckDetailsOutput if *v == nil { - sv = &ListMilestonesOutput{} + sv = &ListCheckDetailsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "MilestoneSummaries": - if err := awsRestjson1_deserializeDocumentMilestoneSummaries(&sv.MilestoneSummaries, value); err != nil { + case "CheckDetails": + if err := awsRestjson1_deserializeDocumentCheckDetails(&sv.CheckDetails, value); err != nil { return err } @@ -4732,15 +4752,6 @@ func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOu sv.NextToken = ptr.String(jtv) } - case "WorkloadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) - } - sv.WorkloadId = ptr.String(jtv) - } - default: _, _ = key, value @@ -4750,14 +4761,14 @@ func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOu return nil } -type awsRestjson1_deserializeOpListNotifications struct { +type awsRestjson1_deserializeOpListCheckSummaries struct { } -func (*awsRestjson1_deserializeOpListNotifications) ID() string { +func (*awsRestjson1_deserializeOpListCheckSummaries) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListNotifications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCheckSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4771,9 +4782,9 @@ func (m *awsRestjson1_deserializeOpListNotifications) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListNotifications(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCheckSummaries(response, &metadata) } - output := &ListNotificationsOutput{} + output := &ListCheckSummariesOutput{} out.Result = output var buff [1024]byte @@ -4794,7 +4805,7 @@ func (m *awsRestjson1_deserializeOpListNotifications) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListNotificationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4807,7 +4818,7 @@ func (m *awsRestjson1_deserializeOpListNotifications) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListNotifications(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCheckSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4854,6 +4865,9 @@ func awsRestjson1_deserializeOpErrorListNotifications(response *smithyhttp.Respo 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) @@ -4870,7 +4884,7 @@ func awsRestjson1_deserializeOpErrorListNotifications(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(v **ListCheckSummariesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4883,15 +4897,20 @@ func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListNotificationsOutput + var sv *ListCheckSummariesOutput if *v == nil { - sv = &ListNotificationsOutput{} + sv = &ListCheckSummariesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "CheckSummaries": + if err := awsRestjson1_deserializeDocumentCheckSummaries(&sv.CheckSummaries, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -4901,11 +4920,6 @@ func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificat sv.NextToken = ptr.String(jtv) } - case "NotificationSummaries": - if err := awsRestjson1_deserializeDocumentNotificationSummaries(&sv.NotificationSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -4915,14 +4929,14 @@ func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificat return nil } -type awsRestjson1_deserializeOpListShareInvitations struct { +type awsRestjson1_deserializeOpListLenses struct { } -func (*awsRestjson1_deserializeOpListShareInvitations) ID() string { +func (*awsRestjson1_deserializeOpListLenses) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListShareInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4936,9 +4950,9 @@ func (m *awsRestjson1_deserializeOpListShareInvitations) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListShareInvitations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListLenses(response, &metadata) } - output := &ListShareInvitationsOutput{} + output := &ListLensesOutput{} out.Result = output var buff [1024]byte @@ -4959,7 +4973,7 @@ func (m *awsRestjson1_deserializeOpListShareInvitations) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLensesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4972,7 +4986,7 @@ func (m *awsRestjson1_deserializeOpListShareInvitations) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListShareInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListLenses(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5035,7 +5049,7 @@ func awsRestjson1_deserializeOpErrorListShareInvitations(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareInvitationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5048,15 +5062,20 @@ func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareI return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListShareInvitationsOutput + var sv *ListLensesOutput if *v == nil { - sv = &ListShareInvitationsOutput{} + sv = &ListLensesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "LensSummaries": + if err := awsRestjson1_deserializeDocumentLensSummaries(&sv.LensSummaries, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -5066,11 +5085,6 @@ func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareI sv.NextToken = ptr.String(jtv) } - case "ShareInvitationSummaries": - if err := awsRestjson1_deserializeDocumentShareInvitationSummaries(&sv.ShareInvitationSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -5080,14 +5094,14 @@ func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareI return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListLensReviewImprovements struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListLensReviewImprovements) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5101,9 +5115,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListLensReviewImprovements(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListLensReviewImprovementsOutput{} out.Result = output var buff [1024]byte @@ -5124,7 +5138,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5137,7 +5151,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListLensReviewImprovements(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5178,12 +5192,21 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5194,7 +5217,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **ListLensReviewImprovementsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5207,20 +5230,69 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListLensReviewImprovementsOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListLensReviewImprovementsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "ImprovementSummaries": + if err := awsRestjson1_deserializeDocumentImprovementSummaries(&sv.ImprovementSummaries, value); err != nil { return err } + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "LensArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + } + sv.LensArn = ptr.String(jtv) + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + 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 "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + default: _, _ = key, value @@ -5230,14 +5302,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListWorkloads struct { +type awsRestjson1_deserializeOpListLensReviews struct { } -func (*awsRestjson1_deserializeOpListWorkloads) ID() string { +func (*awsRestjson1_deserializeOpListLensReviews) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListWorkloads) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListLensReviews) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5251,9 +5323,9 @@ func (m *awsRestjson1_deserializeOpListWorkloads) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListWorkloads(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListLensReviews(response, &metadata) } - output := &ListWorkloadsOutput{} + output := &ListLensReviewsOutput{} out.Result = output var buff [1024]byte @@ -5274,7 +5346,7 @@ func (m *awsRestjson1_deserializeOpListWorkloads) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListWorkloadsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLensReviewsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5287,7 +5359,7 @@ func (m *awsRestjson1_deserializeOpListWorkloads) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorListWorkloads(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListLensReviews(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5334,6 +5406,9 @@ func awsRestjson1_deserializeOpErrorListWorkloads(response *smithyhttp.Response, case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5350,7 +5425,7 @@ func awsRestjson1_deserializeOpErrorListWorkloads(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviewsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5363,15 +5438,33 @@ func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListWorkloadsOutput + var sv *ListLensReviewsOutput if *v == nil { - sv = &ListWorkloadsOutput{} + sv = &ListLensReviewsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "LensReviewSummaries": + if err := awsRestjson1_deserializeDocumentLensReviewSummaries(&sv.LensReviewSummaries, value); err != nil { + return err + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -5381,9 +5474,13 @@ func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutp sv.NextToken = ptr.String(jtv) } - case "WorkloadSummaries": - if err := awsRestjson1_deserializeDocumentWorkloadSummaries(&sv.WorkloadSummaries, value); err != nil { - return err + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) } default: @@ -5395,14 +5492,14 @@ func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutp return nil } -type awsRestjson1_deserializeOpListWorkloadShares struct { +type awsRestjson1_deserializeOpListLensShares struct { } -func (*awsRestjson1_deserializeOpListWorkloadShares) ID() string { +func (*awsRestjson1_deserializeOpListLensShares) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListWorkloadShares) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListLensShares) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5416,9 +5513,9 @@ func (m *awsRestjson1_deserializeOpListWorkloadShares) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListWorkloadShares(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListLensShares(response, &metadata) } - output := &ListWorkloadSharesOutput{} + output := &ListLensSharesOutput{} out.Result = output var buff [1024]byte @@ -5439,7 +5536,7 @@ func (m *awsRestjson1_deserializeOpListWorkloadShares) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLensSharesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5452,7 +5549,7 @@ func (m *awsRestjson1_deserializeOpListWorkloadShares) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListWorkloadShares(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListLensShares(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5518,7 +5615,7 @@ func awsRestjson1_deserializeOpErrorListWorkloadShares(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkloadSharesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5531,15 +5628,20 @@ func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkload return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListWorkloadSharesOutput + var sv *ListLensSharesOutput if *v == nil { - sv = &ListWorkloadSharesOutput{} + sv = &ListLensSharesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "LensShareSummaries": + if err := awsRestjson1_deserializeDocumentLensShareSummaries(&sv.LensShareSummaries, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -5549,20 +5651,6 @@ func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkload sv.NextToken = ptr.String(jtv) } - case "WorkloadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) - } - sv.WorkloadId = ptr.String(jtv) - } - - case "WorkloadShareSummaries": - if err := awsRestjson1_deserializeDocumentWorkloadShareSummaries(&sv.WorkloadShareSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -5572,14 +5660,14 @@ func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkload return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListMilestones struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListMilestones) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMilestones) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5593,15 +5681,43 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListMilestones(response, &metadata) } - output := &TagResourceOutput{} + output := &ListMilestonesOutput{} 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_deserializeOpDocumentListMilestonesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMilestones(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5642,12 +5758,21 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } 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, @@ -5658,100 +5783,68 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -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 +func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - response, ok := out.RawResponse.(*smithyhttp.Response) + shape, ok := value.(map[string]interface{}) if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + return fmt.Errorf("unexpected JSON type %v", value) } - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + var sv *ListMilestonesOutput + if *v == nil { + sv = &ListMilestonesOutput{} + } else { + sv = *v } - 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 - } + for key, value := range shape { + switch key { + case "MilestoneSummaries": + if err := awsRestjson1_deserializeDocumentMilestoneSummaries(&sv.MilestoneSummaries, value); err != nil { + return err + } - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } + 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) + } - switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: + _, _ = key, value - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, } - return genericError - } + *v = sv + return nil } -type awsRestjson1_deserializeOpUpdateAnswer struct { +type awsRestjson1_deserializeOpListNotifications struct { } -func (*awsRestjson1_deserializeOpUpdateAnswer) ID() string { +func (*awsRestjson1_deserializeOpListNotifications) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListNotifications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5765,9 +5858,9 @@ func (m *awsRestjson1_deserializeOpUpdateAnswer) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAnswer(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListNotifications(response, &metadata) } - output := &UpdateAnswerOutput{} + output := &ListNotificationsOutput{} out.Result = output var buff [1024]byte @@ -5788,7 +5881,7 @@ func (m *awsRestjson1_deserializeOpUpdateAnswer) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListNotificationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5801,7 +5894,7 @@ func (m *awsRestjson1_deserializeOpUpdateAnswer) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListNotifications(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5845,15 +5938,9 @@ func awsRestjson1_deserializeOpErrorUpdateAnswer(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5870,7 +5957,7 @@ func awsRestjson1_deserializeOpErrorUpdateAnswer(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5883,45 +5970,27 @@ func awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAnswerOutput + var sv *ListNotificationsOutput if *v == nil { - sv = &UpdateAnswerOutput{} + sv = &ListNotificationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Answer": - if err := awsRestjson1_deserializeDocumentAnswer(&sv.Answer, value); err != nil { - return err - } - - case "LensAlias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) - } - sv.LensAlias = ptr.String(jtv) - } - - case "LensArn": + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "WorkloadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) - } - sv.WorkloadId = ptr.String(jtv) + case "NotificationSummaries": + if err := awsRestjson1_deserializeDocumentNotificationSummaries(&sv.NotificationSummaries, value); err != nil { + return err } default: @@ -5933,14 +6002,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput return nil } -type awsRestjson1_deserializeOpUpdateGlobalSettings struct { +type awsRestjson1_deserializeOpListProfileNotifications struct { } -func (*awsRestjson1_deserializeOpUpdateGlobalSettings) ID() string { +func (*awsRestjson1_deserializeOpListProfileNotifications) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateGlobalSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListProfileNotifications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5954,21 +6023,43 @@ func (m *awsRestjson1_deserializeOpUpdateGlobalSettings) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListProfileNotifications(response, &metadata) } - output := &UpdateGlobalSettingsOutput{} + output := &ListProfileNotificationsOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentListProfileNotificationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListProfileNotifications(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6012,9 +6103,6 @@ func awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response *smithyhttp.Re 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) @@ -6034,14 +6122,59 @@ func awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response *smithyhttp.Re } } -type awsRestjson1_deserializeOpUpdateLensReview struct { +func awsRestjson1_deserializeOpDocumentListProfileNotificationsOutput(v **ListProfileNotificationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListProfileNotificationsOutput + if *v == nil { + sv = &ListProfileNotificationsOutput{} + } 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 "NotificationSummaries": + if err := awsRestjson1_deserializeDocumentProfileNotificationSummaries(&sv.NotificationSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateLensReview) ID() string { +type awsRestjson1_deserializeOpListProfiles struct { +} + +func (*awsRestjson1_deserializeOpListProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6055,9 +6188,9 @@ func (m *awsRestjson1_deserializeOpUpdateLensReview) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateLensReview(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListProfiles(response, &metadata) } - output := &UpdateLensReviewOutput{} + output := &ListProfilesOutput{} out.Result = output var buff [1024]byte @@ -6078,7 +6211,7 @@ func (m *awsRestjson1_deserializeOpUpdateLensReview) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListProfilesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6091,7 +6224,7 @@ func (m *awsRestjson1_deserializeOpUpdateLensReview) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6135,15 +6268,9 @@ func awsRestjson1_deserializeOpErrorUpdateLensReview(response *smithyhttp.Respon case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -6160,7 +6287,7 @@ func awsRestjson1_deserializeOpErrorUpdateLensReview(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(v **UpdateLensReviewOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListProfilesOutput(v **ListProfilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6173,27 +6300,27 @@ func awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(v **UpdateLensRevi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateLensReviewOutput + var sv *ListProfilesOutput if *v == nil { - sv = &UpdateLensReviewOutput{} + sv = &ListProfilesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensReview": - if err := awsRestjson1_deserializeDocumentLensReview(&sv.LensReview, value); err != nil { - return err - } - - case "WorkloadId": + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) + } + + case "ProfileSummaries": + if err := awsRestjson1_deserializeDocumentProfileSummaries(&sv.ProfileSummaries, value); err != nil { + return err } default: @@ -6205,14 +6332,14 @@ func awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(v **UpdateLensRevi return nil } -type awsRestjson1_deserializeOpUpdateShareInvitation struct { +type awsRestjson1_deserializeOpListProfileShares struct { } -func (*awsRestjson1_deserializeOpUpdateShareInvitation) ID() string { +func (*awsRestjson1_deserializeOpListProfileShares) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateShareInvitation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListProfileShares) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6226,9 +6353,9 @@ func (m *awsRestjson1_deserializeOpUpdateShareInvitation) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateShareInvitation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListProfileShares(response, &metadata) } - output := &UpdateShareInvitationOutput{} + output := &ListProfileSharesOutput{} out.Result = output var buff [1024]byte @@ -6249,7 +6376,7 @@ func (m *awsRestjson1_deserializeOpUpdateShareInvitation) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateShareInvitationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListProfileSharesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6262,7 +6389,7 @@ func (m *awsRestjson1_deserializeOpUpdateShareInvitation) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateShareInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListProfileShares(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6306,9 +6433,6 @@ func awsRestjson1_deserializeOpErrorUpdateShareInvitation(response *smithyhttp.R case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -6331,7 +6455,7 @@ func awsRestjson1_deserializeOpErrorUpdateShareInvitation(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentUpdateShareInvitationOutput(v **UpdateShareInvitationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListProfileSharesOutput(v **ListProfileSharesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6344,37 +6468,46 @@ func awsRestjson1_deserializeOpDocumentUpdateShareInvitationOutput(v **UpdateSha return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateShareInvitationOutput + var sv *ListProfileSharesOutput if *v == nil { - sv = &UpdateShareInvitationOutput{} + sv = &ListProfileSharesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ShareInvitation": - if err := awsRestjson1_deserializeDocumentShareInvitation(&sv.ShareInvitation, value); err != nil { - return err - } - - default: - _, _ = key, value - + 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 "ProfileShareSummaries": + if err := awsRestjson1_deserializeDocumentProfileShareSummaries(&sv.ProfileShareSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + } } *v = sv return nil } -type awsRestjson1_deserializeOpUpdateWorkload struct { +type awsRestjson1_deserializeOpListShareInvitations struct { } -func (*awsRestjson1_deserializeOpUpdateWorkload) ID() string { +func (*awsRestjson1_deserializeOpListShareInvitations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListShareInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6388,9 +6521,9 @@ func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorkload(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListShareInvitations(response, &metadata) } - output := &UpdateWorkloadOutput{} + output := &ListShareInvitationsOutput{} out.Result = output var buff [1024]byte @@ -6411,7 +6544,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6424,7 +6557,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListShareInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6468,15 +6601,9 @@ func awsRestjson1_deserializeOpErrorUpdateWorkload(response *smithyhttp.Response case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -6493,7 +6620,7 @@ func awsRestjson1_deserializeOpErrorUpdateWorkload(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(v **UpdateWorkloadOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6506,17 +6633,26 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(v **UpdateWorkloadOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateWorkloadOutput + var sv *ListShareInvitationsOutput if *v == nil { - sv = &UpdateWorkloadOutput{} + sv = &ListShareInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Workload": - if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ShareInvitationSummaries": + if err := awsRestjson1_deserializeDocumentShareInvitationSummaries(&sv.ShareInvitationSummaries, value); err != nil { return err } @@ -6529,14 +6665,14 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(v **UpdateWorkloadOu return nil } -type awsRestjson1_deserializeOpUpdateWorkloadShare struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpUpdateWorkloadShare) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6550,9 +6686,9 @@ func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorkloadShare(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UpdateWorkloadShareOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -6573,7 +6709,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6586,7 +6722,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6627,24 +6763,12 @@ func awsRestjson1_deserializeOpErrorUpdateWorkloadShare(response *smithyhttp.Res } 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, @@ -6655,7 +6779,7 @@ func awsRestjson1_deserializeOpErrorUpdateWorkloadShare(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(v **UpdateWorkloadShareOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6668,26 +6792,17 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(v **UpdateWorkl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateWorkloadShareOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &UpdateWorkloadShareOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "WorkloadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) - } - sv.WorkloadId = ptr.String(jtv) - } - - case "WorkloadShare": - if err := awsRestjson1_deserializeDocumentWorkloadShare(&sv.WorkloadShare, value); err != nil { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } @@ -6700,14 +6815,14 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(v **UpdateWorkl return nil } -type awsRestjson1_deserializeOpUpgradeLensReview struct { +type awsRestjson1_deserializeOpListWorkloads struct { } -func (*awsRestjson1_deserializeOpUpgradeLensReview) ID() string { +func (*awsRestjson1_deserializeOpListWorkloads) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpgradeLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListWorkloads) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6721,21 +6836,43 @@ func (m *awsRestjson1_deserializeOpUpgradeLensReview) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpgradeLensReview(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListWorkloads(response, &metadata) } - output := &UpgradeLensReviewOutput{} + output := &ListWorkloadsOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentListWorkloadsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpgradeLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListWorkloads(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6779,15 +6916,9 @@ func awsRestjson1_deserializeOpErrorUpgradeLensReview(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -6804,12 +6935,82 @@ func awsRestjson1_deserializeOpErrorUpgradeLensReview(response *smithyhttp.Respo } } -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} +func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListWorkloadsOutput + if *v == nil { + sv = &ListWorkloadsOutput{} + } 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 "WorkloadSummaries": + if err := awsRestjson1_deserializeDocumentWorkloadSummaries(&sv.WorkloadSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListWorkloadShares struct { +} + +func (*awsRestjson1_deserializeOpListWorkloadShares) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWorkloadShares) HandleDeserialize(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_deserializeOpErrorListWorkloadShares(response, &metadata) + } + output := &ListWorkloadSharesOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -6820,36 +7021,45 @@ func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} +func awsRestjson1_deserializeOpErrorListWorkloadShares(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -6859,105 +7069,146 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons 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) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - return output -} + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) +func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkloadSharesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - errorBody.Seek(0, io.SeekStart) + var sv *ListWorkloadSharesOutput + if *v == nil { + sv = &ListWorkloadSharesOutput{} + } else { + sv = *v + } - return output -} + 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) + } -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadShareSummaries": + if err := awsRestjson1_deserializeDocumentWorkloadShareSummaries(&sv.WorkloadShareSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value - 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 } + *v = sv + return nil +} - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) +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 { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output + 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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} +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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -6967,33 +7218,83 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy return err } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpUntagResource struct { +} - return output +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -7003,60 +7304,2299 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo return err } - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateAnswer struct { +} + +func (*awsRestjson1_deserializeOpUpdateAnswer) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAnswer) HandleDeserialize(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_deserializeOpErrorUpdateAnswer(response, &metadata) + } + output := &UpdateAnswerOutput{} + 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_deserializeOpDocumentUpdateAnswerOutput(&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_deserializeOpErrorUpdateAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAnswerOutput + if *v == nil { + sv = &UpdateAnswerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Answer": + if err := awsRestjson1_deserializeDocumentAnswer(&sv.Answer, value); err != nil { + return err + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "LensArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + } + sv.LensArn = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateGlobalSettings struct { +} + +func (*awsRestjson1_deserializeOpUpdateGlobalSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateGlobalSettings) HandleDeserialize(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_deserializeOpErrorUpdateGlobalSettings(response, &metadata) + } + output := &UpdateGlobalSettingsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("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_deserializeOpUpdateLensReview struct { +} + +func (*awsRestjson1_deserializeOpUpdateLensReview) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateLensReview) HandleDeserialize(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_deserializeOpErrorUpdateLensReview(response, &metadata) + } + output := &UpdateLensReviewOutput{} + 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_deserializeOpDocumentUpdateLensReviewOutput(&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_deserializeOpErrorUpdateLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentUpdateLensReviewOutput(v **UpdateLensReviewOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateLensReviewOutput + if *v == nil { + sv = &UpdateLensReviewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensReview": + if err := awsRestjson1_deserializeDocumentLensReview(&sv.LensReview, value); err != nil { + return err + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateProfile struct { +} + +func (*awsRestjson1_deserializeOpUpdateProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateProfile) HandleDeserialize(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_deserializeOpErrorUpdateProfile(response, &metadata) + } + output := &UpdateProfileOutput{} + 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_deserializeOpDocumentUpdateProfileOutput(&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_deserializeOpErrorUpdateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentUpdateProfileOutput(v **UpdateProfileOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateProfileOutput + if *v == nil { + sv = &UpdateProfileOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Profile": + if err := awsRestjson1_deserializeDocumentProfile(&sv.Profile, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateShareInvitation struct { +} + +func (*awsRestjson1_deserializeOpUpdateShareInvitation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateShareInvitation) HandleDeserialize(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_deserializeOpErrorUpdateShareInvitation(response, &metadata) + } + output := &UpdateShareInvitationOutput{} + 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_deserializeOpDocumentUpdateShareInvitationOutput(&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_deserializeOpErrorUpdateShareInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentUpdateShareInvitationOutput(v **UpdateShareInvitationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateShareInvitationOutput + if *v == nil { + sv = &UpdateShareInvitationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ShareInvitation": + if err := awsRestjson1_deserializeDocumentShareInvitation(&sv.ShareInvitation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateWorkload struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorkload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(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_deserializeOpErrorUpdateWorkload(response, &metadata) + } + output := &UpdateWorkloadOutput{} + 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_deserializeOpDocumentUpdateWorkloadOutput(&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_deserializeOpErrorUpdateWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentUpdateWorkloadOutput(v **UpdateWorkloadOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateWorkloadOutput + if *v == nil { + sv = &UpdateWorkloadOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Workload": + if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateWorkloadShare struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorkloadShare) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) HandleDeserialize(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_deserializeOpErrorUpdateWorkloadShare(response, &metadata) + } + output := &UpdateWorkloadShareOutput{} + 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_deserializeOpDocumentUpdateWorkloadShareOutput(&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_deserializeOpErrorUpdateWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_deserializeOpDocumentUpdateWorkloadShareOutput(v **UpdateWorkloadShareOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateWorkloadShareOutput + if *v == nil { + sv = &UpdateWorkloadShareOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadShare": + if err := awsRestjson1_deserializeDocumentWorkloadShare(&sv.WorkloadShare, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpgradeLensReview struct { +} + +func (*awsRestjson1_deserializeOpUpgradeLensReview) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpgradeLensReview) HandleDeserialize(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_deserializeOpErrorUpgradeLensReview(response, &metadata) + } + output := &UpgradeLensReviewOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpgradeLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + } +} + +type awsRestjson1_deserializeOpUpgradeProfileVersion struct { +} + +func (*awsRestjson1_deserializeOpUpgradeProfileVersion) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpgradeProfileVersion) HandleDeserialize(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_deserializeOpErrorUpgradeProfileVersion(response, &metadata) + } + output := &UpgradeProfileVersionOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpgradeProfileVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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_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 ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountSummary(v *map[string]int32, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]int32 + if *v == nil { + mv = map[string]int32{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CheckStatusCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + parsedVal = int32(i64) + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentAdditionalResources(v **types.AdditionalResources, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AdditionalResources + if *v == nil { + sv = &types.AdditionalResources{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Content": + if err := awsRestjson1_deserializeDocumentUrls(&sv.Content, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdditionalResourceType to be of type string, got %T instead", value) + } + sv.Type = types.AdditionalResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAdditionalResourcesList(v *[]types.AdditionalResources, 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.AdditionalResources + if *v == nil { + cv = []types.AdditionalResources{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AdditionalResources + destAddr := &col + if err := awsRestjson1_deserializeDocumentAdditionalResources(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAnswer(v **types.Answer, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Answer + if *v == nil { + sv = &types.Answer{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ChoiceAnswers": + if err := awsRestjson1_deserializeDocumentChoiceAnswers(&sv.ChoiceAnswers, value); err != nil { + return err + } + + case "Choices": + if err := awsRestjson1_deserializeDocumentChoices(&sv.Choices, value); err != nil { + return err + } + + case "HelpfulResourceDisplayText": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DisplayText to be of type string, got %T instead", value) + } + sv.HelpfulResourceDisplayText = ptr.String(jtv) + } + + case "HelpfulResourceUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HelpfulResourceUrl to be of type string, got %T instead", value) + } + sv.HelpfulResourceUrl = ptr.String(jtv) + } + + case "ImprovementPlanUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImprovementPlanUrl to be of type string, got %T instead", value) + } + sv.ImprovementPlanUrl = ptr.String(jtv) + } + + case "IsApplicable": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsApplicable to be of type *bool, got %T instead", value) + } + sv.IsApplicable = jtv + } + + case "Notes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Notes to be of type string, got %T instead", value) + } + sv.Notes = ptr.String(jtv) + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "QuestionDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionDescription to be of type string, got %T instead", value) + } + sv.QuestionDescription = ptr.String(jtv) + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + + case "QuestionTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + } + sv.QuestionTitle = ptr.String(jtv) + } + + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnswerReason to be of type string, got %T instead", value) + } + sv.Reason = types.AnswerReason(jtv) + } + + case "Risk": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + } + sv.Risk = types.Risk(jtv) + } + + case "SelectedChoices": + if err := awsRestjson1_deserializeDocumentSelectedChoices(&sv.SelectedChoices, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAnswerSummaries(v *[]types.AnswerSummary, 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.AnswerSummary + if *v == nil { + cv = []types.AnswerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AnswerSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAnswerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAnswerSummary(v **types.AnswerSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AnswerSummary + if *v == nil { + sv = &types.AnswerSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ChoiceAnswerSummaries": + if err := awsRestjson1_deserializeDocumentChoiceAnswerSummaries(&sv.ChoiceAnswerSummaries, value); err != nil { + return err + } + + case "Choices": + if err := awsRestjson1_deserializeDocumentChoices(&sv.Choices, value); err != nil { + return err + } + + case "IsApplicable": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsApplicable to be of type *bool, got %T instead", value) + } + sv.IsApplicable = jtv + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + + case "QuestionTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + } + sv.QuestionTitle = ptr.String(jtv) + } + + case "QuestionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionType to be of type string, got %T instead", value) + } + sv.QuestionType = types.QuestionType(jtv) + } + + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnswerReason to be of type string, got %T instead", value) + } + sv.Reason = types.AnswerReason(jtv) + } + + case "Risk": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + } + sv.Risk = types.Risk(jtv) + } + + case "SelectedChoices": + if err := awsRestjson1_deserializeDocumentSelectedChoices(&sv.SelectedChoices, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBestPractice(v **types.BestPractice, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.BestPractice + if *v == nil { + sv = &types.BestPractice{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ChoiceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + } + sv.ChoiceId = ptr.String(jtv) + } + + case "ChoiceTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) + } + sv.ChoiceTitle = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBestPractices(v *[]types.BestPractice, 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.BestPractice + if *v == nil { + cv = []types.BestPractice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BestPractice + destAddr := &col + if err := awsRestjson1_deserializeDocumentBestPractice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCheckDetail(v **types.CheckDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CheckDetail + if *v == nil { + sv = &types.CheckDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "ChoiceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + } + sv.ChoiceId = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "FlaggedResources": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected FlaggedResources to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FlaggedResources = int32(i64) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LensArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + } + sv.LensArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "Provider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckProvider to be of type string, got %T instead", value) + } + sv.Provider = types.CheckProvider(jtv) + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckFailureReason to be of type string, got %T instead", value) + } + sv.Reason = types.CheckFailureReason(jtv) + } - errorBody.Seek(0, io.SeekStart) + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckStatus to be of type string, got %T instead", value) + } + sv.Status = types.CheckStatus(jtv) + } - return output -} + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) -func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ValidationException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - 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) + default: + _, _ = key, value - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } - return err } - - errorBody.Seek(0, io.SeekStart) - - return output + *v = sv + return nil } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentCheckDetails(v *[]types.CheckDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7064,39 +9604,33 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var cv []types.CheckDetail if *v == nil { - sv = &types.AccessDeniedException{} + cv = []types.CheckDetail{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.CheckDetail + destAddr := &col + if err := awsRestjson1_deserializeDocumentCheckDetail(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAccountSummary(v *map[string]int32, value interface{}) error { +func awsRestjson1_deserializeDocumentCheckSummaries(v *[]types.CheckSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7104,39 +9638,33 @@ func awsRestjson1_deserializeDocumentAccountSummary(v *map[string]int32, value i return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]int32 + var cv []types.CheckSummary if *v == nil { - mv = map[string]int32{} + cv = []types.CheckSummary{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal int32 - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected CheckStatusCount to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - parsedVal = int32(i64) + for _, value := range shape { + var col types.CheckSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentCheckSummary(&destAddr, value); err != nil { + return err } - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAdditionalResources(v **types.AdditionalResources, value interface{}) error { +func awsRestjson1_deserializeDocumentCheckSummary(v **types.CheckSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7149,27 +9677,115 @@ func awsRestjson1_deserializeDocumentAdditionalResources(v **types.AdditionalRes return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AdditionalResources + var sv *types.CheckSummary if *v == nil { - sv = &types.AdditionalResources{} + sv = &types.CheckSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "Content": - if err := awsRestjson1_deserializeDocumentUrls(&sv.Content, value); err != nil { + case "AccountSummary": + if err := awsRestjson1_deserializeDocumentAccountSummary(&sv.AccountSummary, value); err != nil { return err } - case "Type": + case "ChoiceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AdditionalResourceType to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + } + sv.ChoiceId = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LensArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + } + sv.LensArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "Provider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckProvider to be of type string, got %T instead", value) + } + sv.Provider = types.CheckProvider(jtv) + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckStatus to be of type string, got %T instead", value) + } + sv.Status = types.CheckStatus(jtv) + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.Type = types.AdditionalResourceType(jtv) } default: @@ -7181,41 +9797,7 @@ func awsRestjson1_deserializeDocumentAdditionalResources(v **types.AdditionalRes return nil } -func awsRestjson1_deserializeDocumentAdditionalResourcesList(v *[]types.AdditionalResources, 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.AdditionalResources - if *v == nil { - cv = []types.AdditionalResources{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AdditionalResources - destAddr := &col - if err := awsRestjson1_deserializeDocumentAdditionalResources(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAnswer(v **types.Answer, value interface{}) error { +func awsRestjson1_deserializeDocumentChoice(v **types.Choice, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7228,127 +9810,122 @@ func awsRestjson1_deserializeDocumentAnswer(v **types.Answer, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Answer + var sv *types.Choice if *v == nil { - sv = &types.Answer{} + sv = &types.Choice{} } else { sv = *v } for key, value := range shape { switch key { - case "ChoiceAnswers": - if err := awsRestjson1_deserializeDocumentChoiceAnswers(&sv.ChoiceAnswers, value); err != nil { - return err - } - - case "Choices": - if err := awsRestjson1_deserializeDocumentChoices(&sv.Choices, value); err != nil { + case "AdditionalResources": + if err := awsRestjson1_deserializeDocumentAdditionalResourcesList(&sv.AdditionalResources, value); err != nil { return err } - case "HelpfulResourceDisplayText": + case "ChoiceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DisplayText to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) } - sv.HelpfulResourceDisplayText = ptr.String(jtv) + sv.ChoiceId = ptr.String(jtv) } - case "HelpfulResourceUrl": + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected HelpfulResourceUrl to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceDescription to be of type string, got %T instead", value) } - sv.HelpfulResourceUrl = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "ImprovementPlanUrl": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ImprovementPlanUrl to be of type string, got %T instead", value) - } - sv.ImprovementPlanUrl = ptr.String(jtv) + case "HelpfulResource": + if err := awsRestjson1_deserializeDocumentChoiceContent(&sv.HelpfulResource, value); err != nil { + return err } - case "IsApplicable": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected IsApplicable to be of type *bool, got %T instead", value) - } - sv.IsApplicable = jtv + case "ImprovementPlan": + if err := awsRestjson1_deserializeDocumentChoiceContent(&sv.ImprovementPlan, value); err != nil { + return err } - case "Notes": + case "Title": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Notes to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) } - sv.Notes = ptr.String(jtv) + sv.Title = ptr.String(jtv) } - case "PillarId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) - } - sv.PillarId = ptr.String(jtv) - } + default: + _, _ = key, value - case "QuestionDescription": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected QuestionDescription to be of type string, got %T instead", value) - } - sv.QuestionDescription = ptr.String(jtv) - } + } + } + *v = sv + return nil +} - case "QuestionId": +func awsRestjson1_deserializeDocumentChoiceAnswer(v **types.ChoiceAnswer, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ChoiceAnswer + if *v == nil { + sv = &types.ChoiceAnswer{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ChoiceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) } - sv.QuestionId = ptr.String(jtv) + sv.ChoiceId = ptr.String(jtv) } - case "QuestionTitle": + case "Notes": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceNotes to be of type string, got %T instead", value) } - sv.QuestionTitle = ptr.String(jtv) + sv.Notes = ptr.String(jtv) } case "Reason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AnswerReason to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceReason to be of type string, got %T instead", value) } - sv.Reason = types.AnswerReason(jtv) + sv.Reason = types.ChoiceReason(jtv) } - case "Risk": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceStatus to be of type string, got %T instead", value) } - sv.Risk = types.Risk(jtv) - } - - case "SelectedChoices": - if err := awsRestjson1_deserializeDocumentSelectedChoices(&sv.SelectedChoices, value); err != nil { - return err + sv.Status = types.ChoiceStatus(jtv) } default: @@ -7360,7 +9937,7 @@ func awsRestjson1_deserializeDocumentAnswer(v **types.Answer, value interface{}) return nil } -func awsRestjson1_deserializeDocumentAnswerSummaries(v *[]types.AnswerSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentChoiceAnswers(v *[]types.ChoiceAnswer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7373,17 +9950,17 @@ func awsRestjson1_deserializeDocumentAnswerSummaries(v *[]types.AnswerSummary, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AnswerSummary + var cv []types.ChoiceAnswer if *v == nil { - cv = []types.AnswerSummary{} + cv = []types.ChoiceAnswer{} } else { cv = *v } for _, value := range shape { - var col types.AnswerSummary + var col types.ChoiceAnswer destAddr := &col - if err := awsRestjson1_deserializeDocumentAnswerSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentChoiceAnswer(&destAddr, value); err != nil { return err } col = *destAddr @@ -7394,7 +9971,41 @@ func awsRestjson1_deserializeDocumentAnswerSummaries(v *[]types.AnswerSummary, v return nil } -func awsRestjson1_deserializeDocumentAnswerSummary(v **types.AnswerSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentChoiceAnswerSummaries(v *[]types.ChoiceAnswerSummary, 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.ChoiceAnswerSummary + if *v == nil { + cv = []types.ChoiceAnswerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ChoiceAnswerSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentChoiceAnswerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentChoiceAnswerSummary(v **types.ChoiceAnswerSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7407,82 +10018,89 @@ func awsRestjson1_deserializeDocumentAnswerSummary(v **types.AnswerSummary, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AnswerSummary + var sv *types.ChoiceAnswerSummary if *v == nil { - sv = &types.AnswerSummary{} + sv = &types.ChoiceAnswerSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "ChoiceAnswerSummaries": - if err := awsRestjson1_deserializeDocumentChoiceAnswerSummaries(&sv.ChoiceAnswerSummaries, value); err != nil { - return err - } - - case "Choices": - if err := awsRestjson1_deserializeDocumentChoices(&sv.Choices, value); err != nil { - return err + case "ChoiceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + } + sv.ChoiceId = ptr.String(jtv) } - case "IsApplicable": + case "Reason": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected IsApplicable to be of type *bool, got %T instead", value) + return fmt.Errorf("expected ChoiceReason to be of type string, got %T instead", value) } - sv.IsApplicable = jtv + sv.Reason = types.ChoiceReason(jtv) } - case "PillarId": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceStatus to be of type string, got %T instead", value) } - sv.PillarId = ptr.String(jtv) + sv.Status = types.ChoiceStatus(jtv) } - case "QuestionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) - } - sv.QuestionId = ptr.String(jtv) - } + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChoiceContent(v **types.ChoiceContent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "QuestionTitle": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) - } - sv.QuestionTitle = ptr.String(jtv) - } + var sv *types.ChoiceContent + if *v == nil { + sv = &types.ChoiceContent{} + } else { + sv = *v + } - case "Reason": + for key, value := range shape { + switch key { + case "DisplayText": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AnswerReason to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceContentDisplayText to be of type string, got %T instead", value) } - sv.Reason = types.AnswerReason(jtv) + sv.DisplayText = ptr.String(jtv) } - case "Risk": + case "Url": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceContentUrl to be of type string, got %T instead", value) } - sv.Risk = types.Risk(jtv) - } - - case "SelectedChoices": - if err := awsRestjson1_deserializeDocumentSelectedChoices(&sv.SelectedChoices, value); err != nil { - return err + sv.Url = ptr.String(jtv) } default: @@ -7494,7 +10112,7 @@ func awsRestjson1_deserializeDocumentAnswerSummary(v **types.AnswerSummary, valu return nil } -func awsRestjson1_deserializeDocumentBestPractice(v **types.BestPractice, value interface{}) error { +func awsRestjson1_deserializeDocumentChoiceImprovementPlan(v **types.ChoiceImprovementPlan, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7507,9 +10125,9 @@ func awsRestjson1_deserializeDocumentBestPractice(v **types.BestPractice, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BestPractice + var sv *types.ChoiceImprovementPlan if *v == nil { - sv = &types.BestPractice{} + sv = &types.ChoiceImprovementPlan{} } else { sv = *v } @@ -7525,13 +10143,22 @@ func awsRestjson1_deserializeDocumentBestPractice(v **types.BestPractice, value sv.ChoiceId = ptr.String(jtv) } - case "ChoiceTitle": + case "DisplayText": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) + return fmt.Errorf("expected DisplayText to be of type string, got %T instead", value) } - sv.ChoiceTitle = ptr.String(jtv) + sv.DisplayText = ptr.String(jtv) + } + + case "ImprovementPlanUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImprovementPlanUrl to be of type string, got %T instead", value) + } + sv.ImprovementPlanUrl = ptr.String(jtv) } default: @@ -7543,7 +10170,7 @@ func awsRestjson1_deserializeDocumentBestPractice(v **types.BestPractice, value return nil } -func awsRestjson1_deserializeDocumentBestPractices(v *[]types.BestPractice, value interface{}) error { +func awsRestjson1_deserializeDocumentChoiceImprovementPlans(v *[]types.ChoiceImprovementPlan, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7556,17 +10183,17 @@ func awsRestjson1_deserializeDocumentBestPractices(v *[]types.BestPractice, valu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BestPractice + var cv []types.ChoiceImprovementPlan if *v == nil { - cv = []types.BestPractice{} + cv = []types.ChoiceImprovementPlan{} } else { cv = *v } for _, value := range shape { - var col types.BestPractice + var col types.ChoiceImprovementPlan destAddr := &col - if err := awsRestjson1_deserializeDocumentBestPractice(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentChoiceImprovementPlan(&destAddr, value); err != nil { return err } col = *destAddr @@ -7577,7 +10204,41 @@ func awsRestjson1_deserializeDocumentBestPractices(v *[]types.BestPractice, valu return nil } -func awsRestjson1_deserializeDocumentCheckDetail(v **types.CheckDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentChoices(v *[]types.Choice, 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.Choice + if *v == nil { + cv = []types.Choice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Choice + destAddr := &col + if err := awsRestjson1_deserializeDocumentChoice(&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) } @@ -7590,125 +10251,103 @@ func awsRestjson1_deserializeDocumentCheckDetail(v **types.CheckDetail, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CheckDetail + var sv *types.ConflictException if *v == nil { - sv = &types.CheckDetail{} + sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { - case "AccountId": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "ChoiceId": + case "ResourceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + return fmt.Errorf("expected ExceptionResourceId to be of type string, got %T instead", value) } - sv.ChoiceId = ptr.String(jtv) + sv.ResourceId = ptr.String(jtv) } - case "Description": + case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CheckDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.ResourceType = ptr.String(jtv) } - case "FlaggedResources": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected FlaggedResources to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.FlaggedResources = int32(i64) - } + default: + _, _ = key, value - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CheckId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } + } + } + *v = sv + return nil +} - case "LensArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) - } - sv.LensArn = ptr.String(jtv) - } +func awsRestjson1_deserializeDocumentConsolidatedReportMetric(v **types.ConsolidatedReportMetric, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CheckName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "PillarId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) - } - sv.PillarId = ptr.String(jtv) - } + var sv *types.ConsolidatedReportMetric + if *v == nil { + sv = &types.ConsolidatedReportMetric{} + } else { + sv = *v + } - case "Provider": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CheckProvider to be of type string, got %T instead", value) - } - sv.Provider = types.CheckProvider(jtv) + for key, value := range shape { + switch key { + case "Lenses": + if err := awsRestjson1_deserializeDocumentLensMetrics(&sv.Lenses, value); err != nil { + return err } - case "QuestionId": + case "LensesAppliedCount": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + return fmt.Errorf("expected LensesAppliedCount to be json.Number, got %T instead", value) } - sv.QuestionId = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LensesAppliedCount = int32(i64) } - case "Reason": + case "MetricType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CheckFailureReason to be of type string, got %T instead", value) + return fmt.Errorf("expected MetricType to be of type string, got %T instead", value) } - sv.Reason = types.CheckFailureReason(jtv) + sv.MetricType = types.MetricType(jtv) } - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CheckStatus to be of type string, got %T instead", value) - } - sv.Status = types.CheckStatus(jtv) + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err } case "UpdatedAt": @@ -7727,6 +10366,33 @@ func awsRestjson1_deserializeDocumentCheckDetail(v **types.CheckDetail, value in } } + case "WorkloadArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadArn to be of type string, got %T instead", value) + } + sv.WorkloadArn = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + } + sv.WorkloadName = ptr.String(jtv) + } + default: _, _ = key, value @@ -7736,7 +10402,7 @@ func awsRestjson1_deserializeDocumentCheckDetail(v **types.CheckDetail, value in return nil } -func awsRestjson1_deserializeDocumentCheckDetails(v *[]types.CheckDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentConsolidatedReportMetrics(v *[]types.ConsolidatedReportMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7749,17 +10415,17 @@ func awsRestjson1_deserializeDocumentCheckDetails(v *[]types.CheckDetail, value return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.CheckDetail + var cv []types.ConsolidatedReportMetric if *v == nil { - cv = []types.CheckDetail{} + cv = []types.ConsolidatedReportMetric{} } else { cv = *v } for _, value := range shape { - var col types.CheckDetail + var col types.ConsolidatedReportMetric destAddr := &col - if err := awsRestjson1_deserializeDocumentCheckDetail(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentConsolidatedReportMetric(&destAddr, value); err != nil { return err } col = *destAddr @@ -7770,7 +10436,7 @@ func awsRestjson1_deserializeDocumentCheckDetails(v *[]types.CheckDetail, value return nil } -func awsRestjson1_deserializeDocumentCheckSummaries(v *[]types.CheckSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentImprovementSummaries(v *[]types.ImprovementSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7783,17 +10449,17 @@ func awsRestjson1_deserializeDocumentCheckSummaries(v *[]types.CheckSummary, val return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.CheckSummary + var cv []types.ImprovementSummary if *v == nil { - cv = []types.CheckSummary{} + cv = []types.ImprovementSummary{} } else { cv = *v } for _, value := range shape { - var col types.CheckSummary + var col types.ImprovementSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentCheckSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentImprovementSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -7804,7 +10470,7 @@ func awsRestjson1_deserializeDocumentCheckSummaries(v *[]types.CheckSummary, val return nil } -func awsRestjson1_deserializeDocumentCheckSummary(v **types.CheckSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentImprovementSummary(v **types.ImprovementSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7817,63 +10483,27 @@ func awsRestjson1_deserializeDocumentCheckSummary(v **types.CheckSummary, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CheckSummary + var sv *types.ImprovementSummary if *v == nil { - sv = &types.CheckSummary{} + sv = &types.ImprovementSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "AccountSummary": - if err := awsRestjson1_deserializeDocumentAccountSummary(&sv.AccountSummary, value); err != nil { + case "ImprovementPlans": + if err := awsRestjson1_deserializeDocumentChoiceImprovementPlans(&sv.ImprovementPlans, value); err != nil { return err } - case "ChoiceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) - } - sv.ChoiceId = ptr.String(jtv) - } - - case "Description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CheckDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CheckId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "LensArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) - } - sv.LensArn = ptr.String(jtv) - } - - case "Name": + case "ImprovementPlanUrl": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CheckName to be of type string, got %T instead", value) + return fmt.Errorf("expected ImprovementPlanUrl to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.ImprovementPlanUrl = ptr.String(jtv) } case "PillarId": @@ -7885,15 +10515,6 @@ func awsRestjson1_deserializeDocumentCheckSummary(v **types.CheckSummary, value sv.PillarId = ptr.String(jtv) } - case "Provider": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CheckProvider to be of type string, got %T instead", value) - } - sv.Provider = types.CheckProvider(jtv) - } - case "QuestionId": if value != nil { jtv, ok := value.(string) @@ -7903,29 +10524,22 @@ func awsRestjson1_deserializeDocumentCheckSummary(v **types.CheckSummary, value sv.QuestionId = ptr.String(jtv) } - case "Status": + case "QuestionTitle": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CheckStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) } - sv.Status = types.CheckStatus(jtv) + sv.QuestionTitle = ptr.String(jtv) } - case "UpdatedAt": + case "Risk": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Risk to be of type string, got %T instead", value) } + sv.Risk = types.Risk(jtv) } default: @@ -7937,7 +10551,7 @@ func awsRestjson1_deserializeDocumentCheckSummary(v **types.CheckSummary, value return nil } -func awsRestjson1_deserializeDocumentChoice(v **types.Choice, value interface{}) error { +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7950,55 +10564,22 @@ func awsRestjson1_deserializeDocumentChoice(v **types.Choice, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Choice + var sv *types.InternalServerException if *v == nil { - sv = &types.Choice{} + sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { - case "AdditionalResources": - if err := awsRestjson1_deserializeDocumentAdditionalResourcesList(&sv.AdditionalResources, value); err != nil { - return err - } - - case "ChoiceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) - } - sv.ChoiceId = ptr.String(jtv) - } - - case "Description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ChoiceDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "HelpfulResource": - if err := awsRestjson1_deserializeDocumentChoiceContent(&sv.HelpfulResource, value); err != nil { - return err - } - - case "ImprovementPlan": - if err := awsRestjson1_deserializeDocumentChoiceContent(&sv.ImprovementPlan, value); err != nil { - return err - } - - case "Title": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } - sv.Title = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -8010,7 +10591,7 @@ func awsRestjson1_deserializeDocumentChoice(v **types.Choice, value interface{}) return nil } -func awsRestjson1_deserializeDocumentChoiceAnswer(v **types.ChoiceAnswer, value interface{}) error { +func awsRestjson1_deserializeDocumentLens(v **types.Lens, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8023,49 +10604,72 @@ func awsRestjson1_deserializeDocumentChoiceAnswer(v **types.ChoiceAnswer, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ChoiceAnswer + var sv *types.Lens if *v == nil { - sv = &types.ChoiceAnswer{} + sv = &types.Lens{} } else { sv = *v } for key, value := range shape { switch key { - case "ChoiceId": + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + return fmt.Errorf("expected LensDescription to be of type string, got %T instead", value) } - sv.ChoiceId = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "Notes": + case "LensArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceNotes to be of type string, got %T instead", value) + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) } - sv.Notes = ptr.String(jtv) + sv.LensArn = ptr.String(jtv) } - case "Reason": + case "LensVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceReason to be of type string, got %T instead", value) + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) } - sv.Reason = types.ChoiceReason(jtv) + sv.LensVersion = ptr.String(jtv) } - case "Status": + case "Name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected LensName to be of type string, got %T instead", value) } - sv.Status = types.ChoiceStatus(jtv) + sv.Name = ptr.String(jtv) + } + + case "Owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensOwner to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "ShareInvitationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareInvitationId to be of type string, got %T instead", value) + } + sv.ShareInvitationId = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -8077,7 +10681,7 @@ func awsRestjson1_deserializeDocumentChoiceAnswer(v **types.ChoiceAnswer, value return nil } -func awsRestjson1_deserializeDocumentChoiceAnswers(v *[]types.ChoiceAnswer, value interface{}) error { +func awsRestjson1_deserializeDocumentLensMetric(v **types.LensMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8085,33 +10689,49 @@ func awsRestjson1_deserializeDocumentChoiceAnswers(v *[]types.ChoiceAnswer, valu return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ChoiceAnswer + var sv *types.LensMetric if *v == nil { - cv = []types.ChoiceAnswer{} + sv = &types.LensMetric{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ChoiceAnswer - destAddr := &col - if err := awsRestjson1_deserializeDocumentChoiceAnswer(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "LensArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + } + sv.LensArn = ptr.String(jtv) + } + + case "Pillars": + if err := awsRestjson1_deserializeDocumentPillarMetrics(&sv.Pillars, value); err != nil { + return err + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentChoiceAnswerSummaries(v *[]types.ChoiceAnswerSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentLensMetrics(v *[]types.LensMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8124,17 +10744,17 @@ func awsRestjson1_deserializeDocumentChoiceAnswerSummaries(v *[]types.ChoiceAnsw return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ChoiceAnswerSummary + var cv []types.LensMetric if *v == nil { - cv = []types.ChoiceAnswerSummary{} + cv = []types.LensMetric{} } else { cv = *v } for _, value := range shape { - var col types.ChoiceAnswerSummary + var col types.LensMetric destAddr := &col - if err := awsRestjson1_deserializeDocumentChoiceAnswerSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentLensMetric(&destAddr, value); err != nil { return err } col = *destAddr @@ -8145,7 +10765,7 @@ func awsRestjson1_deserializeDocumentChoiceAnswerSummaries(v *[]types.ChoiceAnsw return nil } -func awsRestjson1_deserializeDocumentChoiceAnswerSummary(v **types.ChoiceAnswerSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentLensReview(v **types.LensReview, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8158,89 +10778,112 @@ func awsRestjson1_deserializeDocumentChoiceAnswerSummary(v **types.ChoiceAnswerS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ChoiceAnswerSummary + var sv *types.LensReview if *v == nil { - sv = &types.ChoiceAnswerSummary{} + sv = &types.LensReview{} } else { sv = *v } for key, value := range shape { switch key { - case "ChoiceId": + case "LensAlias": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) } - sv.ChoiceId = ptr.String(jtv) + sv.LensAlias = ptr.String(jtv) } - case "Reason": + case "LensArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceReason to be of type string, got %T instead", value) + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) } - sv.Reason = types.ChoiceReason(jtv) + sv.LensArn = ptr.String(jtv) } - case "Status": + case "LensName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected LensName to be of type string, got %T instead", value) } - sv.Status = types.ChoiceStatus(jtv) + sv.LensName = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentChoiceContent(v **types.ChoiceContent, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "LensStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensStatus to be of type string, got %T instead", value) + } + sv.LensStatus = types.LensStatus(jtv) + } - var sv *types.ChoiceContent - if *v == nil { - sv = &types.ChoiceContent{} - } else { - sv = *v - } + case "LensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.LensVersion = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "DisplayText": + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceContentDisplayText to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.DisplayText = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "Url": + case "Notes": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceContentUrl to be of type string, got %T instead", value) + return fmt.Errorf("expected Notes to be of type string, got %T instead", value) + } + sv.Notes = ptr.String(jtv) + } + + case "PillarReviewSummaries": + if err := awsRestjson1_deserializeDocumentPillarReviewSummaries(&sv.PillarReviewSummaries, value); err != nil { + return err + } + + case "PrioritizedRiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.PrioritizedRiskCounts, value); err != nil { + return err + } + + case "Profiles": + if err := awsRestjson1_deserializeDocumentWorkloadProfiles(&sv.Profiles, value); err != nil { + return err + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.Url = ptr.String(jtv) } default: @@ -8252,7 +10895,7 @@ func awsRestjson1_deserializeDocumentChoiceContent(v **types.ChoiceContent, valu return nil } -func awsRestjson1_deserializeDocumentChoiceImprovementPlan(v **types.ChoiceImprovementPlan, value interface{}) error { +func awsRestjson1_deserializeDocumentLensReviewReport(v **types.LensReviewReport, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8265,40 +10908,40 @@ func awsRestjson1_deserializeDocumentChoiceImprovementPlan(v **types.ChoiceImpro return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ChoiceImprovementPlan + var sv *types.LensReviewReport if *v == nil { - sv = &types.ChoiceImprovementPlan{} + sv = &types.LensReviewReport{} } else { sv = *v } for key, value := range shape { switch key { - case "ChoiceId": + case "Base64String": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + return fmt.Errorf("expected Base64String to be of type string, got %T instead", value) } - sv.ChoiceId = ptr.String(jtv) + sv.Base64String = ptr.String(jtv) } - case "DisplayText": + case "LensAlias": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DisplayText to be of type string, got %T instead", value) + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) } - sv.DisplayText = ptr.String(jtv) + sv.LensAlias = ptr.String(jtv) } - case "ImprovementPlanUrl": + case "LensArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImprovementPlanUrl to be of type string, got %T instead", value) + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) } - sv.ImprovementPlanUrl = ptr.String(jtv) + sv.LensArn = ptr.String(jtv) } default: @@ -8310,41 +10953,7 @@ func awsRestjson1_deserializeDocumentChoiceImprovementPlan(v **types.ChoiceImpro return nil } -func awsRestjson1_deserializeDocumentChoiceImprovementPlans(v *[]types.ChoiceImprovementPlan, 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.ChoiceImprovementPlan - if *v == nil { - cv = []types.ChoiceImprovementPlan{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ChoiceImprovementPlan - destAddr := &col - if err := awsRestjson1_deserializeDocumentChoiceImprovementPlan(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentChoices(v *[]types.Choice, value interface{}) error { +func awsRestjson1_deserializeDocumentLensReviewSummaries(v *[]types.LensReviewSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8357,17 +10966,17 @@ func awsRestjson1_deserializeDocumentChoices(v *[]types.Choice, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Choice + var cv []types.LensReviewSummary if *v == nil { - cv = []types.Choice{} + cv = []types.LensReviewSummary{} } else { cv = *v } for _, value := range shape { - var col types.Choice + var col types.LensReviewSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentChoice(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentLensReviewSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -8378,7 +10987,7 @@ func awsRestjson1_deserializeDocumentChoices(v *[]types.Choice, value interface{ return nil } -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8391,98 +11000,68 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var sv *types.LensReviewSummary if *v == nil { - sv = &types.ConflictException{} + sv = &types.LensReviewSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "LensAlias": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.LensAlias = ptr.String(jtv) } - case "ResourceId": + case "LensArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExceptionResourceId to be of type string, got %T instead", value) + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) } - sv.ResourceId = ptr.String(jtv) + sv.LensArn = ptr.String(jtv) } - case "ResourceType": + case "LensName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) + return fmt.Errorf("expected LensName to be of type string, got %T instead", value) } - sv.ResourceType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentConsolidatedReportMetric(v **types.ConsolidatedReportMetric, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", 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.ConsolidatedReportMetric - if *v == nil { - sv = &types.ConsolidatedReportMetric{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Lenses": - if err := awsRestjson1_deserializeDocumentLensMetrics(&sv.Lenses, value); err != nil { - return err + sv.LensName = ptr.String(jtv) } - case "LensesAppliedCount": + case "LensStatus": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensesAppliedCount to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected LensStatus to be of type string, got %T instead", value) } - sv.LensesAppliedCount = int32(i64) + sv.LensStatus = types.LensStatus(jtv) } - case "MetricType": + case "LensVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MetricType to be of type string, got %T instead", value) + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) } - sv.MetricType = types.MetricType(jtv) + sv.LensVersion = ptr.String(jtv) + } + + case "PrioritizedRiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.PrioritizedRiskCounts, value); err != nil { + return err + } + + case "Profiles": + if err := awsRestjson1_deserializeDocumentWorkloadProfiles(&sv.Profiles, value); err != nil { + return err } case "RiskCounts": @@ -8506,33 +11085,6 @@ func awsRestjson1_deserializeDocumentConsolidatedReportMetric(v **types.Consolid } } - case "WorkloadArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadArn to be of type string, got %T instead", value) - } - sv.WorkloadArn = ptr.String(jtv) - } - - case "WorkloadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) - } - sv.WorkloadId = ptr.String(jtv) - } - - case "WorkloadName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) - } - sv.WorkloadName = ptr.String(jtv) - } - default: _, _ = key, value @@ -8542,7 +11094,7 @@ func awsRestjson1_deserializeDocumentConsolidatedReportMetric(v **types.Consolid return nil } -func awsRestjson1_deserializeDocumentConsolidatedReportMetrics(v *[]types.ConsolidatedReportMetric, value interface{}) error { +func awsRestjson1_deserializeDocumentLensShareSummaries(v *[]types.LensShareSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8555,17 +11107,17 @@ func awsRestjson1_deserializeDocumentConsolidatedReportMetrics(v *[]types.Consol return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ConsolidatedReportMetric + var cv []types.LensShareSummary if *v == nil { - cv = []types.ConsolidatedReportMetric{} + cv = []types.LensShareSummary{} } else { cv = *v } for _, value := range shape { - var col types.ConsolidatedReportMetric + var col types.LensShareSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentConsolidatedReportMetric(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentLensShareSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -8576,7 +11128,74 @@ func awsRestjson1_deserializeDocumentConsolidatedReportMetrics(v *[]types.Consol return nil } -func awsRestjson1_deserializeDocumentImprovementSummaries(v *[]types.ImprovementSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentLensShareSummary(v **types.LensShareSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.LensShareSummary + if *v == nil { + sv = &types.LensShareSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SharedWith": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SharedWith to be of type string, got %T instead", value) + } + sv.SharedWith = ptr.String(jtv) + } + + case "ShareId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) + } + sv.ShareId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareStatus to be of type string, got %T instead", value) + } + sv.Status = types.ShareStatus(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLensSummaries(v *[]types.LensSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8589,17 +11208,17 @@ func awsRestjson1_deserializeDocumentImprovementSummaries(v *[]types.Improvement return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ImprovementSummary + var cv []types.LensSummary if *v == nil { - cv = []types.ImprovementSummary{} + cv = []types.LensSummary{} } else { cv = *v } for _, value := range shape { - var col types.ImprovementSummary + var col types.LensSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentImprovementSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentLensSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -8610,7 +11229,7 @@ func awsRestjson1_deserializeDocumentImprovementSummaries(v *[]types.Improvement return nil } -func awsRestjson1_deserializeDocumentImprovementSummary(v **types.ImprovementSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8623,103 +11242,117 @@ func awsRestjson1_deserializeDocumentImprovementSummary(v **types.ImprovementSum return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImprovementSummary + var sv *types.LensSummary if *v == nil { - sv = &types.ImprovementSummary{} + sv = &types.LensSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "ImprovementPlans": - if err := awsRestjson1_deserializeDocumentChoiceImprovementPlans(&sv.ImprovementPlans, value); err != nil { - return err + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } - case "ImprovementPlanUrl": + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImprovementPlanUrl to be of type string, got %T instead", value) + return fmt.Errorf("expected LensDescription to be of type string, got %T instead", value) } - sv.ImprovementPlanUrl = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "PillarId": + case "LensAlias": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) } - sv.PillarId = ptr.String(jtv) + sv.LensAlias = ptr.String(jtv) } - case "QuestionId": + case "LensArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) } - sv.QuestionId = ptr.String(jtv) + sv.LensArn = ptr.String(jtv) } - case "QuestionTitle": + case "LensName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + return fmt.Errorf("expected LensName to be of type string, got %T instead", value) } - sv.QuestionTitle = ptr.String(jtv) + sv.LensName = ptr.String(jtv) } - case "Risk": + case "LensStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + return fmt.Errorf("expected LensStatus to be of type string, got %T instead", value) } - sv.Risk = types.Risk(jtv) + sv.LensStatus = types.LensStatus(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "LensType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensType to be of type string, got %T instead", value) + } + sv.LensType = types.LensType(jtv) + } - var sv *types.InternalServerException - if *v == nil { - sv = &types.InternalServerException{} - } else { - sv = *v - } + case "LensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.LensVersion = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "Message": + case "Owner": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.Message = ptr.String(jtv) } default: @@ -8731,7 +11364,7 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return nil } -func awsRestjson1_deserializeDocumentLens(v **types.Lens, value interface{}) error { +func awsRestjson1_deserializeDocumentLensUpgradeSummary(v **types.LensUpgradeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8744,72 +11377,67 @@ func awsRestjson1_deserializeDocumentLens(v **types.Lens, value interface{}) err return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Lens + var sv *types.LensUpgradeSummary if *v == nil { - sv = &types.Lens{} + sv = &types.LensUpgradeSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "Description": + case "CurrentLensVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.CurrentLensVersion = ptr.String(jtv) } - case "LensArn": + case "LatestLensVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.LatestLensVersion = ptr.String(jtv) } - case "LensVersion": + case "LensAlias": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) } - sv.LensVersion = ptr.String(jtv) + sv.LensAlias = ptr.String(jtv) } - case "Name": + case "LensArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensName to be of type string, got %T instead", value) + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.LensArn = ptr.String(jtv) } - case "Owner": + case "WorkloadId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensOwner to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) } - sv.Owner = ptr.String(jtv) + sv.WorkloadId = ptr.String(jtv) } - case "ShareInvitationId": + case "WorkloadName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ShareInvitationId to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) } - sv.ShareInvitationId = ptr.String(jtv) - } - - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err + sv.WorkloadName = ptr.String(jtv) } default: @@ -8821,7 +11449,7 @@ func awsRestjson1_deserializeDocumentLens(v **types.Lens, value interface{}) err return nil } -func awsRestjson1_deserializeDocumentLensMetric(v **types.LensMetric, value interface{}) error { +func awsRestjson1_deserializeDocumentMilestone(v **types.Milestone, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8834,31 +11462,55 @@ func awsRestjson1_deserializeDocumentLensMetric(v **types.LensMetric, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensMetric + var sv *types.Milestone if *v == nil { - sv = &types.LensMetric{} + sv = &types.Milestone{} } else { sv = *v } for key, value := range shape { switch key { - case "LensArn": + case "MilestoneName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected MilestoneName to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.MilestoneName = ptr.String(jtv) } - case "Pillars": - if err := awsRestjson1_deserializeDocumentPillarMetrics(&sv.Pillars, value); err != nil { - return err + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) } - case "RiskCounts": - if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + case "RecordedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RecordedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Workload": + if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { return err } @@ -8871,7 +11523,7 @@ func awsRestjson1_deserializeDocumentLensMetric(v **types.LensMetric, value inte return nil } -func awsRestjson1_deserializeDocumentLensMetrics(v *[]types.LensMetric, value interface{}) error { +func awsRestjson1_deserializeDocumentMilestoneSummaries(v *[]types.MilestoneSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8884,17 +11536,17 @@ func awsRestjson1_deserializeDocumentLensMetrics(v *[]types.LensMetric, value in return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LensMetric + var cv []types.MilestoneSummary if *v == nil { - cv = []types.LensMetric{} + cv = []types.MilestoneSummary{} } else { cv = *v } for _, value := range shape { - var col types.LensMetric + var col types.MilestoneSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentLensMetric(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentMilestoneSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -8905,7 +11557,7 @@ func awsRestjson1_deserializeDocumentLensMetrics(v *[]types.LensMetric, value in return nil } -func awsRestjson1_deserializeDocumentLensReview(v **types.LensReview, value interface{}) error { +func awsRestjson1_deserializeDocumentMilestoneSummary(v **types.MilestoneSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8918,102 +11570,135 @@ func awsRestjson1_deserializeDocumentLensReview(v **types.LensReview, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensReview + var sv *types.MilestoneSummary if *v == nil { - sv = &types.LensReview{} + sv = &types.MilestoneSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "LensAlias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) - } - sv.LensAlias = ptr.String(jtv) - } - - case "LensArn": + case "MilestoneName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected MilestoneName to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.MilestoneName = ptr.String(jtv) } - case "LensName": + case "MilestoneNumber": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected LensName to be of type string, got %T instead", value) + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) } - sv.LensName = ptr.String(jtv) - } - - case "LensStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensStatus to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.LensStatus = types.LensStatus(jtv) + sv.MilestoneNumber = int32(i64) } - case "LensVersion": + case "RecordedAt": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) - } - sv.LensVersion = ptr.String(jtv) - } + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RecordedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - 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: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - case "Notes": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Notes to be of type string, got %T instead", value) } - sv.Notes = ptr.String(jtv) } - case "PillarReviewSummaries": - if err := awsRestjson1_deserializeDocumentPillarReviewSummaries(&sv.PillarReviewSummaries, value); err != nil { + case "WorkloadSummary": + if err := awsRestjson1_deserializeDocumentWorkloadSummary(&sv.WorkloadSummary, value); err != nil { return err } - case "RiskCounts": - if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { - return err - } + default: + _, _ = key, value - case "UpdatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + } + *v = sv + return nil +} - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) +func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.NotificationSummary, 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.NotificationSummary + if *v == nil { + cv = []types.NotificationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotificationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentNotificationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationSummary(v **types.NotificationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NotificationSummary + if *v == nil { + sv = &types.NotificationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensUpgradeSummary": + if err := awsRestjson1_deserializeDocumentLensUpgradeSummary(&sv.LensUpgradeSummary, value); err != nil { + return err + } + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationType to be of type string, got %T instead", value) } + sv.Type = types.NotificationType(jtv) } default: @@ -9025,7 +11710,7 @@ func awsRestjson1_deserializeDocumentLensReview(v **types.LensReview, value inte return nil } -func awsRestjson1_deserializeDocumentLensReviewReport(v **types.LensReviewReport, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9038,40 +11723,45 @@ func awsRestjson1_deserializeDocumentLensReviewReport(v **types.LensReviewReport return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensReviewReport + var sv *types.PillarDifference if *v == nil { - sv = &types.LensReviewReport{} + sv = &types.PillarDifference{} } else { sv = *v } for key, value := range shape { switch key { - case "Base64String": + case "DifferenceStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Base64String to be of type string, got %T instead", value) + return fmt.Errorf("expected DifferenceStatus to be of type string, got %T instead", value) } - sv.Base64String = ptr.String(jtv) + sv.DifferenceStatus = types.DifferenceStatus(jtv) } - case "LensAlias": + case "PillarId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) } - sv.LensAlias = ptr.String(jtv) + sv.PillarId = ptr.String(jtv) } - case "LensArn": + case "PillarName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected PillarName to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.PillarName = ptr.String(jtv) + } + + case "QuestionDifferences": + if err := awsRestjson1_deserializeDocumentQuestionDifferences(&sv.QuestionDifferences, value); err != nil { + return err } default: @@ -9083,7 +11773,7 @@ func awsRestjson1_deserializeDocumentLensReviewReport(v **types.LensReviewReport return nil } -func awsRestjson1_deserializeDocumentLensReviewSummaries(v *[]types.LensReviewSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9096,17 +11786,17 @@ func awsRestjson1_deserializeDocumentLensReviewSummaries(v *[]types.LensReviewSu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LensReviewSummary + var cv []types.PillarDifference if *v == nil { - cv = []types.LensReviewSummary{} + cv = []types.PillarDifference{} } else { cv = *v } for _, value := range shape { - var col types.LensReviewSummary + var col types.PillarDifference destAddr := &col - if err := awsRestjson1_deserializeDocumentLensReviewSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentPillarDifference(&destAddr, value); err != nil { return err } col = *destAddr @@ -9117,7 +11807,7 @@ func awsRestjson1_deserializeDocumentLensReviewSummaries(v *[]types.LensReviewSu return nil } -func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarMetric(v **types.PillarMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9130,58 +11820,27 @@ func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSumma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensReviewSummary + var sv *types.PillarMetric if *v == nil { - sv = &types.LensReviewSummary{} + sv = &types.PillarMetric{} } else { sv = *v } for key, value := range shape { switch key { - case "LensAlias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) - } - sv.LensAlias = ptr.String(jtv) - } - - case "LensArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) - } - sv.LensArn = ptr.String(jtv) - } - - case "LensName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensName to be of type string, got %T instead", value) - } - sv.LensName = ptr.String(jtv) - } - - case "LensStatus": + case "PillarId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) } - sv.LensStatus = types.LensStatus(jtv) + sv.PillarId = ptr.String(jtv) } - case "LensVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) - } - sv.LensVersion = ptr.String(jtv) + case "Questions": + if err := awsRestjson1_deserializeDocumentQuestionMetrics(&sv.Questions, value); err != nil { + return err } case "RiskCounts": @@ -9189,22 +11848,6 @@ func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSumma return err } - case "UpdatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - default: _, _ = key, value @@ -9214,7 +11857,7 @@ func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSumma return nil } -func awsRestjson1_deserializeDocumentLensShareSummaries(v *[]types.LensShareSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarMetrics(v *[]types.PillarMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9227,17 +11870,17 @@ func awsRestjson1_deserializeDocumentLensShareSummaries(v *[]types.LensShareSumm return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LensShareSummary + var cv []types.PillarMetric if *v == nil { - cv = []types.LensShareSummary{} + cv = []types.PillarMetric{} } else { cv = *v } for _, value := range shape { - var col types.LensShareSummary + var col types.PillarMetric destAddr := &col - if err := awsRestjson1_deserializeDocumentLensShareSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentPillarMetric(&destAddr, value); err != nil { return err } col = *destAddr @@ -9248,7 +11891,41 @@ func awsRestjson1_deserializeDocumentLensShareSummaries(v *[]types.LensShareSumm return nil } -func awsRestjson1_deserializeDocumentLensShareSummary(v **types.LensShareSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarReviewSummary, 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.PillarReviewSummary + if *v == nil { + cv = []types.PillarReviewSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PillarReviewSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentPillarReviewSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPillarReviewSummary(v **types.PillarReviewSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9261,49 +11938,50 @@ func awsRestjson1_deserializeDocumentLensShareSummary(v **types.LensShareSummary return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensShareSummary + var sv *types.PillarReviewSummary if *v == nil { - sv = &types.LensShareSummary{} + sv = &types.PillarReviewSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "SharedWith": + case "Notes": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SharedWith to be of type string, got %T instead", value) + return fmt.Errorf("expected Notes to be of type string, got %T instead", value) } - sv.SharedWith = ptr.String(jtv) + sv.Notes = ptr.String(jtv) } - case "ShareId": + case "PillarId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) } - sv.ShareId = ptr.String(jtv) + sv.PillarId = ptr.String(jtv) } - case "Status": + case "PillarName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ShareStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected PillarName to be of type string, got %T instead", value) } - sv.Status = types.ShareStatus(jtv) + sv.PillarName = ptr.String(jtv) } - case "StatusMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) - } - sv.StatusMessage = ptr.String(jtv) + case "PrioritizedRiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.PrioritizedRiskCounts, value); err != nil { + return err + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err } default: @@ -9315,41 +11993,7 @@ func awsRestjson1_deserializeDocumentLensShareSummary(v **types.LensShareSummary return nil } -func awsRestjson1_deserializeDocumentLensSummaries(v *[]types.LensSummary, 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.LensSummary - if *v == nil { - cv = []types.LensSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.LensSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentLensSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9362,9 +12006,9 @@ func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensSummary + var sv *types.Profile if *v == nil { - sv = &types.LensSummary{} + sv = &types.Profile{} } else { sv = *v } @@ -9387,76 +12031,68 @@ func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value in } } - case "Description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "LensAlias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) - } - sv.LensAlias = ptr.String(jtv) - } - - case "LensArn": + case "Owner": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "LensName": + case "ProfileArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensName to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) } - sv.LensName = ptr.String(jtv) + sv.ProfileArn = ptr.String(jtv) } - case "LensStatus": + case "ProfileDescription": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileDescription to be of type string, got %T instead", value) } - sv.LensStatus = types.LensStatus(jtv) + sv.ProfileDescription = ptr.String(jtv) } - case "LensType": + case "ProfileName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensType to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value) } - sv.LensType = types.LensType(jtv) + sv.ProfileName = ptr.String(jtv) } - case "LensVersion": + case "ProfileQuestions": + if err := awsRestjson1_deserializeDocumentProfileQuestions(&sv.ProfileQuestions, value); err != nil { + return err + } + + case "ProfileVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) } - sv.LensVersion = ptr.String(jtv) + sv.ProfileVersion = ptr.String(jtv) } - case "Owner": + case "ShareInvitationId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected ShareInvitationId to be of type string, got %T instead", value) } - sv.Owner = ptr.String(jtv) + sv.ShareInvitationId = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } case "UpdatedAt": @@ -9484,7 +12120,7 @@ func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value in return nil } -func awsRestjson1_deserializeDocumentLensUpgradeSummary(v **types.LensUpgradeSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileChoice(v **types.ProfileChoice, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9497,67 +12133,40 @@ func awsRestjson1_deserializeDocumentLensUpgradeSummary(v **types.LensUpgradeSum return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensUpgradeSummary + var sv *types.ProfileChoice if *v == nil { - sv = &types.LensUpgradeSummary{} + sv = &types.ProfileChoice{} } else { sv = *v } for key, value := range shape { switch key { - case "CurrentLensVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) - } - sv.CurrentLensVersion = ptr.String(jtv) - } - - case "LatestLensVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) - } - sv.LatestLensVersion = ptr.String(jtv) - } - - case "LensAlias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) - } - sv.LensAlias = ptr.String(jtv) - } - - case "LensArn": + case "ChoiceDescription": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceDescription to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.ChoiceDescription = ptr.String(jtv) } - case "WorkloadId": + case "ChoiceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.ChoiceId = ptr.String(jtv) } - case "WorkloadName": + case "ChoiceTitle": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) } - sv.WorkloadName = ptr.String(jtv) + sv.ChoiceTitle = ptr.String(jtv) } default: @@ -9569,7 +12178,41 @@ func awsRestjson1_deserializeDocumentLensUpgradeSummary(v **types.LensUpgradeSum return nil } -func awsRestjson1_deserializeDocumentMilestone(v **types.Milestone, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileNotificationSummaries(v *[]types.ProfileNotificationSummary, 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.ProfileNotificationSummary + if *v == nil { + cv = []types.ProfileNotificationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProfileNotificationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentProfileNotificationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProfileNotificationSummary(v **types.ProfileNotificationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9582,56 +12225,76 @@ func awsRestjson1_deserializeDocumentMilestone(v **types.Milestone, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Milestone + var sv *types.ProfileNotificationSummary if *v == nil { - sv = &types.Milestone{} + sv = &types.ProfileNotificationSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "MilestoneName": + case "CurrentProfileVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MilestoneName to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) } - sv.MilestoneName = ptr.String(jtv) + sv.CurrentProfileVersion = ptr.String(jtv) } - case "MilestoneNumber": + case "LatestProfileVersion": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.LatestProfileVersion = ptr.String(jtv) + } + + case "ProfileArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) } - sv.MilestoneNumber = int32(i64) + sv.ProfileArn = ptr.String(jtv) } - case "RecordedAt": + case "ProfileName": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.RecordedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value) + } + sv.ProfileName = ptr.String(jtv) + } - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileNotificationType to be of type string, got %T instead", value) + } + sv.Type = types.ProfileNotificationType(jtv) + } + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) } + sv.WorkloadId = ptr.String(jtv) } - case "Workload": - if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { - return err + case "WorkloadName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + } + sv.WorkloadName = ptr.String(jtv) } default: @@ -9643,41 +12306,7 @@ func awsRestjson1_deserializeDocumentMilestone(v **types.Milestone, value interf return nil } -func awsRestjson1_deserializeDocumentMilestoneSummaries(v *[]types.MilestoneSummary, 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.MilestoneSummary - if *v == nil { - cv = []types.MilestoneSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.MilestoneSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentMilestoneSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentMilestoneSummary(v **types.MilestoneSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileQuestion(v **types.ProfileQuestion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9690,68 +12319,122 @@ func awsRestjson1_deserializeDocumentMilestoneSummary(v **types.MilestoneSummary return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MilestoneSummary + var sv *types.ProfileQuestion if *v == nil { - sv = &types.MilestoneSummary{} + sv = &types.ProfileQuestion{} } else { sv = *v } for key, value := range shape { switch key { - case "MilestoneName": + case "MaxSelectedChoices": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected MilestoneName to be of type string, got %T instead", value) + return fmt.Errorf("expected MaxSelectedProfileChoices to be json.Number, got %T instead", value) } - sv.MilestoneName = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxSelectedChoices = int32(i64) } - case "MilestoneNumber": + case "MinSelectedChoices": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + return fmt.Errorf("expected MinSelectedProfileChoices to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.MilestoneNumber = int32(i64) + sv.MinSelectedChoices = int32(i64) } - case "RecordedAt": + case "QuestionChoices": + if err := awsRestjson1_deserializeDocumentProfileQuestionChoices(&sv.QuestionChoices, value); err != nil { + return err + } + + case "QuestionDescription": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.RecordedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionDescription to be of type string, got %T instead", value) + } + sv.QuestionDescription = ptr.String(jtv) + } - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + case "QuestionTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) } + sv.QuestionTitle = ptr.String(jtv) } - case "WorkloadSummary": - if err := awsRestjson1_deserializeDocumentWorkloadSummary(&sv.WorkloadSummary, value); err != nil { + case "SelectedChoiceIds": + if err := awsRestjson1_deserializeDocumentSelectedChoiceIds(&sv.SelectedChoiceIds, value); err != nil { return err } - default: - _, _ = key, value + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentProfileQuestionChoices(v *[]types.ProfileChoice, 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.ProfileChoice + if *v == nil { + cv = []types.ProfileChoice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProfileChoice + destAddr := &col + if err := awsRestjson1_deserializeDocumentProfileChoice(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.NotificationSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileQuestions(v *[]types.ProfileQuestion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9764,17 +12447,17 @@ func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.Notificati return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.NotificationSummary + var cv []types.ProfileQuestion if *v == nil { - cv = []types.NotificationSummary{} + cv = []types.ProfileQuestion{} } else { cv = *v } for _, value := range shape { - var col types.NotificationSummary + var col types.ProfileQuestion destAddr := &col - if err := awsRestjson1_deserializeDocumentNotificationSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentProfileQuestion(&destAddr, value); err != nil { return err } col = *destAddr @@ -9785,7 +12468,7 @@ func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.Notificati return nil } -func awsRestjson1_deserializeDocumentNotificationSummary(v **types.NotificationSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileShareSummaries(v *[]types.ProfileShareSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9793,44 +12476,33 @@ func awsRestjson1_deserializeDocumentNotificationSummary(v **types.NotificationS return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.NotificationSummary + var cv []types.ProfileShareSummary if *v == nil { - sv = &types.NotificationSummary{} + cv = []types.ProfileShareSummary{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "LensUpgradeSummary": - if err := awsRestjson1_deserializeDocumentLensUpgradeSummary(&sv.LensUpgradeSummary, value); err != nil { - return err - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NotificationType to be of type string, got %T instead", value) - } - sv.Type = types.NotificationType(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.ProfileShareSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentProfileShareSummary(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileShareSummary(v **types.ProfileShareSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9843,45 +12515,49 @@ func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PillarDifference + var sv *types.ProfileShareSummary if *v == nil { - sv = &types.PillarDifference{} + sv = &types.ProfileShareSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "DifferenceStatus": + case "SharedWith": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DifferenceStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected SharedWith to be of type string, got %T instead", value) } - sv.DifferenceStatus = types.DifferenceStatus(jtv) + sv.SharedWith = ptr.String(jtv) } - case "PillarId": + case "ShareId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) } - sv.PillarId = ptr.String(jtv) + sv.ShareId = ptr.String(jtv) } - case "PillarName": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PillarName to be of type string, got %T instead", value) + return fmt.Errorf("expected ShareStatus to be of type string, got %T instead", value) } - sv.PillarName = ptr.String(jtv) + sv.Status = types.ShareStatus(jtv) } - case "QuestionDifferences": - if err := awsRestjson1_deserializeDocumentQuestionDifferences(&sv.QuestionDifferences, value); err != nil { - return err + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) } default: @@ -9893,7 +12569,7 @@ func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference return nil } -func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifference, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileSummaries(v *[]types.ProfileSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9906,17 +12582,17 @@ func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifferen return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PillarDifference + var cv []types.ProfileSummary if *v == nil { - cv = []types.PillarDifference{} + cv = []types.ProfileSummary{} } else { cv = *v } for _, value := range shape { - var col types.PillarDifference + var col types.ProfileSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentPillarDifference(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentProfileSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -9927,7 +12603,7 @@ func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifferen return nil } -func awsRestjson1_deserializeDocumentPillarMetric(v **types.PillarMetric, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileSummary(v **types.ProfileSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9940,32 +12616,90 @@ func awsRestjson1_deserializeDocumentPillarMetric(v **types.PillarMetric, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PillarMetric + var sv *types.ProfileSummary if *v == nil { - sv = &types.PillarMetric{} + sv = &types.ProfileSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "PillarId": + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Owner": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } - sv.PillarId = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "Questions": - if err := awsRestjson1_deserializeDocumentQuestionMetrics(&sv.Questions, value); err != nil { - return err + case "ProfileArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) + } + sv.ProfileArn = ptr.String(jtv) } - case "RiskCounts": - if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { - return err + case "ProfileDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileDescription to be of type string, got %T instead", value) + } + sv.ProfileDescription = ptr.String(jtv) + } + + case "ProfileName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value) + } + sv.ProfileName = ptr.String(jtv) + } + + case "ProfileVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) + } + sv.ProfileVersion = ptr.String(jtv) + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } default: @@ -9977,7 +12711,7 @@ func awsRestjson1_deserializeDocumentPillarMetric(v **types.PillarMetric, value return nil } -func awsRestjson1_deserializeDocumentPillarMetrics(v *[]types.PillarMetric, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileTemplate(v **types.ProfileTemplate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9985,33 +12719,76 @@ func awsRestjson1_deserializeDocumentPillarMetrics(v *[]types.PillarMetric, valu return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PillarMetric + var sv *types.ProfileTemplate if *v == nil { - cv = []types.PillarMetric{} + sv = &types.ProfileTemplate{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.PillarMetric - destAddr := &col - if err := awsRestjson1_deserializeDocumentPillarMetric(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } + } + + case "TemplateName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value) + } + sv.TemplateName = ptr.String(jtv) + } + + case "TemplateQuestions": + if err := awsRestjson1_deserializeDocumentTemplateQuestions(&sv.TemplateQuestions, value); err != nil { + return err + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarReviewSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileTemplateChoice(v **types.ProfileTemplateChoice, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10019,33 +12796,57 @@ func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarRevi return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PillarReviewSummary + var sv *types.ProfileTemplateChoice if *v == nil { - cv = []types.PillarReviewSummary{} + sv = &types.ProfileTemplateChoice{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.PillarReviewSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentPillarReviewSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "ChoiceDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceDescription to be of type string, got %T instead", value) + } + sv.ChoiceDescription = ptr.String(jtv) + } + + case "ChoiceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + } + sv.ChoiceId = ptr.String(jtv) + } + + case "ChoiceTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) + } + sv.ChoiceTitle = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentPillarReviewSummary(v **types.PillarReviewSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileTemplateQuestion(v **types.ProfileTemplateQuestion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10058,45 +12859,71 @@ func awsRestjson1_deserializeDocumentPillarReviewSummary(v **types.PillarReviewS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PillarReviewSummary + var sv *types.ProfileTemplateQuestion if *v == nil { - sv = &types.PillarReviewSummary{} + sv = &types.ProfileTemplateQuestion{} } else { sv = *v } for key, value := range shape { switch key { - case "Notes": + case "MaxSelectedChoices": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Notes to be of type string, got %T instead", value) + return fmt.Errorf("expected MaxSelectedProfileChoices to be json.Number, got %T instead", value) } - sv.Notes = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxSelectedChoices = int32(i64) } - case "PillarId": + case "MinSelectedChoices": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MinSelectedProfileChoices to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MinSelectedChoices = int32(i64) + } + + case "QuestionChoices": + if err := awsRestjson1_deserializeDocumentProfileTemplateQuestionChoices(&sv.QuestionChoices, value); err != nil { + return err + } + + case "QuestionDescription": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + return fmt.Errorf("expected QuestionDescription to be of type string, got %T instead", value) } - sv.PillarId = ptr.String(jtv) + sv.QuestionDescription = ptr.String(jtv) } - case "PillarName": + case "QuestionId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PillarName to be of type string, got %T instead", value) + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) } - sv.PillarName = ptr.String(jtv) + sv.QuestionId = ptr.String(jtv) } - case "RiskCounts": - if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { - return err + case "QuestionTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + } + sv.QuestionTitle = ptr.String(jtv) } default: @@ -10108,6 +12935,40 @@ func awsRestjson1_deserializeDocumentPillarReviewSummary(v **types.PillarReviewS return nil } +func awsRestjson1_deserializeDocumentProfileTemplateQuestionChoices(v *[]types.ProfileTemplateChoice, 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.ProfileTemplateChoice + if *v == nil { + cv = []types.ProfileTemplateChoice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProfileTemplateChoice + destAddr := &col + if err := awsRestjson1_deserializeDocumentProfileTemplateChoice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentQuestionDifference(v **types.QuestionDifference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10386,6 +13247,42 @@ func awsRestjson1_deserializeDocumentRiskCounts(v *map[string]int32, value inter return nil } +func awsRestjson1_deserializeDocumentSelectedChoiceIds(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 ChoiceId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentSelectedChoices(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10538,6 +13435,15 @@ func awsRestjson1_deserializeDocumentShareInvitation(v **types.ShareInvitation, sv.LensArn = ptr.String(jtv) } + case "ProfileArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) + } + sv.ProfileArn = ptr.String(jtv) + } + case "ShareInvitationId": if value != nil { jtv, ok := value.(string) @@ -10657,6 +13563,24 @@ func awsRestjson1_deserializeDocumentShareInvitationSummary(v **types.ShareInvit sv.PermissionType = types.PermissionType(jtv) } + case "ProfileArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) + } + sv.ProfileArn = ptr.String(jtv) + } + + case "ProfileName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value) + } + sv.ProfileName = ptr.String(jtv) + } + case "SharedBy": if value != nil { jtv, ok := value.(string) @@ -10756,6 +13680,40 @@ func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interfac return nil } +func awsRestjson1_deserializeDocumentTemplateQuestions(v *[]types.ProfileTemplateQuestion, 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.ProfileTemplateQuestion + if *v == nil { + cv = []types.ProfileTemplateQuestion{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProfileTemplateQuestion + destAddr := &col + if err := awsRestjson1_deserializeDocumentProfileTemplateQuestion(&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) @@ -11159,6 +14117,16 @@ func awsRestjson1_deserializeDocumentWorkload(v **types.Workload, value interfac return err } + case "PrioritizedRiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.PrioritizedRiskCounts, value); err != nil { + return err + } + + case "Profiles": + if err := awsRestjson1_deserializeDocumentWorkloadProfiles(&sv.Profiles, value); err != nil { + return err + } + case "ReviewOwner": if value != nil { jtv, ok := value.(string) @@ -11516,6 +14484,89 @@ func awsRestjson1_deserializeDocumentWorkloadPillarPriorities(v *[]string, value return nil } +func awsRestjson1_deserializeDocumentWorkloadProfile(v **types.WorkloadProfile, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.WorkloadProfile + if *v == nil { + sv = &types.WorkloadProfile{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProfileArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) + } + sv.ProfileArn = ptr.String(jtv) + } + + case "ProfileVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) + } + sv.ProfileVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadProfiles(v *[]types.WorkloadProfile, 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.WorkloadProfile + if *v == nil { + cv = []types.WorkloadProfile{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WorkloadProfile + destAddr := &col + if err := awsRestjson1_deserializeDocumentWorkloadProfile(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentWorkloadResourceDefinition(v *[]types.DefinitionType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11835,6 +14886,16 @@ func awsRestjson1_deserializeDocumentWorkloadSummary(v **types.WorkloadSummary, sv.Owner = ptr.String(jtv) } + case "PrioritizedRiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.PrioritizedRiskCounts, value); err != nil { + return err + } + + case "Profiles": + if err := awsRestjson1_deserializeDocumentWorkloadProfiles(&sv.Profiles, value); err != nil { + return err + } + case "RiskCounts": if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { return err diff --git a/service/wellarchitected/generated.json b/service/wellarchitected/generated.json index 11d05774f2b..1d487ee696c 100644 --- a/service/wellarchitected/generated.json +++ b/service/wellarchitected/generated.json @@ -9,16 +9,22 @@ "api_client.go", "api_client_test.go", "api_op_AssociateLenses.go", + "api_op_AssociateProfiles.go", "api_op_CreateLensShare.go", "api_op_CreateLensVersion.go", "api_op_CreateMilestone.go", + "api_op_CreateProfile.go", + "api_op_CreateProfileShare.go", "api_op_CreateWorkload.go", "api_op_CreateWorkloadShare.go", "api_op_DeleteLens.go", "api_op_DeleteLensShare.go", + "api_op_DeleteProfile.go", + "api_op_DeleteProfileShare.go", "api_op_DeleteWorkload.go", "api_op_DeleteWorkloadShare.go", "api_op_DisassociateLenses.go", + "api_op_DisassociateProfiles.go", "api_op_ExportLens.go", "api_op_GetAnswer.go", "api_op_GetConsolidatedReport.go", @@ -27,6 +33,8 @@ "api_op_GetLensReviewReport.go", "api_op_GetLensVersionDifference.go", "api_op_GetMilestone.go", + "api_op_GetProfile.go", + "api_op_GetProfileTemplate.go", "api_op_GetWorkload.go", "api_op_ImportLens.go", "api_op_ListAnswers.go", @@ -38,6 +46,9 @@ "api_op_ListLenses.go", "api_op_ListMilestones.go", "api_op_ListNotifications.go", + "api_op_ListProfileNotifications.go", + "api_op_ListProfileShares.go", + "api_op_ListProfiles.go", "api_op_ListShareInvitations.go", "api_op_ListTagsForResource.go", "api_op_ListWorkloadShares.go", @@ -47,10 +58,12 @@ "api_op_UpdateAnswer.go", "api_op_UpdateGlobalSettings.go", "api_op_UpdateLensReview.go", + "api_op_UpdateProfile.go", "api_op_UpdateShareInvitation.go", "api_op_UpdateWorkload.go", "api_op_UpdateWorkloadShare.go", "api_op_UpgradeLensReview.go", + "api_op_UpgradeProfileVersion.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/wellarchitected/serializers.go b/service/wellarchitected/serializers.go index 00a6209ea61..dbd1a29cee2 100644 --- a/service/wellarchitected/serializers.go +++ b/service/wellarchitected/serializers.go @@ -97,6 +97,89 @@ func awsRestjson1_serializeOpDocumentAssociateLensesInput(v *AssociateLensesInpu return nil } +type awsRestjson1_serializeOpAssociateProfiles struct { +} + +func (*awsRestjson1_serializeOpAssociateProfiles) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateProfilesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/associateProfiles") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAssociateProfilesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociateProfilesInput(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_serializeOpHttpBindingsAssociateProfilesInput(v *AssociateProfilesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateProfilesInput(v *AssociateProfilesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ProfileArns != nil { + ok := object.Key("ProfileArns") + if err := awsRestjson1_serializeDocumentProfileArns(v.ProfileArns, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateLensShare struct { } @@ -360,6 +443,184 @@ func awsRestjson1_serializeOpDocumentCreateMilestoneInput(v *CreateMilestoneInpu return nil } +type awsRestjson1_serializeOpCreateProfile struct { +} + +func (*awsRestjson1_serializeOpCreateProfile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateProfileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/profiles") + 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_serializeOpDocumentCreateProfileInput(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_serializeOpHttpBindingsCreateProfileInput(v *CreateProfileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateProfileInput(v *CreateProfileInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.ProfileDescription != nil { + ok := object.Key("ProfileDescription") + ok.String(*v.ProfileDescription) + } + + if v.ProfileName != nil { + ok := object.Key("ProfileName") + ok.String(*v.ProfileName) + } + + if v.ProfileQuestions != nil { + ok := object.Key("ProfileQuestions") + if err := awsRestjson1_serializeDocumentProfileQuestionUpdates(v.ProfileQuestions, 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_serializeOpCreateProfileShare struct { +} + +func (*awsRestjson1_serializeOpCreateProfileShare) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateProfileShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateProfileShareInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/profiles/{ProfileArn}/shares") + 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_serializeOpHttpBindingsCreateProfileShareInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateProfileShareInput(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_serializeOpHttpBindingsCreateProfileShareInput(v *CreateProfileShareInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProfileArn == nil || len(*v.ProfileArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProfileArn must not be empty")} + } + if v.ProfileArn != nil { + if err := encoder.SetURI("ProfileArn").String(*v.ProfileArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateProfileShareInput(v *CreateProfileShareInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.SharedWith != nil { + ok := object.Key("SharedWith") + ok.String(*v.SharedWith) + } + + return nil +} + type awsRestjson1_serializeOpCreateWorkload struct { } @@ -504,6 +765,13 @@ func awsRestjson1_serializeOpDocumentCreateWorkloadInput(v *CreateWorkloadInput, } } + if v.ProfileArns != nil { + ok := object.Key("ProfileArns") + if err := awsRestjson1_serializeDocumentWorkloadProfileArns(v.ProfileArns, ok); err != nil { + return err + } + } + if v.ReviewOwner != nil { ok := object.Key("ReviewOwner") ok.String(*v.ReviewOwner) @@ -752,14 +1020,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteLensShareInput(v *DeleteLensShare return nil } -type awsRestjson1_serializeOpDeleteWorkload struct { +type awsRestjson1_serializeOpDeleteProfile struct { } -func (*awsRestjson1_serializeOpDeleteWorkload) ID() string { +func (*awsRestjson1_serializeOpDeleteProfile) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -767,13 +1035,13 @@ func (m *awsRestjson1_serializeOpDeleteWorkload) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteWorkloadInput) + input, ok := in.Parameters.(*DeleteProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}") + opPath, opQuery := httpbinding.SplitURI("/profiles/{ProfileArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -782,7 +1050,7 @@ func (m *awsRestjson1_serializeOpDeleteWorkload) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteWorkloadInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteProfileInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -793,7 +1061,7 @@ func (m *awsRestjson1_serializeOpDeleteWorkload) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadInput(v *DeleteWorkloadInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteProfileInput(v *DeleteProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -802,11 +1070,11 @@ func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadInput(v *DeleteWorkloadIn encoder.SetQuery("ClientRequestToken").String(*v.ClientRequestToken) } - if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + if v.ProfileArn == nil || len(*v.ProfileArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProfileArn must not be empty")} } - if v.WorkloadId != nil { - if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + if v.ProfileArn != nil { + if err := encoder.SetURI("ProfileArn").String(*v.ProfileArn); err != nil { return err } } @@ -814,14 +1082,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadInput(v *DeleteWorkloadIn return nil } -type awsRestjson1_serializeOpDeleteWorkloadShare struct { +type awsRestjson1_serializeOpDeleteProfileShare struct { } -func (*awsRestjson1_serializeOpDeleteWorkloadShare) ID() string { +func (*awsRestjson1_serializeOpDeleteProfileShare) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteWorkloadShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteProfileShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -829,13 +1097,13 @@ func (m *awsRestjson1_serializeOpDeleteWorkloadShare) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteWorkloadShareInput) + input, ok := in.Parameters.(*DeleteProfileShareInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/shares/{ShareId}") + opPath, opQuery := httpbinding.SplitURI("/profiles/{ProfileArn}/shares/{ShareId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -844,7 +1112,7 @@ func (m *awsRestjson1_serializeOpDeleteWorkloadShare) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteWorkloadShareInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteProfileShareInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -855,7 +1123,7 @@ func (m *awsRestjson1_serializeOpDeleteWorkloadShare) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadShareInput(v *DeleteWorkloadShareInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteProfileShareInput(v *DeleteProfileShareInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -864,20 +1132,20 @@ func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadShareInput(v *DeleteWorkl encoder.SetQuery("ClientRequestToken").String(*v.ClientRequestToken) } - if v.ShareId == nil || len(*v.ShareId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ShareId must not be empty")} + if v.ProfileArn == nil || len(*v.ProfileArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProfileArn must not be empty")} } - if v.ShareId != nil { - if err := encoder.SetURI("ShareId").String(*v.ShareId); err != nil { + if v.ProfileArn != nil { + if err := encoder.SetURI("ProfileArn").String(*v.ProfileArn); err != nil { return err } } - if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + if v.ShareId == nil || len(*v.ShareId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ShareId must not be empty")} } - if v.WorkloadId != nil { - if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + if v.ShareId != nil { + if err := encoder.SetURI("ShareId").String(*v.ShareId); err != nil { return err } } @@ -885,10 +1153,143 @@ func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadShareInput(v *DeleteWorkl return nil } -type awsRestjson1_serializeOpDisassociateLenses struct { +type awsRestjson1_serializeOpDeleteWorkload struct { } -func (*awsRestjson1_serializeOpDisassociateLenses) ID() string { +func (*awsRestjson1_serializeOpDeleteWorkload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWorkloadInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}") + 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_serializeOpHttpBindingsDeleteWorkloadInput(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_serializeOpHttpBindingsDeleteWorkloadInput(v *DeleteWorkloadInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientRequestToken != nil { + encoder.SetQuery("ClientRequestToken").String(*v.ClientRequestToken) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWorkloadShare struct { +} + +func (*awsRestjson1_serializeOpDeleteWorkloadShare) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWorkloadShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWorkloadShareInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/shares/{ShareId}") + 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_serializeOpHttpBindingsDeleteWorkloadShareInput(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_serializeOpHttpBindingsDeleteWorkloadShareInput(v *DeleteWorkloadShareInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientRequestToken != nil { + encoder.SetQuery("ClientRequestToken").String(*v.ClientRequestToken) + } + + if v.ShareId == nil || len(*v.ShareId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ShareId must not be empty")} + } + if v.ShareId != nil { + if err := encoder.SetURI("ShareId").String(*v.ShareId); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateLenses struct { +} + +func (*awsRestjson1_serializeOpDisassociateLenses) ID() string { return "OperationSerializer" } @@ -968,6 +1369,89 @@ func awsRestjson1_serializeOpDocumentDisassociateLensesInput(v *DisassociateLens return nil } +type awsRestjson1_serializeOpDisassociateProfiles struct { +} + +func (*awsRestjson1_serializeOpDisassociateProfiles) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateProfilesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/disassociateProfiles") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDisassociateProfilesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDisassociateProfilesInput(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_serializeOpHttpBindingsDisassociateProfilesInput(v *DisassociateProfilesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDisassociateProfilesInput(v *DisassociateProfilesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ProfileArns != nil { + ok := object.Key("ProfileArns") + if err := awsRestjson1_serializeDocumentProfileArns(v.ProfileArns, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpExportLens struct { } @@ -1311,11 +1795,148 @@ func awsRestjson1_serializeOpHttpBindingsGetLensReviewInput(v *GetLensReviewInpu type awsRestjson1_serializeOpGetLensReviewReport struct { } -func (*awsRestjson1_serializeOpGetLensReviewReport) ID() string { +func (*awsRestjson1_serializeOpGetLensReviewReport) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLensReviewReport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLensReviewReportInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}/report") + 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_serializeOpHttpBindingsGetLensReviewReportInput(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_serializeOpHttpBindingsGetLensReviewReportInput(v *GetLensReviewReportInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.MilestoneNumber != 0 { + encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetLensVersionDifference struct { +} + +func (*awsRestjson1_serializeOpGetLensVersionDifference) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLensVersionDifference) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLensVersionDifferenceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/lenses/{LensAlias}/versionDifference") + 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_serializeOpHttpBindingsGetLensVersionDifferenceInput(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_serializeOpHttpBindingsGetLensVersionDifferenceInput(v *GetLensVersionDifferenceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BaseLensVersion != nil { + encoder.SetQuery("BaseLensVersion").String(*v.BaseLensVersion) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.TargetLensVersion != nil { + encoder.SetQuery("TargetLensVersion").String(*v.TargetLensVersion) + } + + return nil +} + +type awsRestjson1_serializeOpGetMilestone struct { +} + +func (*awsRestjson1_serializeOpGetMilestone) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetLensReviewReport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetMilestone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1323,13 +1944,13 @@ func (m *awsRestjson1_serializeOpGetLensReviewReport) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetLensReviewReportInput) + input, ok := in.Parameters.(*GetMilestoneInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}/report") + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/milestones/{MilestoneNumber}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1338,7 +1959,7 @@ func (m *awsRestjson1_serializeOpGetLensReviewReport) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetLensReviewReportInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetMilestoneInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1349,24 +1970,17 @@ func (m *awsRestjson1_serializeOpGetLensReviewReport) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetLensReviewReportInput(v *GetLensReviewReportInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetMilestoneInput(v *GetMilestoneInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.LensAlias == nil || len(*v.LensAlias) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} - } - if v.LensAlias != nil { - if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + { + if err := encoder.SetURI("MilestoneNumber").Integer(v.MilestoneNumber); err != nil { return err } } - if v.MilestoneNumber != 0 { - encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) - } - if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} } @@ -1379,14 +1993,14 @@ func awsRestjson1_serializeOpHttpBindingsGetLensReviewReportInput(v *GetLensRevi return nil } -type awsRestjson1_serializeOpGetLensVersionDifference struct { +type awsRestjson1_serializeOpGetProfile struct { } -func (*awsRestjson1_serializeOpGetLensVersionDifference) ID() string { +func (*awsRestjson1_serializeOpGetProfile) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetLensVersionDifference) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1394,13 +2008,13 @@ func (m *awsRestjson1_serializeOpGetLensVersionDifference) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetLensVersionDifferenceInput) + input, ok := in.Parameters.(*GetProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/lenses/{LensAlias}/versionDifference") + opPath, opQuery := httpbinding.SplitURI("/profiles/{ProfileArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1409,7 +2023,7 @@ func (m *awsRestjson1_serializeOpGetLensVersionDifference) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetLensVersionDifferenceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetProfileInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1420,39 +2034,35 @@ func (m *awsRestjson1_serializeOpGetLensVersionDifference) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetLensVersionDifferenceInput(v *GetLensVersionDifferenceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetProfileInput(v *GetProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.BaseLensVersion != nil { - encoder.SetQuery("BaseLensVersion").String(*v.BaseLensVersion) - } - - if v.LensAlias == nil || len(*v.LensAlias) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + if v.ProfileArn == nil || len(*v.ProfileArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProfileArn must not be empty")} } - if v.LensAlias != nil { - if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + if v.ProfileArn != nil { + if err := encoder.SetURI("ProfileArn").String(*v.ProfileArn); err != nil { return err } } - if v.TargetLensVersion != nil { - encoder.SetQuery("TargetLensVersion").String(*v.TargetLensVersion) + if v.ProfileVersion != nil { + encoder.SetQuery("ProfileVersion").String(*v.ProfileVersion) } return nil } -type awsRestjson1_serializeOpGetMilestone struct { +type awsRestjson1_serializeOpGetProfileTemplate struct { } -func (*awsRestjson1_serializeOpGetMilestone) ID() string { +func (*awsRestjson1_serializeOpGetProfileTemplate) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetMilestone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetProfileTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1460,13 +2070,13 @@ func (m *awsRestjson1_serializeOpGetMilestone) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetMilestoneInput) + input, ok := in.Parameters.(*GetProfileTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/milestones/{MilestoneNumber}") + opPath, opQuery := httpbinding.SplitURI("/profileTemplate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1475,10 +2085,6 @@ func (m *awsRestjson1_serializeOpGetMilestone) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetMilestoneInput(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} } @@ -1486,26 +2092,11 @@ func (m *awsRestjson1_serializeOpGetMilestone) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetMilestoneInput(v *GetMilestoneInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetProfileTemplateInput(v *GetProfileTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - { - if err := encoder.SetURI("MilestoneNumber").Integer(v.MilestoneNumber); err != nil { - return err - } - } - - if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} - } - if v.WorkloadId != nil { - if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { - return err - } - } - return nil } @@ -1723,6 +2314,10 @@ func awsRestjson1_serializeOpHttpBindingsListAnswersInput(v *ListAnswersInput, e encoder.SetQuery("PillarId").String(*v.PillarId) } + if len(v.QuestionPriority) > 0 { + encoder.SetQuery("QuestionPriority").String(string(v.QuestionPriority)) + } + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} } @@ -2087,6 +2682,10 @@ func awsRestjson1_serializeOpHttpBindingsListLensReviewImprovementsInput(v *List encoder.SetQuery("PillarId").String(*v.PillarId) } + if len(v.QuestionPriority) > 0 { + encoder.SetQuery("QuestionPriority").String(string(v.QuestionPriority)) + } + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} } @@ -2321,22 +2920,226 @@ func awsRestjson1_serializeOpDocumentListMilestonesInput(v *ListMilestonesInput, ok.Integer(v.MaxResults) } - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListNotifications struct { +} + +func (*awsRestjson1_serializeOpListNotifications) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListNotifications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListNotificationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notifications") + 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_serializeOpDocumentListNotificationsInput(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_serializeOpHttpBindingsListNotificationsInput(v *ListNotificationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListNotificationsInput(v *ListNotificationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != 0 { + ok := object.Key("MaxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.WorkloadId != nil { + ok := object.Key("WorkloadId") + ok.String(*v.WorkloadId) + } + + return nil +} + +type awsRestjson1_serializeOpListProfileNotifications struct { +} + +func (*awsRestjson1_serializeOpListProfileNotifications) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProfileNotifications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListProfileNotificationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/profileNotifications") + 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_serializeOpHttpBindingsListProfileNotificationsInput(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_serializeOpHttpBindingsListProfileNotificationsInput(v *ListProfileNotificationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.WorkloadId != nil { + encoder.SetQuery("WorkloadId").String(*v.WorkloadId) + } + + return nil +} + +type awsRestjson1_serializeOpListProfiles struct { +} + +func (*awsRestjson1_serializeOpListProfiles) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListProfilesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/profileSummaries") + 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_serializeOpHttpBindingsListProfilesInput(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_serializeOpHttpBindingsListProfilesInput(v *ListProfilesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.ProfileNamePrefix != nil { + encoder.SetQuery("ProfileNamePrefix").String(*v.ProfileNamePrefix) + } + + if len(v.ProfileOwnerType) > 0 { + encoder.SetQuery("ProfileOwnerType").String(string(v.ProfileOwnerType)) } return nil } -type awsRestjson1_serializeOpListNotifications struct { +type awsRestjson1_serializeOpListProfileShares struct { } -func (*awsRestjson1_serializeOpListNotifications) ID() string { +func (*awsRestjson1_serializeOpListProfileShares) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListNotifications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListProfileShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2344,29 +3147,22 @@ func (m *awsRestjson1_serializeOpListNotifications) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListNotificationsInput) + input, ok := in.Parameters.(*ListProfileSharesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/notifications") + opPath, opQuery := httpbinding.SplitURI("/profiles/{ProfileArn}/shares") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + 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} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListNotificationsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListProfileSharesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2377,31 +3173,34 @@ func (m *awsRestjson1_serializeOpListNotifications) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListNotificationsInput(v *ListNotificationsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListProfileSharesInput(v *ListProfileSharesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} - -func awsRestjson1_serializeOpDocumentListNotificationsInput(v *ListNotificationsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - if v.MaxResults != 0 { - ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + encoder.SetQuery("MaxResults").Integer(v.MaxResults) } if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) + encoder.SetQuery("NextToken").String(*v.NextToken) } - if v.WorkloadId != nil { - ok := object.Key("WorkloadId") - ok.String(*v.WorkloadId) + if v.ProfileArn == nil || len(*v.ProfileArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProfileArn must not be empty")} + } + if v.ProfileArn != nil { + if err := encoder.SetURI("ProfileArn").String(*v.ProfileArn); err != nil { + return err + } + } + + if v.SharedWithPrefix != nil { + encoder.SetQuery("SharedWithPrefix").String(*v.SharedWithPrefix) + } + + if len(v.Status) > 0 { + encoder.SetQuery("Status").String(string(v.Status)) } return nil @@ -2465,6 +3264,10 @@ func awsRestjson1_serializeOpHttpBindingsListShareInvitationsInput(v *ListShareI encoder.SetQuery("NextToken").String(*v.NextToken) } + if v.ProfileNamePrefix != nil { + encoder.SetQuery("ProfileNamePrefix").String(*v.ProfileNamePrefix) + } + if len(v.ShareResourceType) > 0 { encoder.SetQuery("ShareResourceType").String(string(v.ShareResourceType)) } @@ -3126,6 +3929,94 @@ func awsRestjson1_serializeOpDocumentUpdateLensReviewInput(v *UpdateLensReviewIn return nil } +type awsRestjson1_serializeOpUpdateProfile struct { +} + +func (*awsRestjson1_serializeOpUpdateProfile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateProfileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/profiles/{ProfileArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateProfileInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateProfileInput(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_serializeOpHttpBindingsUpdateProfileInput(v *UpdateProfileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProfileArn == nil || len(*v.ProfileArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProfileArn must not be empty")} + } + if v.ProfileArn != nil { + if err := encoder.SetURI("ProfileArn").String(*v.ProfileArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateProfileInput(v *UpdateProfileInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ProfileDescription != nil { + ok := object.Key("ProfileDescription") + ok.String(*v.ProfileDescription) + } + + if v.ProfileQuestions != nil { + ok := object.Key("ProfileQuestions") + if err := awsRestjson1_serializeDocumentProfileQuestionUpdates(v.ProfileQuestions, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateShareInvitation struct { } @@ -3560,6 +4451,101 @@ func awsRestjson1_serializeOpDocumentUpgradeLensReviewInput(v *UpgradeLensReview return nil } +type awsRestjson1_serializeOpUpgradeProfileVersion struct { +} + +func (*awsRestjson1_serializeOpUpgradeProfileVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpgradeProfileVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpgradeProfileVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/profiles/{ProfileArn}/upgrade") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpgradeProfileVersionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpgradeProfileVersionInput(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_serializeOpHttpBindingsUpgradeProfileVersionInput(v *UpgradeProfileVersionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProfileArn == nil || len(*v.ProfileArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProfileArn must not be empty")} + } + if v.ProfileArn != nil { + if err := encoder.SetURI("ProfileArn").String(*v.ProfileArn); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpgradeProfileVersionInput(v *UpgradeProfileVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.MilestoneName != nil { + ok := object.Key("MilestoneName") + ok.String(*v.MilestoneName) + } + + return nil +} + func awsRestjson1_serializeDocumentChoiceUpdate(v *types.ChoiceUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3618,6 +4604,49 @@ func awsRestjson1_serializeDocumentPillarNotes(v map[string]string, value smithy return nil } +func awsRestjson1_serializeDocumentProfileArns(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_serializeDocumentProfileQuestionUpdate(v *types.ProfileQuestionUpdate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.QuestionId != nil { + ok := object.Key("QuestionId") + ok.String(*v.QuestionId) + } + + if v.SelectedChoiceIds != nil { + ok := object.Key("SelectedChoiceIds") + if err := awsRestjson1_serializeDocumentSelectedProfileChoiceIds(v.SelectedChoiceIds, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentProfileQuestionUpdates(v []types.ProfileQuestionUpdate, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentProfileQuestionUpdate(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentSelectedChoices(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3629,6 +4658,17 @@ func awsRestjson1_serializeDocumentSelectedChoices(v []string, value smithyjson. return nil } +func awsRestjson1_serializeDocumentSelectedProfileChoiceIds(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() @@ -3725,6 +4765,17 @@ func awsRestjson1_serializeDocumentWorkloadPillarPriorities(v []string, value sm return nil } +func awsRestjson1_serializeDocumentWorkloadProfileArns(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_serializeDocumentWorkloadResourceDefinition(v []types.DefinitionType, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/wellarchitected/types/enums.go b/service/wellarchitected/types/enums.go index 9f27815fcb3..b3ce2c518d0 100644 --- a/service/wellarchitected/types/enums.go +++ b/service/wellarchitected/types/enums.go @@ -360,6 +360,78 @@ func (PermissionType) Values() []PermissionType { } } +type ProfileNotificationType string + +// Enum values for ProfileNotificationType +const ( + ProfileNotificationTypeProfileAnswersUpdated ProfileNotificationType = "PROFILE_ANSWERS_UPDATED" + ProfileNotificationTypeProfileDeleted ProfileNotificationType = "PROFILE_DELETED" +) + +// Values returns all known values for ProfileNotificationType. 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 (ProfileNotificationType) Values() []ProfileNotificationType { + return []ProfileNotificationType{ + "PROFILE_ANSWERS_UPDATED", + "PROFILE_DELETED", + } +} + +type ProfileOwnerType string + +// Enum values for ProfileOwnerType +const ( + ProfileOwnerTypeSelf ProfileOwnerType = "SELF" + ProfileOwnerTypeShared ProfileOwnerType = "SHARED" +) + +// Values returns all known values for ProfileOwnerType. 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 (ProfileOwnerType) Values() []ProfileOwnerType { + return []ProfileOwnerType{ + "SELF", + "SHARED", + } +} + +type QuestionPriority string + +// Enum values for QuestionPriority +const ( + QuestionPriorityPrioritized QuestionPriority = "PRIORITIZED" + QuestionPriorityNone QuestionPriority = "NONE" +) + +// Values returns all known values for QuestionPriority. 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 (QuestionPriority) Values() []QuestionPriority { + return []QuestionPriority{ + "PRIORITIZED", + "NONE", + } +} + +type QuestionType string + +// Enum values for QuestionType +const ( + QuestionTypePrioritized QuestionType = "PRIORITIZED" + QuestionTypeNonPrioritized QuestionType = "NON_PRIORITIZED" +) + +// Values returns all known values for QuestionType. 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 (QuestionType) Values() []QuestionType { + return []QuestionType{ + "PRIORITIZED", + "NON_PRIORITIZED", + } +} + type ReportFormat string // Enum values for ReportFormat @@ -426,6 +498,7 @@ type ShareResourceType string const ( ShareResourceTypeWorkload ShareResourceType = "WORKLOAD" ShareResourceTypeLens ShareResourceType = "LENS" + ShareResourceTypeProfile ShareResourceType = "PROFILE" ) // Values returns all known values for ShareResourceType. Note that this can be @@ -435,6 +508,7 @@ func (ShareResourceType) Values() []ShareResourceType { return []ShareResourceType{ "WORKLOAD", "LENS", + "PROFILE", } } diff --git a/service/wellarchitected/types/types.go b/service/wellarchitected/types/types.go index 2580a2b33fd..6616f536671 100644 --- a/service/wellarchitected/types/types.go +++ b/service/wellarchitected/types/types.go @@ -99,6 +99,9 @@ type AnswerSummary struct { // The title of the question. QuestionTitle *string + // The type of the question. + QuestionType QuestionType + // The reason why a choice is non-applicable to a question in your workload. Reason AnswerReason @@ -455,6 +458,12 @@ type LensReview struct { // List of pillar review summaries of lens review in a workload. PillarReviewSummaries []PillarReviewSummary + // A map from risk names to the count of how many questions have that rating. + PrioritizedRiskCounts map[string]int32 + + // The profiles associated with the workload. + Profiles []WorkloadProfile + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 @@ -511,6 +520,12 @@ type LensReviewSummary struct { // The version of the lens. LensVersion *string + // A map from risk names to the count of how many questions have that rating. + PrioritizedRiskCounts map[string]int32 + + // The profiles associated with the workload. + Profiles []WorkloadProfile + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 @@ -523,14 +538,14 @@ type LensReviewSummary struct { // A lens share summary return object. type LensShareSummary struct { - // The ID associated with the workload share. + // The ID associated with the share. ShareId *string // The Amazon Web Services account ID, IAM role, organization ID, or - // organizational unit (OU) ID with which the workload is shared. + // organizational unit (OU) ID with which the workload, lens, or profile is shared. SharedWith *string - // The status of a workload share. + // The status of the share request. Status ShareStatus // Optional message to compliment the Status field. @@ -712,12 +727,238 @@ type PillarReviewSummary struct { // The name of the pillar. PillarName *string + // A map from risk names to the count of how many questions have that rating. + PrioritizedRiskCounts map[string]int32 + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 noSmithyDocumentSerde } +// A profile. +type Profile struct { + + // The date and time recorded. + CreatedAt *time.Time + + // An Amazon Web Services account ID. + Owner *string + + // The profile ARN. + ProfileArn *string + + // The profile description. + ProfileDescription *string + + // The profile name. + ProfileName *string + + // Profile questions. + ProfileQuestions []ProfileQuestion + + // The profile version. + ProfileVersion *string + + // The ID assigned to the share invitation. + ShareInvitationId *string + + // The tags assigned to the profile. + Tags map[string]string + + // The date and time recorded. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// The profile choice. +type ProfileChoice struct { + + // The description of a choice. + ChoiceDescription *string + + // The ID of a choice. + ChoiceId *string + + // The title of a choice. + ChoiceTitle *string + + noSmithyDocumentSerde +} + +// The profile notification summary. +type ProfileNotificationSummary struct { + + // The current profile version. + CurrentProfileVersion *string + + // The latest profile version. + LatestProfileVersion *string + + // The profile ARN. + ProfileArn *string + + // The profile name. + ProfileName *string + + // Type of notification. + Type ProfileNotificationType + + // The ID assigned to the workload. This ID is unique within an Amazon Web + // Services Region. + WorkloadId *string + + // The name of the workload. The name must be unique within an account within an + // Amazon Web Services Region. Spaces and capitalization are ignored when checking + // for uniqueness. + WorkloadName *string + + noSmithyDocumentSerde +} + +// A profile question. +type ProfileQuestion struct { + + // The maximum number of selected choices. + MaxSelectedChoices int32 + + // The minimum number of selected choices. + MinSelectedChoices int32 + + // The question choices. + QuestionChoices []ProfileChoice + + // The description of the question. + QuestionDescription *string + + // The ID of the question. + QuestionId *string + + // The title of the question. + QuestionTitle *string + + // The selected choices. + SelectedChoiceIds []string + + noSmithyDocumentSerde +} + +// An update to a profile question. +type ProfileQuestionUpdate struct { + + // The ID of the question. + QuestionId *string + + // The selected choices. + SelectedChoiceIds []string + + noSmithyDocumentSerde +} + +// Summary of a profile share. +type ProfileShareSummary struct { + + // The ID associated with the share. + ShareId *string + + // The Amazon Web Services account ID, IAM role, organization ID, or + // organizational unit (OU) ID with which the workload, lens, or profile is shared. + SharedWith *string + + // The status of the share request. + Status ShareStatus + + // Profile share invitation status message. + StatusMessage *string + + noSmithyDocumentSerde +} + +// Summary of a profile. +type ProfileSummary struct { + + // The date and time recorded. + CreatedAt *time.Time + + // An Amazon Web Services account ID. + Owner *string + + // The profile ARN. + ProfileArn *string + + // The profile description. + ProfileDescription *string + + // The profile name. + ProfileName *string + + // The profile version. + ProfileVersion *string + + // The date and time recorded. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// The profile template. +type ProfileTemplate struct { + + // The date and time recorded. + CreatedAt *time.Time + + // The name of the profile template. + TemplateName *string + + // Profile template questions. + TemplateQuestions []ProfileTemplateQuestion + + // The date and time recorded. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// A profile template choice. +type ProfileTemplateChoice struct { + + // The description of a choice. + ChoiceDescription *string + + // The ID of a choice. + ChoiceId *string + + // The title of a choice. + ChoiceTitle *string + + noSmithyDocumentSerde +} + +// A profile template question. +type ProfileTemplateQuestion struct { + + // The maximum number of choices selected. + MaxSelectedChoices int32 + + // The minimum number of choices selected. + MinSelectedChoices int32 + + // The question choices. + QuestionChoices []ProfileTemplateChoice + + // The description of the question. + QuestionDescription *string + + // The ID of the question. + QuestionId *string + + // The title of the question. + QuestionTitle *string + + noSmithyDocumentSerde +} + // A question difference return object. type QuestionDifference struct { @@ -764,6 +1005,9 @@ type ShareInvitation struct { // The ARN for the lens. LensArn *string + // The profile ARN. + ProfileArn *string + // The ID assigned to the share invitation. ShareInvitationId *string @@ -786,9 +1030,15 @@ type ShareInvitationSummary struct { // The full name of the lens. LensName *string - // Permission granted on a workload share. + // Permission granted on a share request. PermissionType PermissionType + // The profile ARN. + ProfileArn *string + + // The profile name. + ProfileName *string + // The ID assigned to the share invitation. ShareInvitationId *string @@ -799,7 +1049,7 @@ type ShareInvitationSummary struct { SharedBy *string // The Amazon Web Services account ID, IAM role, organization ID, or - // organizational unit (OU) ID with which the workload is shared. + // organizational unit (OU) ID with which the workload, lens, or profile is shared. SharedWith *string // The ID assigned to the workload. This ID is unique within an Amazon Web @@ -924,6 +1174,12 @@ type Workload struct { // plan. Each pillar is represented by its PillarReviewSummary$PillarId . PillarPriorities []string + // A map from risk names to the count of how many questions have that rating. + PrioritizedRiskCounts map[string]int32 + + // Profile associated with a workload. + Profiles []WorkloadProfile + // The review owner of the workload. The name, email address, or identifier for // the primary group or individual that owns the workload review process. ReviewOwner *string @@ -971,23 +1227,35 @@ type WorkloadDiscoveryConfig struct { noSmithyDocumentSerde } +// The profile associated with a workload. +type WorkloadProfile struct { + + // The profile ARN. + ProfileArn *string + + // The profile version. + ProfileVersion *string + + noSmithyDocumentSerde +} + // A workload share return object. type WorkloadShare struct { - // Permission granted on a workload share. + // Permission granted on a share request. PermissionType PermissionType - // The ID associated with the workload share. + // The ID associated with the share. ShareId *string // An Amazon Web Services account ID. SharedBy *string // The Amazon Web Services account ID, IAM role, organization ID, or - // organizational unit (OU) ID with which the workload is shared. + // organizational unit (OU) ID with which the workload, lens, or profile is shared. SharedWith *string - // The status of a workload share. + // The status of the share request. Status ShareStatus // The ID assigned to the workload. This ID is unique within an Amazon Web @@ -1005,17 +1273,17 @@ type WorkloadShare struct { // A workload share summary return object. type WorkloadShareSummary struct { - // Permission granted on a workload share. + // Permission granted on a share request. PermissionType PermissionType - // The ID associated with the workload share. + // The ID associated with the share. ShareId *string // The Amazon Web Services account ID, IAM role, organization ID, or - // organizational unit (OU) ID with which the workload is shared. + // organizational unit (OU) ID with which the workload, lens, or profile is shared. SharedWith *string - // The status of a workload share. + // The status of the share request. Status ShareStatus // Optional message to compliment the Status field. @@ -1037,6 +1305,12 @@ type WorkloadSummary struct { // An Amazon Web Services account ID. Owner *string + // A map from risk names to the count of how many questions have that rating. + PrioritizedRiskCounts map[string]int32 + + // Profile associated with a workload. + Profiles []WorkloadProfile + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 diff --git a/service/wellarchitected/validators.go b/service/wellarchitected/validators.go index 2eeabe0c393..f7a4609dd68 100644 --- a/service/wellarchitected/validators.go +++ b/service/wellarchitected/validators.go @@ -30,6 +30,26 @@ func (m *validateOpAssociateLenses) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpAssociateProfiles struct { +} + +func (*validateOpAssociateProfiles) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateProfiles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateProfilesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateProfilesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateLensShare struct { } @@ -90,6 +110,46 @@ func (m *validateOpCreateMilestone) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpCreateProfile struct { +} + +func (*validateOpCreateProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateProfileShare struct { +} + +func (*validateOpCreateProfileShare) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateProfileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateProfileShareInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateProfileShareInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateWorkload struct { } @@ -170,6 +230,46 @@ func (m *validateOpDeleteLensShare) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpDeleteProfile struct { +} + +func (*validateOpDeleteProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteProfileShare struct { +} + +func (*validateOpDeleteProfileShare) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteProfileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteProfileShareInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteProfileShareInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteWorkload struct { } @@ -230,6 +330,26 @@ func (m *validateOpDisassociateLenses) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDisassociateProfiles struct { +} + +func (*validateOpDisassociateProfiles) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateProfiles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateProfilesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateProfilesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpExportLens struct { } @@ -390,6 +510,26 @@ func (m *validateOpGetMilestone) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpGetProfile struct { +} + +func (*validateOpGetProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetWorkload struct { } @@ -570,6 +710,26 @@ func (m *validateOpListMilestones) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpListProfileShares struct { +} + +func (*validateOpListProfileShares) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListProfileShares) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListProfileSharesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListProfileSharesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -690,6 +850,26 @@ func (m *validateOpUpdateLensReview) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpUpdateProfile struct { +} + +func (*validateOpUpdateProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateShareInvitation struct { } @@ -770,10 +950,34 @@ func (m *validateOpUpgradeLensReview) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpUpgradeProfileVersion struct { +} + +func (*validateOpUpgradeProfileVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpgradeProfileVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpgradeProfileVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpgradeProfileVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpAssociateLensesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateLenses{}, middleware.After) } +func addOpAssociateProfilesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateProfiles{}, middleware.After) +} + func addOpCreateLensShareValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateLensShare{}, middleware.After) } @@ -786,6 +990,14 @@ func addOpCreateMilestoneValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateMilestone{}, middleware.After) } +func addOpCreateProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateProfile{}, middleware.After) +} + +func addOpCreateProfileShareValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateProfileShare{}, middleware.After) +} + func addOpCreateWorkloadValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorkload{}, middleware.After) } @@ -802,6 +1014,14 @@ func addOpDeleteLensShareValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteLensShare{}, middleware.After) } +func addOpDeleteProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProfile{}, middleware.After) +} + +func addOpDeleteProfileShareValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProfileShare{}, middleware.After) +} + func addOpDeleteWorkloadValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteWorkload{}, middleware.After) } @@ -814,6 +1034,10 @@ func addOpDisassociateLensesValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDisassociateLenses{}, middleware.After) } +func addOpDisassociateProfilesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateProfiles{}, middleware.After) +} + func addOpExportLensValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpExportLens{}, middleware.After) } @@ -846,6 +1070,10 @@ func addOpGetMilestoneValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMilestone{}, middleware.After) } +func addOpGetProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetProfile{}, middleware.After) +} + func addOpGetWorkloadValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetWorkload{}, middleware.After) } @@ -882,6 +1110,10 @@ func addOpListMilestonesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListMilestones{}, middleware.After) } +func addOpListProfileSharesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListProfileShares{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -906,6 +1138,10 @@ func addOpUpdateLensReviewValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateLensReview{}, middleware.After) } +func addOpUpdateProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateProfile{}, middleware.After) +} + func addOpUpdateShareInvitationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateShareInvitation{}, middleware.After) } @@ -922,6 +1158,10 @@ func addOpUpgradeLensReviewValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpgradeLensReview{}, middleware.After) } +func addOpUpgradeProfileVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpgradeProfileVersion{}, middleware.After) +} + func validateChoiceUpdate(v *types.ChoiceUpdate) error { if v == nil { return nil @@ -973,6 +1213,24 @@ func validateOpAssociateLensesInput(v *AssociateLensesInput) error { } } +func validateOpAssociateProfilesInput(v *AssociateProfilesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateProfilesInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.ProfileArns == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArns")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateLensShareInput(v *CreateLensShareInput) error { if v == nil { return nil @@ -1036,6 +1294,51 @@ func validateOpCreateMilestoneInput(v *CreateMilestoneInput) error { } } +func validateOpCreateProfileInput(v *CreateProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateProfileInput"} + if v.ProfileName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileName")) + } + if v.ProfileDescription == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileDescription")) + } + if v.ProfileQuestions == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileQuestions")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateProfileShareInput(v *CreateProfileShareInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateProfileShareInput"} + if v.ProfileArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArn")) + } + if v.SharedWith == nil { + invalidParams.Add(smithy.NewErrParamRequired("SharedWith")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateWorkloadInput(v *CreateWorkloadInput) error { if v == nil { return nil @@ -1129,6 +1432,45 @@ func validateOpDeleteLensShareInput(v *DeleteLensShareInput) error { } } +func validateOpDeleteProfileInput(v *DeleteProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteProfileInput"} + if v.ProfileArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArn")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteProfileShareInput(v *DeleteProfileShareInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteProfileShareInput"} + if v.ShareId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ShareId")) + } + if v.ProfileArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArn")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteWorkloadInput(v *DeleteWorkloadInput) error { if v == nil { return nil @@ -1186,6 +1528,24 @@ func validateOpDisassociateLensesInput(v *DisassociateLensesInput) error { } } +func validateOpDisassociateProfilesInput(v *DisassociateProfilesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateProfilesInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.ProfileArns == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArns")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpExportLensInput(v *ExportLensInput) error { if v == nil { return nil @@ -1318,6 +1678,21 @@ func validateOpGetMilestoneInput(v *GetMilestoneInput) error { } } +func validateOpGetProfileInput(v *GetProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetProfileInput"} + if v.ProfileArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetWorkloadInput(v *GetWorkloadInput) error { if v == nil { return nil @@ -1486,6 +1861,21 @@ func validateOpListMilestonesInput(v *ListMilestonesInput) error { } } +func validateOpListProfileSharesInput(v *ListProfileSharesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListProfileSharesInput"} + if v.ProfileArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -1596,6 +1986,21 @@ func validateOpUpdateLensReviewInput(v *UpdateLensReviewInput) error { } } +func validateOpUpdateProfileInput(v *UpdateProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateProfileInput"} + if v.ProfileArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateShareInvitationInput(v *UpdateShareInvitationInput) error { if v == nil { return nil @@ -1670,3 +2075,21 @@ func validateOpUpgradeLensReviewInput(v *UpgradeLensReviewInput) error { return nil } } + +func validateOpUpgradeProfileVersionInput(v *UpgradeProfileVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpgradeProfileVersionInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.ProfileArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +}