From e3ba04051da90d3fa6d7214cd250bbf91a2d953a Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Tue, 3 Oct 2023 18:15:03 +0000 Subject: [PATCH] Regenerated Clients --- .../5a9f4c1e716545e4b0e8b33695692ff0.json | 8 + .../7f24a283d7894a009d0c7a0a77f50777.json | 8 + .../82f43f7fc65b4f3aae88f7b6bcddc2c7.json | 8 + .../a24c7a6e3fde40a9b76078a66353fa61.json | 8 + .../f5c7979ff4be4741b85b8c77c60da564.json | 8 + .../f912fe527a8147b7975b7c1369545966.json | 8 + .../internal/endpoints/endpoints.go | 5 + service/connect/api_op_CreateContactFlow.go | 4 +- .../connect/api_op_CreateSecurityProfile.go | 1 - .../connect/api_op_DeleteSecurityProfile.go | 1 - .../connect/api_op_DescribeSecurityProfile.go | 1 - service/connect/api_op_GetMetricDataV2.go | 100 +- .../api_op_ListSecurityProfileApplications.go | 3 +- .../api_op_ListSecurityProfilePermissions.go | 1 - .../api_op_UpdateContactFlowContent.go | 6 +- .../api_op_UpdateContactFlowModuleContent.go | 4 +- .../connect/api_op_UpdateSecurityProfile.go | 1 - service/connect/deserializers.go | 86 + service/connect/serializers.go | 29 + service/connect/types/enums.go | 26 + service/connect/types/types.go | 67 +- service/location/api_op_CreateTracker.go | 13 + .../api_op_DescribeGeofenceCollection.go | 3 + service/location/api_op_DescribeTracker.go | 13 + service/location/api_op_GetMapGlyphs.go | 2 +- .../location/api_op_ListDevicePositions.go | 7 +- service/location/api_op_UpdateTracker.go | 5 + service/location/deserializers.go | 22 + service/location/serializers.go | 31 + service/location/types/types.go | 10 + service/mediaconvert/deserializers.go | 288 +- service/mediaconvert/serializers.go | 130 +- service/mediaconvert/types/enums.go | 36 + service/mediaconvert/types/types.go | 112 +- service/oam/api_op_PutSinkPolicy.go | 2 + service/oam/doc.go | 21 +- service/oam/types/enums.go | 8 +- service/sagemaker/types/enums.go | 2 + service/sagemaker/types/types.go | 8 +- service/sagemaker/validators.go | 3 - .../wellarchitected/api_op_CreateLensShare.go | 4 +- .../api_op_CreateProfileShare.go | 4 +- .../api_op_CreateReviewTemplate.go | 331 + .../api_op_CreateTemplateShare.go | 325 + .../wellarchitected/api_op_CreateWorkload.go | 17 +- .../api_op_CreateWorkloadShare.go | 4 +- .../api_op_DeleteReviewTemplate.go | 307 + .../api_op_DeleteTemplateShare.go | 312 + .../api_op_GetReviewTemplate.go | 261 + .../api_op_GetReviewTemplateAnswer.go | 289 + .../api_op_GetReviewTemplateLensReview.go | 275 + .../wellarchitected/api_op_ListLensShares.go | 4 +- .../api_op_ListNotifications.go | 4 + .../api_op_ListProfileShares.go | 4 +- .../wellarchitected/api_op_ListProfiles.go | 3 +- .../api_op_ListReviewTemplateAnswers.go | 385 + .../api_op_ListReviewTemplates.go | 349 + .../api_op_ListShareInvitations.go | 11 +- .../api_op_ListTagsForResource.go | 2 +- .../api_op_ListTemplateShares.go | 367 + .../api_op_ListWorkloadShares.go | 4 +- service/wellarchitected/api_op_TagResource.go | 2 +- .../wellarchitected/api_op_UntagResource.go | 4 +- .../wellarchitected/api_op_UpdateAnswer.go | 3 +- .../api_op_UpdateLensReview.go | 7 +- .../api_op_UpdateReviewTemplate.go | 278 + .../api_op_UpdateReviewTemplateAnswer.go | 306 + .../api_op_UpdateReviewTemplateLensReview.go | 284 + .../wellarchitected/api_op_UpdateWorkload.go | 3 +- .../api_op_UpgradeReviewTemplateLensReview.go | 277 + service/wellarchitected/deserializers.go | 9183 +++++++++++------ service/wellarchitected/generated.json | 14 + service/wellarchitected/serializers.go | 1683 ++- service/wellarchitected/types/enums.go | 56 + service/wellarchitected/types/types.go | 303 +- service/wellarchitected/validators.go | 560 + 76 files changed, 13964 insertions(+), 3360 deletions(-) create mode 100644 .changelog/5a9f4c1e716545e4b0e8b33695692ff0.json create mode 100644 .changelog/7f24a283d7894a009d0c7a0a77f50777.json create mode 100644 .changelog/82f43f7fc65b4f3aae88f7b6bcddc2c7.json create mode 100644 .changelog/a24c7a6e3fde40a9b76078a66353fa61.json create mode 100644 .changelog/f5c7979ff4be4741b85b8c77c60da564.json create mode 100644 .changelog/f912fe527a8147b7975b7c1369545966.json create mode 100644 service/wellarchitected/api_op_CreateReviewTemplate.go create mode 100644 service/wellarchitected/api_op_CreateTemplateShare.go create mode 100644 service/wellarchitected/api_op_DeleteReviewTemplate.go create mode 100644 service/wellarchitected/api_op_DeleteTemplateShare.go create mode 100644 service/wellarchitected/api_op_GetReviewTemplate.go create mode 100644 service/wellarchitected/api_op_GetReviewTemplateAnswer.go create mode 100644 service/wellarchitected/api_op_GetReviewTemplateLensReview.go create mode 100644 service/wellarchitected/api_op_ListReviewTemplateAnswers.go create mode 100644 service/wellarchitected/api_op_ListReviewTemplates.go create mode 100644 service/wellarchitected/api_op_ListTemplateShares.go create mode 100644 service/wellarchitected/api_op_UpdateReviewTemplate.go create mode 100644 service/wellarchitected/api_op_UpdateReviewTemplateAnswer.go create mode 100644 service/wellarchitected/api_op_UpdateReviewTemplateLensReview.go create mode 100644 service/wellarchitected/api_op_UpgradeReviewTemplateLensReview.go diff --git a/.changelog/5a9f4c1e716545e4b0e8b33695692ff0.json b/.changelog/5a9f4c1e716545e4b0e8b33695692ff0.json new file mode 100644 index 00000000000..5ea55788fdc --- /dev/null +++ b/.changelog/5a9f4c1e716545e4b0e8b33695692ff0.json @@ -0,0 +1,8 @@ +{ + "id": "5a9f4c1e-7165-45e4-b0e8-b33695692ff0", + "type": "feature", + "description": "AWS Well-Architected now supports Review Templates that allows you to create templates with pre-filled answers for Well-Architected and Custom Lens best practices.", + "modules": [ + "service/wellarchitected" + ] +} \ No newline at end of file diff --git a/.changelog/7f24a283d7894a009d0c7a0a77f50777.json b/.changelog/7f24a283d7894a009d0c7a0a77f50777.json new file mode 100644 index 00000000000..ce6e5023af4 --- /dev/null +++ b/.changelog/7f24a283d7894a009d0c7a0a77f50777.json @@ -0,0 +1,8 @@ +{ + "id": "7f24a283-d789-4a00-9d0c-7a0a77f50777", + "type": "feature", + "description": "This release adds support for sharing AWS::ApplicationInsights::Application resources.", + "modules": [ + "service/oam" + ] +} \ No newline at end of file diff --git a/.changelog/82f43f7fc65b4f3aae88f7b6bcddc2c7.json b/.changelog/82f43f7fc65b4f3aae88f7b6bcddc2c7.json new file mode 100644 index 00000000000..fcc1d2696d0 --- /dev/null +++ b/.changelog/82f43f7fc65b4f3aae88f7b6bcddc2c7.json @@ -0,0 +1,8 @@ +{ + "id": "82f43f7f-c65b-4f3a-ae88-f7b6bcddc2c7", + "type": "feature", + "description": "This release adds the ability to replace video frames without modifying the audio essence.", + "modules": [ + "service/mediaconvert" + ] +} \ No newline at end of file diff --git a/.changelog/a24c7a6e3fde40a9b76078a66353fa61.json b/.changelog/a24c7a6e3fde40a9b76078a66353fa61.json new file mode 100644 index 00000000000..d5dc2078381 --- /dev/null +++ b/.changelog/a24c7a6e3fde40a9b76078a66353fa61.json @@ -0,0 +1,8 @@ +{ + "id": "a24c7a6e-3fde-40a9-b760-78a66353fa61", + "type": "feature", + "description": "Amazon Location Service adds support for bounding polygon queries. Additionally, the GeofenceCount field has been added to the DescribeGeofenceCollection API response.", + "modules": [ + "service/location" + ] +} \ No newline at end of file diff --git a/.changelog/f5c7979ff4be4741b85b8c77c60da564.json b/.changelog/f5c7979ff4be4741b85b8c77c60da564.json new file mode 100644 index 00000000000..0191b4c18e4 --- /dev/null +++ b/.changelog/f5c7979ff4be4741b85b8c77c60da564.json @@ -0,0 +1,8 @@ +{ + "id": "f5c7979f-f4be-4741-b85b-8c77c60da564", + "type": "feature", + "description": "GetMetricDataV2 API: Update to include new metrics CONTACTS_RESOLVED_IN_X , AVG_HOLD_TIME_ALL_CONTACTS , AVG_RESOLUTION_TIME , ABANDONMENT_RATE , AGENT_NON_RESPONSE_WITHOUT_CUSTOMER_ABANDONS with added features: Interval Period, TimeZone, Negate MetricFilters, Extended date time range.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/f912fe527a8147b7975b7c1369545966.json b/.changelog/f912fe527a8147b7975b7c1369545966.json new file mode 100644 index 00000000000..59be4873be1 --- /dev/null +++ b/.changelog/f912fe527a8147b7975b7c1369545966.json @@ -0,0 +1,8 @@ +{ + "id": "f912fe52-7a81-47b7-975b-7c1369545966", + "type": "feature", + "description": "This release allows users to run Selective Execution in SageMaker Pipelines without SourcePipelineExecutionArn if selected steps do not have any dependent steps.", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/service/codestarconnections/internal/endpoints/endpoints.go b/service/codestarconnections/internal/endpoints/endpoints.go index 09abe383552..0ea58ef9b43 100644 --- a/service/codestarconnections/internal/endpoints/endpoints.go +++ b/service/codestarconnections/internal/endpoints/endpoints.go @@ -345,5 +345,10 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + }, }, } diff --git a/service/connect/api_op_CreateContactFlow.go b/service/connect/api_op_CreateContactFlow.go index 876ad1c0529..642d72ead81 100644 --- a/service/connect/api_op_CreateContactFlow.go +++ b/service/connect/api_op_CreateContactFlow.go @@ -36,7 +36,9 @@ func (c *Client) CreateContactFlow(ctx context.Context, params *CreateContactFlo type CreateContactFlowInput struct { - // The content of the flow. + // The JSON string that represents the content of the flow. For an example, see + // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // . Length Constraints: Minimum length of 1. Maximum length of 256000. // // This member is required. Content *string diff --git a/service/connect/api_op_CreateSecurityProfile.go b/service/connect/api_op_CreateSecurityProfile.go index 170b7c6003f..843acfd006f 100644 --- a/service/connect/api_op_CreateSecurityProfile.go +++ b/service/connect/api_op_CreateSecurityProfile.go @@ -16,7 +16,6 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API is in preview release for Amazon Connect and is subject to change. // Creates a security profile. func (c *Client) CreateSecurityProfile(ctx context.Context, params *CreateSecurityProfileInput, optFns ...func(*Options)) (*CreateSecurityProfileOutput, error) { if params == nil { diff --git a/service/connect/api_op_DeleteSecurityProfile.go b/service/connect/api_op_DeleteSecurityProfile.go index 6902ffdf86d..a714d77071f 100644 --- a/service/connect/api_op_DeleteSecurityProfile.go +++ b/service/connect/api_op_DeleteSecurityProfile.go @@ -15,7 +15,6 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API is in preview release for Amazon Connect and is subject to change. // Deletes a security profile. func (c *Client) DeleteSecurityProfile(ctx context.Context, params *DeleteSecurityProfileInput, optFns ...func(*Options)) (*DeleteSecurityProfileOutput, error) { if params == nil { diff --git a/service/connect/api_op_DescribeSecurityProfile.go b/service/connect/api_op_DescribeSecurityProfile.go index e683b2ba429..fde6d9b2dc2 100644 --- a/service/connect/api_op_DescribeSecurityProfile.go +++ b/service/connect/api_op_DescribeSecurityProfile.go @@ -16,7 +16,6 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API is in preview release for Amazon Connect and is subject to change. // Gets basic information about the security profle. func (c *Client) DescribeSecurityProfile(ctx context.Context, params *DescribeSecurityProfileInput, optFns ...func(*Options)) (*DescribeSecurityProfileOutput, error) { if params == nil { diff --git a/service/connect/api_op_GetMetricDataV2.go b/service/connect/api_op_GetMetricDataV2.go index 57c0b818178..b11dcadef52 100644 --- a/service/connect/api_op_GetMetricDataV2.go +++ b/service/connect/api_op_GetMetricDataV2.go @@ -22,9 +22,9 @@ import ( // , the previous version of this API. It has new metrics, offers filtering at a // metric level, and offers the ability to filter and group data by channels, // queues, routing profiles, agents, and agent hierarchy levels. It can retrieve -// historical data for the last 35 days, in 24-hour intervals. For a description of -// the historical metrics that are supported by GetMetricDataV2 and GetMetricData , -// see Historical metrics definitions (https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html) +// historical data for the last 3 months, at varying intervals. For a description +// of the historical metrics that are supported by GetMetricDataV2 and +// GetMetricData , see Historical metrics definitions (https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html) // in the Amazon Connect Administrator's Guide. func (c *Client) GetMetricDataV2(ctx context.Context, params *GetMetricDataV2Input, optFns ...func(*Options)) (*GetMetricDataV2Output, error) { if params == nil { @@ -46,7 +46,6 @@ type GetMetricDataV2Input struct { // The timestamp, in UNIX Epoch time format, at which to end the reporting // interval for the retrieval of historical metrics data. The time must be later // than the start time timestamp. It cannot be later than the current timestamp. - // The time range between the start and end time must be less than 24 hours. // // This member is required. EndTime *time.Time @@ -83,15 +82,19 @@ type GetMetricDataV2Input struct { // The metrics to retrieve. Specify the name, groupings, and filters for each // metric. The following historical metrics are available. For a description of // each metric, see Historical metrics definitions (https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html) - // in the Amazon Connect Administrator's Guide. AGENT_ADHERENT_TIME This metric is - // available only in Amazon Web Services Regions where Forecasting, capacity - // planning, and scheduling (https://docs.aws.amazon.com/connect/latest/adminguide/regions.html#optimization_region) + // in the Amazon Connect Administrator's Guide. ABANDONMENT_RATE Unit: Percent + // Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + // Hierarchy AGENT_ADHERENT_TIME This metric is available only in Amazon Web + // Services Regions where Forecasting, capacity planning, and scheduling (https://docs.aws.amazon.com/connect/latest/adminguide/regions.html#optimization_region) // is available. Unit: Seconds Valid groupings and filters: Queue, Channel, Routing // Profile, Agent, Agent Hierarchy AGENT_NON_RESPONSE Unit: Count Valid groupings // and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy - // AGENT_OCCUPANCY Unit: Percentage Valid groupings and filters: Routing Profile, - // Agent, Agent Hierarchy AGENT_SCHEDULE_ADHERENCE This metric is available only in - // Amazon Web Services Regions where Forecasting, capacity planning, and scheduling (https://docs.aws.amazon.com/connect/latest/adminguide/regions.html#optimization_region) + // AGENT_NON_RESPONSE_WITHOUT_CUSTOMER_ABANDONS Unit: Count Valid groupings and + // filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy Data for this + // metric is available starting from October 1, 2023 0:00:00 GMT. AGENT_OCCUPANCY + // Unit: Percentage Valid groupings and filters: Routing Profile, Agent, Agent + // Hierarchy AGENT_SCHEDULE_ADHERENCE This metric is available only in Amazon Web + // Services Regions where Forecasting, capacity planning, and scheduling (https://docs.aws.amazon.com/connect/latest/adminguide/regions.html#optimization_region) // is available. Unit: Percent Valid groupings and filters: Queue, Channel, Routing // Profile, Agent, Agent Hierarchy AGENT_SCHEDULED_TIME This metric is available // only in Amazon Web Services Regions where Forecasting, capacity planning, and @@ -105,10 +108,7 @@ type GetMetricDataV2Input struct { // metric filter key: INITIATION_METHOD . For now, this metric only supports the // following as INITIATION_METHOD : INBOUND | OUTBOUND | CALLBACK | API Valid // groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy - // AVG_AGENT_CONNECTING_TIME Unit: Seconds Valid metric filter key: - // INITIATION_METHOD . For now, this metric only supports the following as - // INITIATION_METHOD : INBOUND | OUTBOUND | CALLBACK | API Valid groupings and - // filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy + // The Negate key in Metric Level Filters is not applicable for this metric. // AVG_CONTACT_DURATION Unit: Seconds Valid groupings and filters: Queue, Channel, // Routing Profile, Agent, Agent Hierarchy, Feature Feature is a valid filter but // not a valid grouping. AVG_CONVERSATION_DURATION Unit: Seconds Valid groupings @@ -120,23 +120,26 @@ type GetMetricDataV2Input struct { // Agent, Agent Hierarchy, Feature Feature is a valid filter but not a valid // grouping. AVG_HOLD_TIME Unit: Seconds Valid groupings and filters: Queue, // Channel, Routing Profile, Agent, Agent Hierarchy, Feature Feature is a valid - // filter but not a valid grouping. AVG_HOLDS Unit: Count Valid groupings and - // filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy, Feature - // Feature is a valid filter but not a valid grouping. - // AVG_INTERACTION_AND_HOLD_TIME Unit: Seconds Valid groupings and filters: Queue, - // Channel, Routing Profile, Agent, Agent Hierarchy AVG_INTERACTION_TIME Unit: - // Seconds Valid groupings and filters: Queue, Channel, Routing Profile, Feature - // Feature is a valid filter but not a valid grouping. AVG_INTERRUPTIONS_AGENT This - // metric is available only for contacts analyzed by Contact Lens conversational - // analytics. Unit: Count Valid groupings and filters: Queue, Channel, Routing - // Profile, Agent, Agent Hierarchy AVG_INTERRUPTION_TIME_AGENT This metric is - // available only for contacts analyzed by Contact Lens conversational analytics. - // Unit: Seconds Valid groupings and filters: Queue, Channel, Routing Profile, - // Agent, Agent Hierarchy AVG_NON_TALK_TIME This metric is available only for - // contacts analyzed by Contact Lens conversational analytics. Unit: Seconds Valid + // filter but not a valid grouping. AVG_HOLD_TIME_ALL_CONTACTS Unit: Seconds Valid // groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy - // AVG_QUEUE_ANSWER_TIME Unit: Seconds Valid groupings and filters: Queue, Channel, + // AVG_HOLDS Unit: Count Valid groupings and filters: Queue, Channel, Routing + // Profile, Agent, Agent Hierarchy, Feature Feature is a valid filter but not a + // valid grouping. AVG_INTERACTION_AND_HOLD_TIME Unit: Seconds Valid groupings and + // filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy + // AVG_INTERACTION_TIME Unit: Seconds Valid groupings and filters: Queue, Channel, // Routing Profile, Feature Feature is a valid filter but not a valid grouping. + // AVG_INTERRUPTIONS_AGENT This metric is available only for contacts analyzed by + // Contact Lens conversational analytics. Unit: Count Valid groupings and filters: + // Queue, Channel, Routing Profile, Agent, Agent Hierarchy + // AVG_INTERRUPTION_TIME_AGENT This metric is available only for contacts analyzed + // by Contact Lens conversational analytics. Unit: Seconds Valid groupings and + // filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy + // AVG_NON_TALK_TIME This metric is available only for contacts analyzed by Contact + // Lens conversational analytics. Unit: Seconds Valid groupings and filters: Queue, + // Channel, Routing Profile, Agent, Agent Hierarchy AVG_QUEUE_ANSWER_TIME Unit: + // Seconds Valid groupings and filters: Queue, Channel, Routing Profile, Feature + // Feature is a valid filter but not a valid grouping. AVG_RESOLUTION_TIME Unit: + // Seconds Valid groupings and filters: Queue, Channel, Routing Profile // AVG_TALK_TIME This metric is available only for contacts analyzed by Contact // Lens conversational analytics. Unit: Seconds Valid groupings and filters: Queue, // Channel, Routing Profile, Agent, Agent Hierarchy AVG_TALK_TIME_AGENT This metric @@ -155,9 +158,12 @@ type GetMetricDataV2Input struct { // filter but not a valid grouping. CONTACTS_HOLD_ABANDONS Unit: Count Valid // groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy // CONTACTS_QUEUED Unit: Count Valid groupings and filters: Queue, Channel, Routing - // Profile, Agent, Agent Hierarchy CONTACTS_TRANSFERRED_OUT Unit: Count Valid - // groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy, - // Feature Feature is a valid filter but not a valid grouping. + // Profile, Agent, Agent Hierarchy CONTACTS_RESOLVED_IN_X Unit: Count Valid + // groupings and filters: Queue, Channel, Routing Profile Threshold: For + // ThresholdValue enter any whole number from 1 to 604800 (inclusive), in seconds. + // For Comparison , you must enter LT (for "Less than"). CONTACTS_TRANSFERRED_OUT + // Unit: Count Valid groupings and filters: Queue, Channel, Routing Profile, Agent, + // Agent Hierarchy, Feature Feature is a valid filter but not a valid grouping. // CONTACTS_TRANSFERRED_OUT_BY_AGENT Unit: Count Valid groupings and filters: // Queue, Channel, Routing Profile, Agent, Agent Hierarchy // CONTACTS_TRANSFERRED_OUT_FROM_QUEUE Unit: Count Valid groupings and filters: @@ -189,9 +195,9 @@ type GetMetricDataV2Input struct { // The timestamp, in UNIX Epoch time format, at which to start the reporting // interval for the retrieval of historical metrics data. The time must be before - // the end time timestamp. The time range between the start and end time must be - // less than 24 hours. The start time cannot be earlier than 35 days before the - // time of the request. Historical metrics are available for 35 days. + // the end time timestamp. The start and end time depends on the IntervalPeriod + // selected. By default the time range between start and end time is 35 days. + // Historical metrics are available for 3 months. // // This member is required. StartTime *time.Time @@ -206,6 +212,30 @@ type GetMetricDataV2Input struct { // AGENT_HIERARCHY_LEVEL_FIVE Groupings []string + // The interval period and timezone to apply to returned metrics. + // - IntervalPeriod : An aggregated grouping applied to request metrics. Valid + // IntervalPeriod values are: FIFTEEN_MIN | THIRTY_MIN | HOUR | DAY | WEEK | + // TOTAL . For example, if IntervalPeriod is selected THIRTY_MIN , StartTime and + // EndTime differs by 1 day, then Amazon Connect returns 48 results in the + // response. Each result is aggregated by the THIRTY_MIN period. By default Amazon + // Connect aggregates results based on the TOTAL interval period. The following + // list describes restrictions on StartTime and EndTime based on which + // IntervalPeriod is requested. + // - FIFTEEN_MIN : The difference between StartTime and EndTime must be less than + // 3 days. + // - THIRTY_MIN : The difference between StartTime and EndTime must be less than + // 3 days. + // - HOUR : The difference between StartTime and EndTime must be less than 3 + // days. + // - DAY : The difference between StartTime and EndTime must be less than 35 + // days. + // - WEEK : The difference between StartTime and EndTime must be less than 35 + // days. + // - TOTAL : The difference between StartTime and EndTime must be less than 35 + // days. + // - TimeZone : The timezone applied to requested metrics. + Interval *types.IntervalDetails + // The maximum number of results to return per page. MaxResults *int32 diff --git a/service/connect/api_op_ListSecurityProfileApplications.go b/service/connect/api_op_ListSecurityProfileApplications.go index 0350d57d1c6..9d9ca45f75c 100644 --- a/service/connect/api_op_ListSecurityProfileApplications.go +++ b/service/connect/api_op_ListSecurityProfileApplications.go @@ -57,7 +57,8 @@ type ListSecurityProfileApplicationsInput struct { type ListSecurityProfileApplicationsOutput struct { - // A list of the third party application's metadata. + // This API is in preview release for Amazon Connect and is subject to change. A + // list of the third party application's metadata. Applications []types.Application // The token for the next set of results. The next set of results can be retrieved diff --git a/service/connect/api_op_ListSecurityProfilePermissions.go b/service/connect/api_op_ListSecurityProfilePermissions.go index 0b9eea66d66..38a09779764 100644 --- a/service/connect/api_op_ListSecurityProfilePermissions.go +++ b/service/connect/api_op_ListSecurityProfilePermissions.go @@ -15,7 +15,6 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API is in preview release for Amazon Connect and is subject to change. // Lists the permissions granted to a security profile. func (c *Client) ListSecurityProfilePermissions(ctx context.Context, params *ListSecurityProfilePermissionsInput, optFns ...func(*Options)) (*ListSecurityProfilePermissionsOutput, error) { if params == nil { diff --git a/service/connect/api_op_UpdateContactFlowContent.go b/service/connect/api_op_UpdateContactFlowContent.go index fc18fd2a07c..b59f13c0203 100644 --- a/service/connect/api_op_UpdateContactFlowContent.go +++ b/service/connect/api_op_UpdateContactFlowContent.go @@ -40,9 +40,9 @@ type UpdateContactFlowContentInput struct { // This member is required. ContactFlowId *string - // The JSON string that represents flow's content. For an example, see Example - // contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) - // . + // The JSON string that represents the content of the flow. For an example, see + // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // . Length Constraints: Minimum length of 1. Maximum length of 256000. // // This member is required. Content *string diff --git a/service/connect/api_op_UpdateContactFlowModuleContent.go b/service/connect/api_op_UpdateContactFlowModuleContent.go index c122a0708c9..10494084915 100644 --- a/service/connect/api_op_UpdateContactFlowModuleContent.go +++ b/service/connect/api_op_UpdateContactFlowModuleContent.go @@ -38,7 +38,9 @@ type UpdateContactFlowModuleContentInput struct { // This member is required. ContactFlowModuleId *string - // The content of the flow module. + // The JSON string that represents the content of the flow. For an example, see + // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // . // // This member is required. Content *string diff --git a/service/connect/api_op_UpdateSecurityProfile.go b/service/connect/api_op_UpdateSecurityProfile.go index ae0eabf2b51..f4ccfa830d4 100644 --- a/service/connect/api_op_UpdateSecurityProfile.go +++ b/service/connect/api_op_UpdateSecurityProfile.go @@ -16,7 +16,6 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API is in preview release for Amazon Connect and is subject to change. // Updates a security profile. func (c *Client) UpdateSecurityProfile(ctx context.Context, params *UpdateSecurityProfileInput, optFns ...func(*Options)) (*UpdateSecurityProfileOutput, error) { if params == nil { diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index a5c7221426d..f9c23c06515 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -38503,6 +38503,15 @@ func awsRestjson1_deserializeDocumentMetricFilterV2(v **types.MetricFilterV2, va return err } + case "Negate": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Negate = jtv + } + default: _, _ = key, value @@ -38548,6 +38557,78 @@ func awsRestjson1_deserializeDocumentMetricFilterValueList(v *[]string, value in return nil } +func awsRestjson1_deserializeDocumentMetricInterval(v **types.MetricInterval, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MetricInterval + if *v == nil { + sv = &types.MetricInterval{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EndTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Interval": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IntervalPeriod to be of type string, got %T instead", value) + } + sv.Interval = types.IntervalPeriod(jtv) + } + + case "StartTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentMetricResultsV2(v *[]types.MetricResultV2, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -38614,6 +38695,11 @@ func awsRestjson1_deserializeDocumentMetricResultV2(v **types.MetricResultV2, va return err } + case "MetricInterval": + if err := awsRestjson1_deserializeDocumentMetricInterval(&sv.MetricInterval, value); err != nil { + return err + } + default: _, _ = key, value diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 370de0d6e77..39289818761 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -8491,6 +8491,13 @@ func awsRestjson1_serializeOpDocumentGetMetricDataV2Input(v *GetMetricDataV2Inpu } } + if v.Interval != nil { + ok := object.Key("Interval") + if err := awsRestjson1_serializeDocumentIntervalDetails(v.Interval, ok); err != nil { + return err + } + } + if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) @@ -20111,6 +20118,23 @@ func awsRestjson1_serializeDocumentInstanceStorageConfig(v *types.InstanceStorag return nil } +func awsRestjson1_serializeDocumentIntervalDetails(v *types.IntervalDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.IntervalPeriod) > 0 { + ok := object.Key("IntervalPeriod") + ok.String(string(v.IntervalPeriod)) + } + + if v.TimeZone != nil { + ok := object.Key("TimeZone") + ok.String(*v.TimeZone) + } + + return nil +} + func awsRestjson1_serializeDocumentInvisibleFieldInfo(v *types.InvisibleFieldInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -20281,6 +20305,11 @@ func awsRestjson1_serializeDocumentMetricFilterV2(v *types.MetricFilterV2, value } } + if v.Negate { + ok := object.Key("Negate") + ok.Boolean(v.Negate) + } + return nil } diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index f202da88476..69cafd59bf9 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -747,6 +747,32 @@ func (IntegrationType) Values() []IntegrationType { } } +type IntervalPeriod string + +// Enum values for IntervalPeriod +const ( + IntervalPeriodFifteenMin IntervalPeriod = "FIFTEEN_MIN" + IntervalPeriodThirtyMin IntervalPeriod = "THIRTY_MIN" + IntervalPeriodHour IntervalPeriod = "HOUR" + IntervalPeriodDay IntervalPeriod = "DAY" + IntervalPeriodWeek IntervalPeriod = "WEEK" + IntervalPeriodTotal IntervalPeriod = "TOTAL" +) + +// Values returns all known values for IntervalPeriod. 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 (IntervalPeriod) Values() []IntervalPeriod { + return []IntervalPeriod{ + "FIFTEEN_MIN", + "THIRTY_MIN", + "HOUR", + "DAY", + "WEEK", + "TOTAL", + } +} + type LexVersion string // Enum values for LexVersion diff --git a/service/connect/types/types.go b/service/connect/types/types.go index c26edd53aa9..cafcac8ea43 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -399,7 +399,9 @@ type ContactFlow struct { // The Amazon Resource Name (ARN) of the flow. Arn *string - // The content of the flow. + // The JSON string that represents the content of the flow. For an example, see + // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // . Content *string // The description of the flow. @@ -432,7 +434,9 @@ type ContactFlowModule struct { // The Amazon Resource Name (ARN). Arn *string - // The content of the flow module. + // The JSON string that represents the content of the flow. For an example, see + // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // . Length Constraints: Minimum length of 1. Maximum length of 256000. Content *string // The description of the flow module. @@ -1926,6 +1930,37 @@ type IntegrationAssociationSummary struct { noSmithyDocumentSerde } +// Information about the interval period to use for returning results. +type IntervalDetails struct { + + // IntervalPeriod : An aggregated grouping applied to request metrics. Valid + // IntervalPeriod values are: FIFTEEN_MIN | THIRTY_MIN | HOUR | DAY | WEEK | TOTAL + // . For example, if IntervalPeriod is selected THIRTY_MIN , StartTime and EndTime + // differs by 1 day, then Amazon Connect returns 48 results in the response. Each + // result is aggregated by the THIRTY_MIN period. By default Amazon Connect + // aggregates results based on the TOTAL interval period. The following list + // describes restrictions on StartTime and EndTime based on what IntervalPeriod is + // requested. + // - FIFTEEN_MIN : The difference between StartTime and EndTime must be less than + // 3 days. + // - THIRTY_MIN : The difference between StartTime and EndTime must be less than + // 3 days. + // - HOUR : The difference between StartTime and EndTime must be less than 3 + // days. + // - DAY : The difference between StartTime and EndTime must be less than 35 + // days. + // - WEEK : The difference between StartTime and EndTime must be less than 35 + // days. + // - TOTAL : The difference between StartTime and EndTime must be less than 35 + // days. + IntervalPeriod IntervalPeriod + + // The timezone applied to requested metrics. + TimeZone *string + + noSmithyDocumentSerde +} + // A field that is invisible to an agent. type InvisibleFieldInfo struct { @@ -2101,6 +2136,31 @@ type MetricFilterV2 struct { // CONTACT_FLOW_DISCONNECT | OTHER | EXPIRED | API MetricFilterValues []string + // The flag to use to filter on requested metric filter values or to not filter on + // requested metric filter values. By default the negate is false , which indicates + // to filter on the requested metric filter. + Negate bool + + noSmithyDocumentSerde +} + +// The interval period with the start and end time for the metrics. +type MetricInterval struct { + + // The timestamp, in UNIX Epoch time format. End time is based on the interval + // period selected. For example, If IntervalPeriod is selected THIRTY_MIN , + // StartTime and EndTime in the API request differs by 1 day, then 48 results are + // returned in the response. Each result is aggregated by the 30 minutes period, + // with each StartTime and EndTime differing by 30 minutes. + EndTime *time.Time + + // The interval period provided in the API request. + Interval IntervalPeriod + + // The timestamp, in UNIX Epoch time format. Start time is based on the interval + // period selected. + StartTime *time.Time + noSmithyDocumentSerde } @@ -2113,6 +2173,9 @@ type MetricResultV2 struct { // The dimension for the metrics. Dimensions map[string]string + // The interval period with the start and end time for the metrics. + MetricInterval *MetricInterval + noSmithyDocumentSerde } diff --git a/service/location/api_op_CreateTracker.go b/service/location/api_op_CreateTracker.go index 082e49cc0ba..40db1fde6e3 100644 --- a/service/location/api_op_CreateTracker.go +++ b/service/location/api_op_CreateTracker.go @@ -53,6 +53,19 @@ type CreateTrackerInput struct { // for geofences with this tracker. Those events are always sent to EventBridge. EventBridgeEnabled *bool + // Enables GeospatialQueries for a tracker that uses a Amazon Web Services KMS + // customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) + // . This parameter is only used if you are using a KMS customer managed key. If + // you wish to encrypt your data using your own KMS customer managed key, then the + // Bounding Polygon Queries feature will be disabled by default. This is because by + // using this feature, a representation of your device positions will not be + // encrypted using the your KMS managed key. The exact device position, however; is + // still encrypted using your managed key. You can choose to opt-in to the Bounding + // Polygon Quseries feature. This is done by setting the + // KmsKeyEnableGeospatialQueries parameter to true when creating or updating a + // Tracker. + KmsKeyEnableGeospatialQueries *bool + // A key identifier for an Amazon Web Services KMS customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) // . Enter a key ID, key ARN, alias name, or alias ARN. KmsKeyId *string diff --git a/service/location/api_op_DescribeGeofenceCollection.go b/service/location/api_op_DescribeGeofenceCollection.go index ac7dccf0472..f1ebf235038 100644 --- a/service/location/api_op_DescribeGeofenceCollection.go +++ b/service/location/api_op_DescribeGeofenceCollection.go @@ -75,6 +75,9 @@ type DescribeGeofenceCollectionOutput struct { // This member is required. UpdateTime *time.Time + // The number of geofences in the geofence collection. + GeofenceCount *int32 + // A key identifier for an Amazon Web Services KMS customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) // assigned to the Amazon Location resource KmsKeyId *string diff --git a/service/location/api_op_DescribeTracker.go b/service/location/api_op_DescribeTracker.go index 5ca824d8def..a7ef31202b8 100644 --- a/service/location/api_op_DescribeTracker.go +++ b/service/location/api_op_DescribeTracker.go @@ -78,6 +78,19 @@ type DescribeTrackerOutput struct { // true these events will be sent to EventBridge. EventBridgeEnabled *bool + // Enables GeospatialQueries for a tracker that uses a Amazon Web Services KMS + // customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) + // . This parameter is only used if you are using a KMS customer managed key. If + // you wish to encrypt your data using your own KMS customer managed key, then the + // Bounding Polygon Queries feature will be disabled by default. This is because by + // using this feature, a representation of your device positions will not be + // encrypted using the your KMS managed key. The exact device position, however; is + // still encrypted using your managed key. You can choose to opt-in to the Bounding + // Polygon Quseries feature. This is done by setting the + // KmsKeyEnableGeospatialQueries parameter to true when creating or updating a + // Tracker. + KmsKeyEnableGeospatialQueries *bool + // A key identifier for an Amazon Web Services KMS customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) // assigned to the Amazon Location resource. KmsKeyId *string diff --git a/service/location/api_op_GetMapGlyphs.go b/service/location/api_op_GetMapGlyphs.go index beec69891a5..b493a27dfa6 100644 --- a/service/location/api_op_GetMapGlyphs.go +++ b/service/location/api_op_GetMapGlyphs.go @@ -34,7 +34,7 @@ func (c *Client) GetMapGlyphs(ctx context.Context, params *GetMapGlyphsInput, op type GetMapGlyphsInput struct { // A comma-separated list of fonts to load glyphs from in order of preference. For - // example, Noto Sans Regular, Arial Unicode . Valid fonts stacks for Esri (https://docs.aws.amazon.com/location/latest/developerguide/esri.html) + // example, Noto Sans Regular, Arial Unicode . Valid font stacks for Esri (https://docs.aws.amazon.com/location/latest/developerguide/esri.html) // styles: // - VectorEsriDarkGrayCanvas – Ubuntu Medium Italic | Ubuntu Medium | Ubuntu // Italic | Ubuntu Regular | Ubuntu Bold diff --git a/service/location/api_op_ListDevicePositions.go b/service/location/api_op_ListDevicePositions.go index 72087180de5..efdca7054e5 100644 --- a/service/location/api_op_ListDevicePositions.go +++ b/service/location/api_op_ListDevicePositions.go @@ -39,6 +39,9 @@ type ListDevicePositionsInput struct { // This member is required. TrackerName *string + // The geomerty used to filter device positions. + FilterGeometry *types.TrackingFilterGeometry + // An optional limit for the number of entries returned in a single call. Default // value: 100 MaxResults *int32 @@ -53,9 +56,7 @@ type ListDevicePositionsInput struct { type ListDevicePositionsOutput struct { - // Contains details about each device's last known position. These details - // includes the device ID, the time when the position was sampled on the device, - // the time that the service received the update, and the most recent coordinates. + // Contains details about each device's last known position. // // This member is required. Entries []types.ListDevicePositionsResponseEntry diff --git a/service/location/api_op_UpdateTracker.go b/service/location/api_op_UpdateTracker.go index c911d633bf7..25c61f84041 100644 --- a/service/location/api_op_UpdateTracker.go +++ b/service/location/api_op_UpdateTracker.go @@ -48,6 +48,11 @@ type UpdateTrackerInput struct { // for geofences with this tracker. Those events are always sent to EventBridge. EventBridgeEnabled *bool + // Enables GeospatialQueries for a tracker that uses a Amazon Web Services KMS + // customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) + // . This parameter is only used if you are using a KMS customer managed key. + KmsKeyEnableGeospatialQueries *bool + // Updates the position filtering for the tracker resource. Valid values: // - TimeBased - Location updates are evaluated against linked geofence // collections, but not every location update is stored. If your update frequency diff --git a/service/location/deserializers.go b/service/location/deserializers.go index 3c19d8afd3a..4ffcc10ed03 100644 --- a/service/location/deserializers.go +++ b/service/location/deserializers.go @@ -3315,6 +3315,19 @@ func awsRestjson1_deserializeOpDocumentDescribeGeofenceCollectionOutput(v **Desc sv.Description = ptr.String(jtv) } + case "GeofenceCount": + 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.GeofenceCount = ptr.Int32(int32(i64)) + } + case "KmsKeyId": if value != nil { jtv, ok := value.(string) @@ -4484,6 +4497,15 @@ func awsRestjson1_deserializeOpDocumentDescribeTrackerOutput(v **DescribeTracker sv.EventBridgeEnabled = ptr.Bool(jtv) } + case "KmsKeyEnableGeospatialQueries": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.KmsKeyEnableGeospatialQueries = ptr.Bool(jtv) + } + case "KmsKeyId": if value != nil { jtv, ok := value.(string) diff --git a/service/location/serializers.go b/service/location/serializers.go index 689d645206c..4f61581c97b 100644 --- a/service/location/serializers.go +++ b/service/location/serializers.go @@ -1509,6 +1509,11 @@ func awsRestjson1_serializeOpDocumentCreateTrackerInput(v *CreateTrackerInput, v ok.Boolean(*v.EventBridgeEnabled) } + if v.KmsKeyEnableGeospatialQueries != nil { + ok := object.Key("KmsKeyEnableGeospatialQueries") + ok.Boolean(*v.KmsKeyEnableGeospatialQueries) + } + if v.KmsKeyId != nil { ok := object.Key("KmsKeyId") ok.String(*v.KmsKeyId) @@ -3150,6 +3155,13 @@ func awsRestjson1_serializeOpDocumentListDevicePositionsInput(v *ListDevicePosit object := value.Object() defer object.Close() + if v.FilterGeometry != nil { + ok := object.Key("FilterGeometry") + if err := awsRestjson1_serializeDocumentTrackingFilterGeometry(v.FilterGeometry, ok); err != nil { + return err + } + } + if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) @@ -5123,6 +5135,11 @@ func awsRestjson1_serializeOpDocumentUpdateTrackerInput(v *UpdateTrackerInput, v ok.Boolean(*v.EventBridgeEnabled) } + if v.KmsKeyEnableGeospatialQueries != nil { + ok := object.Key("KmsKeyEnableGeospatialQueries") + ok.Boolean(*v.KmsKeyEnableGeospatialQueries) + } + if len(v.PositionFiltering) > 0 { ok := object.Key("PositionFiltering") ok.String(string(v.PositionFiltering)) @@ -5633,6 +5650,20 @@ func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson. return nil } +func awsRestjson1_serializeDocumentTrackingFilterGeometry(v *types.TrackingFilterGeometry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Polygon != nil { + ok := object.Key("Polygon") + if err := awsRestjson1_serializeDocumentLinearRings(v.Polygon, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentTruckDimensions(v *types.TruckDimensions, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/location/types/types.go b/service/location/types/types.go index 31eda98b11d..d4409e1b518 100644 --- a/service/location/types/types.go +++ b/service/location/types/types.go @@ -1423,6 +1423,16 @@ type TimeZone struct { noSmithyDocumentSerde } +// The geomerty used to filter device positions. +type TrackingFilterGeometry struct { + + // The set of arrays which define the polygon. A polygon can have between 4 and + // 1000 vertices. + Polygon [][][]float64 + + noSmithyDocumentSerde +} + // Contains details about the truck dimensions in the unit of measurement that you // specify. Used to filter out roads that can't support or allow the specified // dimensions for requests that specify TravelMode as Truck . diff --git a/service/mediaconvert/deserializers.go b/service/mediaconvert/deserializers.go index 2fe8caf85bb..a302e2140ae 100644 --- a/service/mediaconvert/deserializers.go +++ b/service/mediaconvert/deserializers.go @@ -5626,6 +5626,74 @@ func awsRestjson1_deserializeDocument__listOfTeletextPageType(v *[]types.Teletex return nil } +func awsRestjson1_deserializeDocument__listOfVideoOverlay(v *[]types.VideoOverlay, 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.VideoOverlay + if *v == nil { + cv = []types.VideoOverlay{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VideoOverlay + destAddr := &col + if err := awsRestjson1_deserializeDocumentVideoOverlay(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocument__listOfVideoOverlayInputClipping(v *[]types.VideoOverlayInputClipping, 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.VideoOverlayInputClipping + if *v == nil { + cv = []types.VideoOverlayInputClipping{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VideoOverlayInputClipping + destAddr := &col + if err := awsRestjson1_deserializeDocumentVideoOverlayInputClipping(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocument__listOfWarningGroup(v *[]types.WarningGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12184,6 +12252,15 @@ func awsRestjson1_deserializeDocumentH264Settings(v **types.H264Settings, value sv.DynamicSubGop = types.H264DynamicSubGop(jtv) } + case "endOfStreamMarkers": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected H264EndOfStreamMarkers to be of type string, got %T instead", value) + } + sv.EndOfStreamMarkers = types.H264EndOfStreamMarkers(jtv) + } + case "entropyEncoding": if value != nil { jtv, ok := value.(string) @@ -12770,6 +12847,15 @@ func awsRestjson1_deserializeDocumentH265Settings(v **types.H265Settings, value sv.DynamicSubGop = types.H265DynamicSubGop(jtv) } + case "endOfStreamMarkers": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected H265EndOfStreamMarkers to be of type string, got %T instead", value) + } + sv.EndOfStreamMarkers = types.H265EndOfStreamMarkers(jtv) + } + case "flickerAdaptiveQuantization": if value != nil { jtv, ok := value.(string) @@ -14641,6 +14727,11 @@ func awsRestjson1_deserializeDocumentInput(v **types.Input, value interface{}) e return err } + case "videoOverlays": + if err := awsRestjson1_deserializeDocument__listOfVideoOverlay(&sv.VideoOverlays, value); err != nil { + return err + } + case "videoSelector": if err := awsRestjson1_deserializeDocumentVideoSelector(&sv.VideoSelector, value); err != nil { return err @@ -14940,6 +15031,11 @@ func awsRestjson1_deserializeDocumentInputTemplate(v **types.InputTemplate, valu sv.TimecodeStart = ptr.String(jtv) } + case "videoOverlays": + if err := awsRestjson1_deserializeDocument__listOfVideoOverlay(&sv.VideoOverlays, value); err != nil { + return err + } + case "videoSelector": if err := awsRestjson1_deserializeDocumentVideoSelector(&sv.VideoSelector, value); err != nil { return err @@ -15556,19 +15652,6 @@ func awsRestjson1_deserializeDocumentJobSettings(v **types.JobSettings, value in return err } - case "followInputIndex": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected __integerMin0Max149 to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.FollowInputIndex = ptr.Int32(int32(i64)) - } - case "inputs": if err := awsRestjson1_deserializeDocument__listOfInput(&sv.Inputs, value); err != nil { return err @@ -15822,19 +15905,6 @@ func awsRestjson1_deserializeDocumentJobTemplateSettings(v **types.JobTemplateSe return err } - case "followInputIndex": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected __integerMin0Max149 to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.FollowInputIndex = ptr.Int32(int32(i64)) - } - case "inputs": if err := awsRestjson1_deserializeDocument__listOfInputTemplate(&sv.Inputs, value); err != nil { return err @@ -21582,6 +21652,172 @@ func awsRestjson1_deserializeDocumentVideoDetail(v **types.VideoDetail, value in return nil } +func awsRestjson1_deserializeDocumentVideoOverlay(v **types.VideoOverlay, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VideoOverlay + if *v == nil { + sv = &types.VideoOverlay{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endTimecode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __stringPattern010920405090509092 to be of type string, got %T instead", value) + } + sv.EndTimecode = ptr.String(jtv) + } + + case "input": + if err := awsRestjson1_deserializeDocumentVideoOverlayInput(&sv.Input, value); err != nil { + return err + } + + case "startTimecode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __stringPattern010920405090509092 to be of type string, got %T instead", value) + } + sv.StartTimecode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVideoOverlayInput(v **types.VideoOverlayInput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VideoOverlayInput + if *v == nil { + sv = &types.VideoOverlayInput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fileInput": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __stringPatternS3Https to be of type string, got %T instead", value) + } + sv.FileInput = ptr.String(jtv) + } + + case "inputClippings": + if err := awsRestjson1_deserializeDocument__listOfVideoOverlayInputClipping(&sv.InputClippings, value); err != nil { + return err + } + + case "timecodeSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputTimecodeSource to be of type string, got %T instead", value) + } + sv.TimecodeSource = types.InputTimecodeSource(jtv) + } + + case "timecodeStart": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __stringMin11Max11Pattern01D20305D205D to be of type string, got %T instead", value) + } + sv.TimecodeStart = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVideoOverlayInputClipping(v **types.VideoOverlayInputClipping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VideoOverlayInputClipping + if *v == nil { + sv = &types.VideoOverlayInputClipping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endTimecode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __stringPattern010920405090509092 to be of type string, got %T instead", value) + } + sv.EndTimecode = ptr.String(jtv) + } + + case "startTimecode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __stringPattern010920405090509092 to be of type string, got %T instead", value) + } + sv.StartTimecode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentVideoPreprocessor(v **types.VideoPreprocessor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/mediaconvert/serializers.go b/service/mediaconvert/serializers.go index d1c6535fd0e..7e12760737d 100644 --- a/service/mediaconvert/serializers.go +++ b/service/mediaconvert/serializers.go @@ -2677,6 +2677,32 @@ func awsRestjson1_serializeDocument__listOfTeletextPageType(v []types.TeletextPa return nil } +func awsRestjson1_serializeDocument__listOfVideoOverlay(v []types.VideoOverlay, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentVideoOverlay(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocument__listOfVideoOverlayInputClipping(v []types.VideoOverlayInputClipping, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentVideoOverlayInputClipping(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocument__mapOf__string(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5583,6 +5609,11 @@ func awsRestjson1_serializeDocumentH264Settings(v *types.H264Settings, value smi ok.String(string(v.DynamicSubGop)) } + if len(v.EndOfStreamMarkers) > 0 { + ok := object.Key("endOfStreamMarkers") + ok.String(string(v.EndOfStreamMarkers)) + } + if len(v.EntropyEncoding) > 0 { ok := object.Key("entropyEncoding") ok.String(string(v.EntropyEncoding)) @@ -5857,6 +5888,11 @@ func awsRestjson1_serializeDocumentH265Settings(v *types.H265Settings, value smi ok.String(string(v.DynamicSubGop)) } + if len(v.EndOfStreamMarkers) > 0 { + ok := object.Key("endOfStreamMarkers") + ok.String(string(v.EndOfStreamMarkers)) + } + if len(v.FlickerAdaptiveQuantization) > 0 { ok := object.Key("flickerAdaptiveQuantization") ok.String(string(v.FlickerAdaptiveQuantization)) @@ -6748,6 +6784,13 @@ func awsRestjson1_serializeDocumentInput(v *types.Input, value smithyjson.Value) } } + if v.VideoOverlays != nil { + ok := object.Key("videoOverlays") + if err := awsRestjson1_serializeDocument__listOfVideoOverlay(v.VideoOverlays, ok); err != nil { + return err + } + } + if v.VideoSelector != nil { ok := object.Key("videoSelector") if err := awsRestjson1_serializeDocumentVideoSelector(v.VideoSelector, ok); err != nil { @@ -6917,6 +6960,13 @@ func awsRestjson1_serializeDocumentInputTemplate(v *types.InputTemplate, value s ok.String(*v.TimecodeStart) } + if v.VideoOverlays != nil { + ok := object.Key("videoOverlays") + if err := awsRestjson1_serializeDocument__listOfVideoOverlay(v.VideoOverlays, ok); err != nil { + return err + } + } + if v.VideoSelector != nil { ok := object.Key("videoSelector") if err := awsRestjson1_serializeDocumentVideoSelector(v.VideoSelector, ok); err != nil { @@ -7031,11 +7081,6 @@ func awsRestjson1_serializeDocumentJobSettings(v *types.JobSettings, value smith } } - if v.FollowInputIndex != nil { - ok := object.Key("followInputIndex") - ok.Integer(*v.FollowInputIndex) - } - if v.Inputs != nil { ok := object.Key("inputs") if err := awsRestjson1_serializeDocument__listOfInput(v.Inputs, ok); err != nil { @@ -7125,11 +7170,6 @@ func awsRestjson1_serializeDocumentJobTemplateSettings(v *types.JobTemplateSetti } } - if v.FollowInputIndex != nil { - ok := object.Key("followInputIndex") - ok.Integer(*v.FollowInputIndex) - } - if v.Inputs != nil { ok := object.Key("inputs") if err := awsRestjson1_serializeDocument__listOfInputTemplate(v.Inputs, ok); err != nil { @@ -9414,6 +9454,76 @@ func awsRestjson1_serializeDocumentVideoDescription(v *types.VideoDescription, v return nil } +func awsRestjson1_serializeDocumentVideoOverlay(v *types.VideoOverlay, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTimecode != nil { + ok := object.Key("endTimecode") + ok.String(*v.EndTimecode) + } + + if v.Input != nil { + ok := object.Key("input") + if err := awsRestjson1_serializeDocumentVideoOverlayInput(v.Input, ok); err != nil { + return err + } + } + + if v.StartTimecode != nil { + ok := object.Key("startTimecode") + ok.String(*v.StartTimecode) + } + + return nil +} + +func awsRestjson1_serializeDocumentVideoOverlayInput(v *types.VideoOverlayInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FileInput != nil { + ok := object.Key("fileInput") + ok.String(*v.FileInput) + } + + if v.InputClippings != nil { + ok := object.Key("inputClippings") + if err := awsRestjson1_serializeDocument__listOfVideoOverlayInputClipping(v.InputClippings, ok); err != nil { + return err + } + } + + if len(v.TimecodeSource) > 0 { + ok := object.Key("timecodeSource") + ok.String(string(v.TimecodeSource)) + } + + if v.TimecodeStart != nil { + ok := object.Key("timecodeStart") + ok.String(*v.TimecodeStart) + } + + return nil +} + +func awsRestjson1_serializeDocumentVideoOverlayInputClipping(v *types.VideoOverlayInputClipping, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTimecode != nil { + ok := object.Key("endTimecode") + ok.String(*v.EndTimecode) + } + + if v.StartTimecode != nil { + ok := object.Key("startTimecode") + ok.String(*v.StartTimecode) + } + + return nil +} + func awsRestjson1_serializeDocumentVideoPreprocessor(v *types.VideoPreprocessor, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/mediaconvert/types/enums.go b/service/mediaconvert/types/enums.go index 85a60e8778b..0ed1b766b78 100644 --- a/service/mediaconvert/types/enums.go +++ b/service/mediaconvert/types/enums.go @@ -3577,6 +3577,24 @@ func (H264DynamicSubGop) Values() []H264DynamicSubGop { } } +type H264EndOfStreamMarkers string + +// Enum values for H264EndOfStreamMarkers +const ( + H264EndOfStreamMarkersInclude H264EndOfStreamMarkers = "INCLUDE" + H264EndOfStreamMarkersSuppress H264EndOfStreamMarkers = "SUPPRESS" +) + +// Values returns all known values for H264EndOfStreamMarkers. 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 (H264EndOfStreamMarkers) Values() []H264EndOfStreamMarkers { + return []H264EndOfStreamMarkers{ + "INCLUDE", + "SUPPRESS", + } +} + type H264EntropyEncoding string // Enum values for H264EntropyEncoding @@ -4098,6 +4116,24 @@ func (H265DynamicSubGop) Values() []H265DynamicSubGop { } } +type H265EndOfStreamMarkers string + +// Enum values for H265EndOfStreamMarkers +const ( + H265EndOfStreamMarkersInclude H265EndOfStreamMarkers = "INCLUDE" + H265EndOfStreamMarkersSuppress H265EndOfStreamMarkers = "SUPPRESS" +) + +// Values returns all known values for H265EndOfStreamMarkers. 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 (H265EndOfStreamMarkers) Values() []H265EndOfStreamMarkers { + return []H265EndOfStreamMarkers{ + "INCLUDE", + "SUPPRESS", + } +} + type H265FlickerAdaptiveQuantization string // Enum values for H265FlickerAdaptiveQuantization diff --git a/service/mediaconvert/types/types.go b/service/mediaconvert/types/types.go index b837cbb6281..b671bbe0a43 100644 --- a/service/mediaconvert/types/types.go +++ b/service/mediaconvert/types/types.go @@ -3133,6 +3133,12 @@ type H264Settings struct { // use the same number B-frames for all types of content: Choose Static. DynamicSubGop H264DynamicSubGop + // Optionally include or suppress markers at the end of your output that signal + // the end of the video stream. To include end of stream markers: Leave blank or + // keep the default value, Include. To not include end of stream markers: Choose + // Suppress. This is useful when your output will be inserted into another stream. + EndOfStreamMarkers H264EndOfStreamMarkers + // Entropy encoding mode. Use CABAC (must be in Main or High profile) or CAVLC. EntropyEncoding H264EntropyEncoding @@ -3524,6 +3530,12 @@ type H265Settings struct { // use the same number B-frames for all types of content: Choose Static. DynamicSubGop H265DynamicSubGop + // Optionally include or suppress markers at the end of your output that signal + // the end of the video stream. To include end of stream markers: Leave blank or + // keep the default value, Include. To not include end of stream markers: Choose + // Suppress. This is useful when your output will be inserted into another stream. + EndOfStreamMarkers H265EndOfStreamMarkers + // Enable this setting to have the encoder reduce I-frame pop. I-frame pop appears // as a visual flicker that can arise when the encoder saves bits by copying some // macroblocks many times from frame to frame, and then refreshes them at the @@ -4526,6 +4538,9 @@ type Input struct { // https://docs.aws.amazon.com/mediaconvert/latest/ug/video-generator.html VideoGenerator *InputVideoGenerator + // Contains an array of video overlays. + VideoOverlays []VideoOverlay + // Input video selectors contain the video settings for the input. Each of your // inputs can have up to one video selector. VideoSelector *VideoSelector @@ -4726,6 +4741,9 @@ type InputTemplate struct { // timecodes, see https://docs.aws.amazon.com/console/mediaconvert/timecode. TimecodeStart *string + // Contains an array of video overlays. + VideoOverlays []VideoOverlay + // Input video selectors contain the video settings for the input. Each of your // inputs can have up to one video selector. VideoSelector *VideoSelector @@ -4983,14 +5001,6 @@ type JobSettings struct { // Content Advisory. ExtendedDataServices *ExtendedDataServices - // Specifies which input metadata to use for the default "Follow input" option for - // the following settings: resolution, frame rate, and pixel aspect ratio. In the - // simplest case, specify which input is used based on its index in the job. For - // example if you specify 3, then the fourth input will be used from each input. If - // the job does not have a fourth input, then the first input will be used. If no - // followInputIndex is specified, then 0 will be chosen automatically. - FollowInputIndex *int32 - // Use Inputs to define source file used in the transcode job. There can be // multiple inputs add in a job. These inputs will be concantenated together to // create the output. @@ -5127,14 +5137,6 @@ type JobTemplateSettings struct { // Content Advisory. ExtendedDataServices *ExtendedDataServices - // Specifies which input metadata to use for the default "Follow input" option for - // the following settings: resolution, frame rate, and pixel aspect ratio. In the - // simplest case, specify which input is used based on its index in the job. For - // example if you specify 3, then the fourth input will be used from each input. If - // the job does not have a fourth input, then the first input will be used. If no - // followInputIndex is specified, then 0 will be chosen automatically. - FollowInputIndex *int32 - // Use Inputs to define the source file used in the transcode job. There can only // be one input in a job template. Using the API, you can include multiple inputs // when referencing a job template. @@ -7735,6 +7737,84 @@ type VideoDetail struct { noSmithyDocumentSerde } +// Overlay one or more videos on top of your input video. +type VideoOverlay struct { + + // Enter the end timecode in the underlying input video for this overlay. Your + // overlay will be active through this frame. To display your video overlay for the + // duration of the underlying video: Leave blank. Use the format HH:MM:SS:FF or + // HH:MM:SS;FF, where HH is the hour, MM is the minute, SS is the second, and FF is + // the frame number. When entering this value, take into account your choice for + // the underlying Input timecode source. For example, if you have embedded + // timecodes that start at 01:00:00:00 and you want your overlay to end ten minutes + // into the video, enter 01:10:00:00. + EndTimecode *string + + // Input settings for Video overlay. You can include one or more video overlays in + // sequence at different times that you specify. + Input *VideoOverlayInput + + // Enter the start timecode in the underlying input video for this overlay. Your + // overlay will be active starting with this frame. To display your video overlay + // starting at the beginning of the underlying video: Leave blank. Use the format + // HH:MM:SS:FF or HH:MM:SS;FF, where HH is the hour, MM is the minute, SS is the + // second, and FF is the frame number. When entering this value, take into account + // your choice for the underlying Input timecode source. For example, if you have + // embedded timecodes that start at 01:00:00:00 and you want your overlay to begin + // five minutes into the video, enter 01:05:00:00. + StartTimecode *string + + noSmithyDocumentSerde +} + +// Input settings for Video overlay. You can include one or more video overlays in +// sequence at different times that you specify. +type VideoOverlayInput struct { + + // Specify the input file S3, HTTP, or HTTPS URI for your video overlay. For + // consistency in color and formatting in your output video image, we recommend + // that you specify a video with similar characteristics as the underlying input + // video. + FileInput *string + + // Specify one or more clips to use from your video overlay. When you include an + // input clip, you must also specify its start timecode, end timecode, or both + // start and end timecode. + InputClippings []VideoOverlayInputClipping + + // Specify the starting timecode for your video overlay. To use the timecode + // present in your video overlay: Choose Embedded. To use a zerobased timecode: + // Choose Start at 0. To choose a timecode: Choose Specified start. When you do, + // enter the starting timecode in Start timecode. If you don't specify a value for + // Timecode source, MediaConvert uses Embedded by default. + TimecodeSource InputTimecodeSource + + // Specify the starting timecode for this video overlay. To use this setting, you + // must set Timecode source to Specified start. + TimecodeStart *string + + noSmithyDocumentSerde +} + +// To transcode only portions of your video overlay, include one input clip for +// each part of your video overlay that you want in your output. +type VideoOverlayInputClipping struct { + + // Specify the timecode of the last frame to include in your video overlay's clip. + // Use the format HH:MM:SS:FF or HH:MM:SS;FF, where HH is the hour, MM is the + // minute, SS is the second, and FF is the frame number. When entering this value, + // take into account your choice for Timecode source. + EndTimecode *string + + // Specify the timecode of the first frame to include in your video overlay's + // clip. Use the format HH:MM:SS:FF or HH:MM:SS;FF, where HH is the hour, MM is the + // minute, SS is the second, and FF is the frame number. When entering this value, + // take into account your choice for Timecode source. + StartTimecode *string + + noSmithyDocumentSerde +} + // Find additional transcoding features under Preprocessors. Enable the features // at each output individually. These features are disabled by default. type VideoPreprocessor struct { diff --git a/service/oam/api_op_PutSinkPolicy.go b/service/oam/api_op_PutSinkPolicy.go index d570093f18b..5ad69ccd239 100644 --- a/service/oam/api_op_PutSinkPolicy.go +++ b/service/oam/api_op_PutSinkPolicy.go @@ -23,6 +23,8 @@ import ( // - Metrics - Specify with AWS::CloudWatch::Metric // - Log groups - Specify with AWS::Logs::LogGroup // - Traces - Specify with AWS::XRay::Trace +// - Application Insights - Applications - Specify with +// AWS::ApplicationInsights::Application // // See the examples in this section to see how to specify permitted source // accounts and data types. diff --git a/service/oam/doc.go b/service/oam/doc.go index 672a4a111f9..acb07929824 100644 --- a/service/oam/doc.go +++ b/service/oam/doc.go @@ -7,14 +7,15 @@ // between source accounts and monitoring accounts by using CloudWatch // cross-account observability. With CloudWatch cross-account observability, you // can monitor and troubleshoot applications that span multiple accounts within a -// Region. Seamlessly search, visualize, and analyze your metrics, logs, and traces -// in any of the linked accounts without account boundaries. Set up one or more -// Amazon Web Services accounts as monitoring accounts and link them with multiple -// source accounts. A monitoring account is a central Amazon Web Services account -// that can view and interact with observability data generated from source -// accounts. A source account is an individual Amazon Web Services account that -// generates observability data for the resources that reside in it. Source -// accounts share their observability data with the monitoring account. The shared -// observability data can include metrics in Amazon CloudWatch, logs in Amazon -// CloudWatch Logs, and traces in X-Ray. +// Region. Seamlessly search, visualize, and analyze your metrics, logs, traces, +// and Application Insights applications in any of the linked accounts without +// account boundaries. Set up one or more Amazon Web Services accounts as +// monitoring accounts and link them with multiple source accounts. A monitoring +// account is a central Amazon Web Services account that can view and interact with +// observability data generated from source accounts. A source account is an +// individual Amazon Web Services account that generates observability data for the +// resources that reside in it. Source accounts share their observability data with +// the monitoring account. The shared observability data can include metrics in +// Amazon CloudWatch, logs in Amazon CloudWatch Logs, traces in X-Ray, and +// applications in Amazon CloudWatch Application Insights. package oam diff --git a/service/oam/types/enums.go b/service/oam/types/enums.go index c0dd5811c4d..cf144a0d8b0 100644 --- a/service/oam/types/enums.go +++ b/service/oam/types/enums.go @@ -6,9 +6,10 @@ type ResourceType string // Enum values for ResourceType const ( - ResourceTypeAwsCloudwatchMetric ResourceType = "AWS::CloudWatch::Metric" - ResourceTypeAwsLogsLoggroup ResourceType = "AWS::Logs::LogGroup" - ResourceTypeAwsXrayTrace ResourceType = "AWS::XRay::Trace" + ResourceTypeAwsCloudwatchMetric ResourceType = "AWS::CloudWatch::Metric" + ResourceTypeAwsLogsLoggroup ResourceType = "AWS::Logs::LogGroup" + ResourceTypeAwsXrayTrace ResourceType = "AWS::XRay::Trace" + ResourceTypeAwsApplicationinsightsApplication ResourceType = "AWS::ApplicationInsights::Application" ) // Values returns all known values for ResourceType. Note that this can be @@ -19,5 +20,6 @@ func (ResourceType) Values() []ResourceType { "AWS::CloudWatch::Metric", "AWS::Logs::LogGroup", "AWS::XRay::Trace", + "AWS::ApplicationInsights::Application", } } diff --git a/service/sagemaker/types/enums.go b/service/sagemaker/types/enums.go index 8c83b051475..fc1830d0f69 100644 --- a/service/sagemaker/types/enums.go +++ b/service/sagemaker/types/enums.go @@ -4304,6 +4304,7 @@ const ( ProductionVariantInstanceTypeMlInf28xlarge ProductionVariantInstanceType = "ml.inf2.8xlarge" ProductionVariantInstanceTypeMlInf224xlarge ProductionVariantInstanceType = "ml.inf2.24xlarge" ProductionVariantInstanceTypeMlInf248xlarge ProductionVariantInstanceType = "ml.inf2.48xlarge" + ProductionVariantInstanceTypeMlP548xlarge ProductionVariantInstanceType = "ml.p5.48xlarge" ) // Values returns all known values for ProductionVariantInstanceType. Note that @@ -4459,6 +4460,7 @@ func (ProductionVariantInstanceType) Values() []ProductionVariantInstanceType { "ml.inf2.8xlarge", "ml.inf2.24xlarge", "ml.inf2.48xlarge", + "ml.p5.48xlarge", } } diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index f9265c55d8b..eb020fe4a9f 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -12883,9 +12883,11 @@ type SelectiveExecutionConfig struct { // The ARN from a reference execution of the current pipeline. Used to copy input // collaterals needed for the selected steps to run. The execution status of the - // pipeline can be either Failed or Success . - // - // This member is required. + // pipeline can be either Failed or Success . This field is required if the steps + // you specify for SelectedSteps depend on output collaterals from any + // non-specified pipeline steps. For more information, see Selective Execution for + // Pipeline Steps (https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines-selective-ex.html) + // . SourcePipelineExecutionArn *string noSmithyDocumentSerde diff --git a/service/sagemaker/validators.go b/service/sagemaker/validators.go index 650e83b88e1..671d9719ecd 100644 --- a/service/sagemaker/validators.go +++ b/service/sagemaker/validators.go @@ -10645,9 +10645,6 @@ func validateSelectiveExecutionConfig(v *types.SelectiveExecutionConfig) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "SelectiveExecutionConfig"} - if v.SourcePipelineExecutionArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourcePipelineExecutionArn")) - } if v.SelectedSteps == nil { invalidParams.Add(smithy.NewErrParamRequired("SelectedSteps")) } else if v.SelectedSteps != nil { diff --git a/service/wellarchitected/api_op_CreateLensShare.go b/service/wellarchitected/api_op_CreateLensShare.go index 3b715c41b77..aa105afdbce 100644 --- a/service/wellarchitected/api_op_CreateLensShare.go +++ b/service/wellarchitected/api_op_CreateLensShare.go @@ -68,8 +68,8 @@ type CreateLensShareInput struct { // This member is required. LensAlias *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. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. // // This member is required. SharedWith *string diff --git a/service/wellarchitected/api_op_CreateProfileShare.go b/service/wellarchitected/api_op_CreateProfileShare.go index a8181aeddd4..53b637b12bc 100644 --- a/service/wellarchitected/api_op_CreateProfileShare.go +++ b/service/wellarchitected/api_op_CreateProfileShare.go @@ -50,8 +50,8 @@ type CreateProfileShareInput struct { // 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. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. // // This member is required. SharedWith *string diff --git a/service/wellarchitected/api_op_CreateReviewTemplate.go b/service/wellarchitected/api_op_CreateReviewTemplate.go new file mode 100644 index 00000000000..ef6b693b082 --- /dev/null +++ b/service/wellarchitected/api_op_CreateReviewTemplate.go @@ -0,0 +1,331 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a review template. Disclaimer Do not include or gather personal +// identifiable information (PII) of end users or other identifiable individuals in +// or via your review templates. If your review template or those shared with you +// and used in your account do include or collect PII you are responsible for: +// ensuring that the included PII is processed in accordance with applicable law, +// providing adequate privacy notices, and obtaining necessary consents for +// processing such data. +func (c *Client) CreateReviewTemplate(ctx context.Context, params *CreateReviewTemplateInput, optFns ...func(*Options)) (*CreateReviewTemplateOutput, error) { + if params == nil { + params = &CreateReviewTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateReviewTemplate", params, optFns, c.addOperationCreateReviewTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateReviewTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateReviewTemplateInput 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 review template description. + // + // This member is required. + Description *string + + // Lenses applied to the review template. + // + // This member is required. + Lenses []string + + // Name of the review template. + // + // This member is required. + TemplateName *string + + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. + Notes *string + + // The tags assigned to the review template. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateReviewTemplateOutput struct { + + // The review template ARN. + TemplateArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateReviewTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateReviewTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateReviewTemplate{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCreateReviewTemplateResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateReviewTemplateMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateReviewTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReviewTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateReviewTemplate struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateReviewTemplate) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateReviewTemplate) 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.(*CreateReviewTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateReviewTemplateInput ") + } + + 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_opCreateReviewTemplateMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateReviewTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateReviewTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "CreateReviewTemplate", + } +} + +type opCreateReviewTemplateResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateReviewTemplateResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateReviewTemplateResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addCreateReviewTemplateResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateReviewTemplateResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_CreateTemplateShare.go b/service/wellarchitected/api_op_CreateTemplateShare.go new file mode 100644 index 00000000000..5a08ab52abb --- /dev/null +++ b/service/wellarchitected/api_op_CreateTemplateShare.go @@ -0,0 +1,325 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a review template share. The owner of a review template can share it +// with other Amazon Web Services accounts, users, an organization, and +// organizational units (OUs) in the same Amazon Web Services Region. Shared access +// to a review template is not removed until the review template share invitation +// is deleted. If you share a review template with an organization or OU, all +// accounts in the organization or OU are granted access to the review template. +// Disclaimer By sharing your review template with other Amazon Web Services +// accounts, you acknowledge that Amazon Web Services will make your review +// template available to those other accounts. +func (c *Client) CreateTemplateShare(ctx context.Context, params *CreateTemplateShareInput, optFns ...func(*Options)) (*CreateTemplateShareOutput, error) { + if params == nil { + params = &CreateTemplateShareInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTemplateShare", params, optFns, c.addOperationCreateTemplateShareMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTemplateShareOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTemplateShareInput 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 Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. + // + // This member is required. + SharedWith *string + + // The review template ARN. + // + // This member is required. + TemplateArn *string + + noSmithyDocumentSerde +} + +type CreateTemplateShareOutput struct { + + // The ID associated with the share. + ShareId *string + + // The review template ARN. + TemplateArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTemplateShareMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTemplateShare{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTemplateShare{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCreateTemplateShareResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateTemplateShareMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateTemplateShareValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTemplateShare(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateTemplateShare struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateTemplateShare) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateTemplateShare) 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.(*CreateTemplateShareInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateTemplateShareInput ") + } + + 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_opCreateTemplateShareMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateTemplateShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateTemplateShare(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "CreateTemplateShare", + } +} + +type opCreateTemplateShareResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateTemplateShareResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateTemplateShareResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addCreateTemplateShareResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateTemplateShareResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_CreateWorkload.go b/service/wellarchitected/api_op_CreateWorkload.go index 4f0f0ff0db4..c949dd30052 100644 --- a/service/wellarchitected/api_op_CreateWorkload.go +++ b/service/wellarchitected/api_op_CreateWorkload.go @@ -23,7 +23,12 @@ import ( // in the Well-Architected Tool User Guide. Either AwsRegions , NonAwsRegions , or // both must be specified when creating a workload. You also must specify // ReviewOwner , even though the parameter is listed as not being required in the -// following section. +// following section. When creating a workload using a review template, you must +// have the following IAM permissions: +// - wellarchitected:GetReviewTemplate +// - wellarchitected:GetReviewTemplateAnswer +// - wellarchitected:ListReviewTemplateAnswers +// - wellarchitected:GetReviewTemplateLensReview func (c *Client) CreateWorkload(ctx context.Context, params *CreateWorkloadInput, optFns ...func(*Options)) (*CreateWorkloadOutput, error) { if params == nil { params = &CreateWorkloadInput{} @@ -65,7 +70,9 @@ type CreateWorkloadInput struct { Environment types.WorkloadEnvironment // The list of lenses associated with the workload. Each lens is identified by its - // LensSummary$LensAlias . + // LensSummary$LensAlias . If a review template that specifies lenses is applied to + // the workload, those lenses are applied to the workload in addition to these + // lenses. // // This member is required. Lenses []string @@ -129,7 +136,8 @@ type CreateWorkloadInput struct { // The list of non-Amazon Web Services Regions associated with the workload. NonAwsRegions []string - // The notes associated with the workload. + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. Notes *string // The priorities of the pillars, which are used to order items in the improvement @@ -143,6 +151,9 @@ type CreateWorkloadInput struct { // the primary group or individual that owns the workload review process. ReviewOwner *string + // The list of review template ARNs to associate with the workload. + ReviewTemplateArns []string + // The tags to be associated with the workload. Tags map[string]string diff --git a/service/wellarchitected/api_op_CreateWorkloadShare.go b/service/wellarchitected/api_op_CreateWorkloadShare.go index 1fdd58b822d..e98bb8e29fc 100644 --- a/service/wellarchitected/api_op_CreateWorkloadShare.go +++ b/service/wellarchitected/api_op_CreateWorkloadShare.go @@ -58,8 +58,8 @@ type CreateWorkloadShareInput struct { // 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, lens, or profile is shared. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. // // This member is required. SharedWith *string diff --git a/service/wellarchitected/api_op_DeleteReviewTemplate.go b/service/wellarchitected/api_op_DeleteReviewTemplate.go new file mode 100644 index 00000000000..7dbbaf679d8 --- /dev/null +++ b/service/wellarchitected/api_op_DeleteReviewTemplate.go @@ -0,0 +1,307 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete a review template. Only the owner of a review template can delete it. +// After the review template is deleted, Amazon Web Services accounts, users, +// organizations, and organizational units (OUs) that you shared the review +// template with will no longer be able to apply it to new workloads. +func (c *Client) DeleteReviewTemplate(ctx context.Context, params *DeleteReviewTemplateInput, optFns ...func(*Options)) (*DeleteReviewTemplateOutput, error) { + if params == nil { + params = &DeleteReviewTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteReviewTemplate", params, optFns, c.addOperationDeleteReviewTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteReviewTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteReviewTemplateInput 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 review template ARN. + // + // This member is required. + TemplateArn *string + + noSmithyDocumentSerde +} + +type DeleteReviewTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteReviewTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteReviewTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteReviewTemplate{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addDeleteReviewTemplateResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteReviewTemplateMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteReviewTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteReviewTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpDeleteReviewTemplate struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteReviewTemplate) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteReviewTemplate) 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.(*DeleteReviewTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteReviewTemplateInput ") + } + + 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_opDeleteReviewTemplateMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteReviewTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteReviewTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "DeleteReviewTemplate", + } +} + +type opDeleteReviewTemplateResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteReviewTemplateResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteReviewTemplateResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteReviewTemplateResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteReviewTemplateResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_DeleteTemplateShare.go b/service/wellarchitected/api_op_DeleteTemplateShare.go new file mode 100644 index 00000000000..0ab95fc996f --- /dev/null +++ b/service/wellarchitected/api_op_DeleteTemplateShare.go @@ -0,0 +1,312 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete a review template share. After the review template share is deleted, +// Amazon Web Services accounts, users, organizations, and organizational units +// (OUs) that you shared the review template with will no longer be able to apply +// it to new workloads. +func (c *Client) DeleteTemplateShare(ctx context.Context, params *DeleteTemplateShareInput, optFns ...func(*Options)) (*DeleteTemplateShareOutput, error) { + if params == nil { + params = &DeleteTemplateShareInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteTemplateShare", params, optFns, c.addOperationDeleteTemplateShareMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTemplateShareOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteTemplateShareInput 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 ID associated with the share. + // + // This member is required. + ShareId *string + + // The review template ARN. + // + // This member is required. + TemplateArn *string + + noSmithyDocumentSerde +} + +type DeleteTemplateShareOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTemplateShareMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteTemplateShare{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteTemplateShare{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addDeleteTemplateShareResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteTemplateShareMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteTemplateShareValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTemplateShare(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpDeleteTemplateShare struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteTemplateShare) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteTemplateShare) 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.(*DeleteTemplateShareInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteTemplateShareInput ") + } + + 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_opDeleteTemplateShareMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteTemplateShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteTemplateShare(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "DeleteTemplateShare", + } +} + +type opDeleteTemplateShareResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteTemplateShareResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteTemplateShareResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteTemplateShareResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteTemplateShareResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_GetReviewTemplate.go b/service/wellarchitected/api_op_GetReviewTemplate.go new file mode 100644 index 00000000000..7d002f61cbb --- /dev/null +++ b/service/wellarchitected/api_op_GetReviewTemplate.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get review template. +func (c *Client) GetReviewTemplate(ctx context.Context, params *GetReviewTemplateInput, optFns ...func(*Options)) (*GetReviewTemplateOutput, error) { + if params == nil { + params = &GetReviewTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetReviewTemplate", params, optFns, c.addOperationGetReviewTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetReviewTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetReviewTemplateInput struct { + + // The review template ARN. + // + // This member is required. + TemplateArn *string + + noSmithyDocumentSerde +} + +type GetReviewTemplateOutput struct { + + // The review template. + ReviewTemplate *types.ReviewTemplate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetReviewTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetReviewTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetReviewTemplate{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addGetReviewTemplateResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetReviewTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReviewTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetReviewTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetReviewTemplate", + } +} + +type opGetReviewTemplateResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetReviewTemplateResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetReviewTemplateResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetReviewTemplateResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetReviewTemplateResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_GetReviewTemplateAnswer.go b/service/wellarchitected/api_op_GetReviewTemplateAnswer.go new file mode 100644 index 00000000000..f085d77c512 --- /dev/null +++ b/service/wellarchitected/api_op_GetReviewTemplateAnswer.go @@ -0,0 +1,289 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get review template answer. +func (c *Client) GetReviewTemplateAnswer(ctx context.Context, params *GetReviewTemplateAnswerInput, optFns ...func(*Options)) (*GetReviewTemplateAnswerOutput, error) { + if params == nil { + params = &GetReviewTemplateAnswerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetReviewTemplateAnswer", params, optFns, c.addOperationGetReviewTemplateAnswerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetReviewTemplateAnswerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetReviewTemplateAnswerInput struct { + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + // + // This member is required. + LensAlias *string + + // The ID of the question. + // + // This member is required. + QuestionId *string + + // The review template ARN. + // + // This member is required. + TemplateArn *string + + noSmithyDocumentSerde +} + +type GetReviewTemplateAnswerOutput struct { + + // An answer of the question. + Answer *types.ReviewTemplateAnswer + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + LensAlias *string + + // The review template ARN. + TemplateArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetReviewTemplateAnswerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetReviewTemplateAnswer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetReviewTemplateAnswer{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addGetReviewTemplateAnswerResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetReviewTemplateAnswerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReviewTemplateAnswer(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetReviewTemplateAnswer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetReviewTemplateAnswer", + } +} + +type opGetReviewTemplateAnswerResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetReviewTemplateAnswerResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetReviewTemplateAnswerResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetReviewTemplateAnswerResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetReviewTemplateAnswerResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_GetReviewTemplateLensReview.go b/service/wellarchitected/api_op_GetReviewTemplateLensReview.go new file mode 100644 index 00000000000..3581a849abb --- /dev/null +++ b/service/wellarchitected/api_op_GetReviewTemplateLensReview.go @@ -0,0 +1,275 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get a lens review associated with a review template. +func (c *Client) GetReviewTemplateLensReview(ctx context.Context, params *GetReviewTemplateLensReviewInput, optFns ...func(*Options)) (*GetReviewTemplateLensReviewOutput, error) { + if params == nil { + params = &GetReviewTemplateLensReviewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetReviewTemplateLensReview", params, optFns, c.addOperationGetReviewTemplateLensReviewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetReviewTemplateLensReviewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetReviewTemplateLensReviewInput struct { + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + // + // This member is required. + LensAlias *string + + // The review template ARN. + // + // This member is required. + TemplateArn *string + + noSmithyDocumentSerde +} + +type GetReviewTemplateLensReviewOutput struct { + + // A lens review of a question. + LensReview *types.ReviewTemplateLensReview + + // The review template ARN. + TemplateArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetReviewTemplateLensReviewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetReviewTemplateLensReview{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetReviewTemplateLensReview{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addGetReviewTemplateLensReviewResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetReviewTemplateLensReviewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReviewTemplateLensReview(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetReviewTemplateLensReview(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetReviewTemplateLensReview", + } +} + +type opGetReviewTemplateLensReviewResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetReviewTemplateLensReviewResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetReviewTemplateLensReviewResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetReviewTemplateLensReviewResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetReviewTemplateLensReviewResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_ListLensShares.go b/service/wellarchitected/api_op_ListLensShares.go index e73a0106167..f0347f79afc 100644 --- a/service/wellarchitected/api_op_ListLensShares.go +++ b/service/wellarchitected/api_op_ListLensShares.go @@ -51,8 +51,8 @@ type ListLensSharesInput struct { // 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 lens is shared. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the lens is shared. SharedWithPrefix *string // The status of the share request. diff --git a/service/wellarchitected/api_op_ListNotifications.go b/service/wellarchitected/api_op_ListNotifications.go index 6beb60c3049..89cb852c683 100644 --- a/service/wellarchitected/api_op_ListNotifications.go +++ b/service/wellarchitected/api_op_ListNotifications.go @@ -40,6 +40,10 @@ type ListNotificationsInput struct { // The token to use to retrieve the next set of results. NextToken *string + // The ARN for the related resource for the notification. Only one of WorkloadID + // or ResourceARN should be specified. + ResourceArn *string + // The ID assigned to the workload. This ID is unique within an Amazon Web // Services Region. WorkloadId *string diff --git a/service/wellarchitected/api_op_ListProfileShares.go b/service/wellarchitected/api_op_ListProfileShares.go index 1a8083f637c..d5b89309aa3 100644 --- a/service/wellarchitected/api_op_ListProfileShares.go +++ b/service/wellarchitected/api_op_ListProfileShares.go @@ -45,8 +45,8 @@ type ListProfileSharesInput struct { // 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. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the profile is shared. SharedWithPrefix *string // The status of the share request. diff --git a/service/wellarchitected/api_op_ListProfiles.go b/service/wellarchitected/api_op_ListProfiles.go index 99cbad305aa..2f68bb9448a 100644 --- a/service/wellarchitected/api_op_ListProfiles.go +++ b/service/wellarchitected/api_op_ListProfiles.go @@ -40,7 +40,8 @@ type ListProfilesInput struct { // The token to use to retrieve the next set of results. NextToken *string - // Prefix for profile name. + // An optional string added to the beginning of each profile name returned in the + // results. ProfileNamePrefix *string // Profile owner type. diff --git a/service/wellarchitected/api_op_ListReviewTemplateAnswers.go b/service/wellarchitected/api_op_ListReviewTemplateAnswers.go new file mode 100644 index 00000000000..9a3b35cc8ff --- /dev/null +++ b/service/wellarchitected/api_op_ListReviewTemplateAnswers.go @@ -0,0 +1,385 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the answers of a review template. +func (c *Client) ListReviewTemplateAnswers(ctx context.Context, params *ListReviewTemplateAnswersInput, optFns ...func(*Options)) (*ListReviewTemplateAnswersOutput, error) { + if params == nil { + params = &ListReviewTemplateAnswersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListReviewTemplateAnswers", params, optFns, c.addOperationListReviewTemplateAnswersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListReviewTemplateAnswersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListReviewTemplateAnswersInput struct { + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + // + // This member is required. + LensAlias *string + + // The ARN of the review template. + // + // This member is required. + TemplateArn *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 ID used to identify a pillar, for example, security . A pillar is identified + // by its PillarReviewSummary$PillarId . + PillarId *string + + noSmithyDocumentSerde +} + +type ListReviewTemplateAnswersOutput struct { + + // List of answer summaries of a lens review in a review template. + AnswerSummaries []types.ReviewTemplateAnswerSummary + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + LensAlias *string + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ARN of the review template. + TemplateArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListReviewTemplateAnswersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListReviewTemplateAnswers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListReviewTemplateAnswers{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListReviewTemplateAnswersResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpListReviewTemplateAnswersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReviewTemplateAnswers(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListReviewTemplateAnswersAPIClient is a client that implements the +// ListReviewTemplateAnswers operation. +type ListReviewTemplateAnswersAPIClient interface { + ListReviewTemplateAnswers(context.Context, *ListReviewTemplateAnswersInput, ...func(*Options)) (*ListReviewTemplateAnswersOutput, error) +} + +var _ ListReviewTemplateAnswersAPIClient = (*Client)(nil) + +// ListReviewTemplateAnswersPaginatorOptions is the paginator options for +// ListReviewTemplateAnswers +type ListReviewTemplateAnswersPaginatorOptions 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 +} + +// ListReviewTemplateAnswersPaginator is a paginator for ListReviewTemplateAnswers +type ListReviewTemplateAnswersPaginator struct { + options ListReviewTemplateAnswersPaginatorOptions + client ListReviewTemplateAnswersAPIClient + params *ListReviewTemplateAnswersInput + nextToken *string + firstPage bool +} + +// NewListReviewTemplateAnswersPaginator returns a new +// ListReviewTemplateAnswersPaginator +func NewListReviewTemplateAnswersPaginator(client ListReviewTemplateAnswersAPIClient, params *ListReviewTemplateAnswersInput, optFns ...func(*ListReviewTemplateAnswersPaginatorOptions)) *ListReviewTemplateAnswersPaginator { + if params == nil { + params = &ListReviewTemplateAnswersInput{} + } + + options := ListReviewTemplateAnswersPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListReviewTemplateAnswersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReviewTemplateAnswersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListReviewTemplateAnswers page. +func (p *ListReviewTemplateAnswersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReviewTemplateAnswersOutput, 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.ListReviewTemplateAnswers(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_opListReviewTemplateAnswers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListReviewTemplateAnswers", + } +} + +type opListReviewTemplateAnswersResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListReviewTemplateAnswersResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListReviewTemplateAnswersResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListReviewTemplateAnswersResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListReviewTemplateAnswersResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_ListReviewTemplates.go b/service/wellarchitected/api_op_ListReviewTemplates.go new file mode 100644 index 00000000000..59d45f7315a --- /dev/null +++ b/service/wellarchitected/api_op_ListReviewTemplates.go @@ -0,0 +1,349 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List review templates. +func (c *Client) ListReviewTemplates(ctx context.Context, params *ListReviewTemplatesInput, optFns ...func(*Options)) (*ListReviewTemplatesOutput, error) { + if params == nil { + params = &ListReviewTemplatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListReviewTemplates", params, optFns, c.addOperationListReviewTemplatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListReviewTemplatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListReviewTemplatesInput 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 + + noSmithyDocumentSerde +} + +type ListReviewTemplatesOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // List of review templates. + ReviewTemplates []types.ReviewTemplateSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListReviewTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListReviewTemplates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListReviewTemplates{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListReviewTemplatesResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReviewTemplates(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListReviewTemplatesAPIClient is a client that implements the +// ListReviewTemplates operation. +type ListReviewTemplatesAPIClient interface { + ListReviewTemplates(context.Context, *ListReviewTemplatesInput, ...func(*Options)) (*ListReviewTemplatesOutput, error) +} + +var _ ListReviewTemplatesAPIClient = (*Client)(nil) + +// ListReviewTemplatesPaginatorOptions is the paginator options for +// ListReviewTemplates +type ListReviewTemplatesPaginatorOptions 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 +} + +// ListReviewTemplatesPaginator is a paginator for ListReviewTemplates +type ListReviewTemplatesPaginator struct { + options ListReviewTemplatesPaginatorOptions + client ListReviewTemplatesAPIClient + params *ListReviewTemplatesInput + nextToken *string + firstPage bool +} + +// NewListReviewTemplatesPaginator returns a new ListReviewTemplatesPaginator +func NewListReviewTemplatesPaginator(client ListReviewTemplatesAPIClient, params *ListReviewTemplatesInput, optFns ...func(*ListReviewTemplatesPaginatorOptions)) *ListReviewTemplatesPaginator { + if params == nil { + params = &ListReviewTemplatesInput{} + } + + options := ListReviewTemplatesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListReviewTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReviewTemplatesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListReviewTemplates page. +func (p *ListReviewTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReviewTemplatesOutput, 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.ListReviewTemplates(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_opListReviewTemplates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListReviewTemplates", + } +} + +type opListReviewTemplatesResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListReviewTemplatesResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListReviewTemplatesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListReviewTemplatesResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListReviewTemplatesResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_ListShareInvitations.go b/service/wellarchitected/api_op_ListShareInvitations.go index 66a8cce646e..e3666e389c9 100644 --- a/service/wellarchitected/api_op_ListShareInvitations.go +++ b/service/wellarchitected/api_op_ListShareInvitations.go @@ -16,7 +16,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List the workload invitations. +// List the share invitations. WorkloadNamePrefix , LensNamePrefix , +// ProfileNamePrefix , and TemplateNamePrefix are mutually exclusive. Use the +// parameter that matches your ShareResourceType . func (c *Client) ListShareInvitations(ctx context.Context, params *ListShareInvitationsInput, optFns ...func(*Options)) (*ListShareInvitationsOutput, error) { if params == nil { params = &ListShareInvitationsInput{} @@ -45,12 +47,17 @@ type ListShareInvitationsInput struct { // The token to use to retrieve the next set of results. NextToken *string - // Profile name prefix. + // An optional string added to the beginning of each profile name returned in the + // results. ProfileNamePrefix *string // The type of share invitations to be returned. ShareResourceType types.ShareResourceType + // An optional string added to the beginning of each review template name returned + // in the results. + TemplateNamePrefix *string + // An optional string added to the beginning of each workload name returned in the // results. WorkloadNamePrefix *string diff --git a/service/wellarchitected/api_op_ListTagsForResource.go b/service/wellarchitected/api_op_ListTagsForResource.go index 91239e659ed..fd48b72f900 100644 --- a/service/wellarchitected/api_op_ListTagsForResource.go +++ b/service/wellarchitected/api_op_ListTagsForResource.go @@ -16,7 +16,7 @@ import ( ) // List the tags for a resource. The WorkloadArn parameter can be a workload ARN, -// a custom lens ARN, or a profile ARN. +// a custom lens ARN, a profile ARN, or review template 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_ListTemplateShares.go b/service/wellarchitected/api_op_ListTemplateShares.go new file mode 100644 index 00000000000..6e72dfbc574 --- /dev/null +++ b/service/wellarchitected/api_op_ListTemplateShares.go @@ -0,0 +1,367 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List review template shares. +func (c *Client) ListTemplateShares(ctx context.Context, params *ListTemplateSharesInput, optFns ...func(*Options)) (*ListTemplateSharesOutput, error) { + if params == nil { + params = &ListTemplateSharesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTemplateShares", params, optFns, c.addOperationListTemplateSharesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTemplateSharesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTemplateSharesInput struct { + + // The review template ARN. + // + // This member is required. + TemplateArn *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, 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 ListTemplateSharesOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // The review template ARN. + TemplateArn *string + + // A review template share summary return object. + TemplateShareSummaries []types.TemplateShareSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTemplateSharesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTemplateShares{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTemplateShares{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListTemplateSharesResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpListTemplateSharesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTemplateShares(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListTemplateSharesAPIClient is a client that implements the ListTemplateShares +// operation. +type ListTemplateSharesAPIClient interface { + ListTemplateShares(context.Context, *ListTemplateSharesInput, ...func(*Options)) (*ListTemplateSharesOutput, error) +} + +var _ ListTemplateSharesAPIClient = (*Client)(nil) + +// ListTemplateSharesPaginatorOptions is the paginator options for +// ListTemplateShares +type ListTemplateSharesPaginatorOptions 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 +} + +// ListTemplateSharesPaginator is a paginator for ListTemplateShares +type ListTemplateSharesPaginator struct { + options ListTemplateSharesPaginatorOptions + client ListTemplateSharesAPIClient + params *ListTemplateSharesInput + nextToken *string + firstPage bool +} + +// NewListTemplateSharesPaginator returns a new ListTemplateSharesPaginator +func NewListTemplateSharesPaginator(client ListTemplateSharesAPIClient, params *ListTemplateSharesInput, optFns ...func(*ListTemplateSharesPaginatorOptions)) *ListTemplateSharesPaginator { + if params == nil { + params = &ListTemplateSharesInput{} + } + + options := ListTemplateSharesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListTemplateSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTemplateSharesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListTemplateShares page. +func (p *ListTemplateSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplateSharesOutput, 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.ListTemplateShares(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_opListTemplateShares(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListTemplateShares", + } +} + +type opListTemplateSharesResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListTemplateSharesResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListTemplateSharesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListTemplateSharesResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListTemplateSharesResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_ListWorkloadShares.go b/service/wellarchitected/api_op_ListWorkloadShares.go index 49ed349e869..93faa05eae5 100644 --- a/service/wellarchitected/api_op_ListWorkloadShares.go +++ b/service/wellarchitected/api_op_ListWorkloadShares.go @@ -47,8 +47,8 @@ type ListWorkloadSharesInput struct { // 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 workload is shared. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload is shared. SharedWithPrefix *string // The status of the share request. diff --git a/service/wellarchitected/api_op_TagResource.go b/service/wellarchitected/api_op_TagResource.go index 634a779d9b0..c2fc091eafe 100644 --- a/service/wellarchitected/api_op_TagResource.go +++ b/service/wellarchitected/api_op_TagResource.go @@ -16,7 +16,7 @@ import ( ) // Adds one or more tags to the specified resource. The WorkloadArn parameter can -// be a workload ARN, a custom lens ARN, or a profile ARN. +// be a workload ARN, a custom lens ARN, a profile ARN, or review template 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 91c9617ca61..d11c71c3cfc 100644 --- a/service/wellarchitected/api_op_UntagResource.go +++ b/service/wellarchitected/api_op_UntagResource.go @@ -16,8 +16,8 @@ import ( ) // 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 +// workload ARN, a custom lens ARN, a profile ARN, or review template 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_UpdateAnswer.go b/service/wellarchitected/api_op_UpdateAnswer.go index 6d48c35c759..2ab74fb3a6e 100644 --- a/service/wellarchitected/api_op_UpdateAnswer.go +++ b/service/wellarchitected/api_op_UpdateAnswer.go @@ -64,7 +64,8 @@ type UpdateAnswerInput struct { // Defines whether this question is applicable to a lens review. IsApplicable bool - // The notes associated with the workload. + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. Notes *string // The reason why a question is not applicable to your workload. diff --git a/service/wellarchitected/api_op_UpdateLensReview.go b/service/wellarchitected/api_op_UpdateLensReview.go index fd29442c333..139a6dac9e2 100644 --- a/service/wellarchitected/api_op_UpdateLensReview.go +++ b/service/wellarchitected/api_op_UpdateLensReview.go @@ -52,10 +52,13 @@ type UpdateLensReviewInput struct { // This member is required. WorkloadId *string - // The notes associated with the workload. + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. LensNotes *string - // List of pillar notes of a lens review in a workload. + // List of pillar notes of a lens review in a workload. For a review template, + // these are the notes that will be associated with the workload when the template + // is applied. PillarNotes map[string]string noSmithyDocumentSerde diff --git a/service/wellarchitected/api_op_UpdateReviewTemplate.go b/service/wellarchitected/api_op_UpdateReviewTemplate.go new file mode 100644 index 00000000000..465c90708e9 --- /dev/null +++ b/service/wellarchitected/api_op_UpdateReviewTemplate.go @@ -0,0 +1,278 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a review template. +func (c *Client) UpdateReviewTemplate(ctx context.Context, params *UpdateReviewTemplateInput, optFns ...func(*Options)) (*UpdateReviewTemplateOutput, error) { + if params == nil { + params = &UpdateReviewTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateReviewTemplate", params, optFns, c.addOperationUpdateReviewTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateReviewTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateReviewTemplateInput struct { + + // The review template ARN. + // + // This member is required. + TemplateArn *string + + // The review template description. + Description *string + + // A list of lens aliases or ARNs to apply to the review template. + LensesToAssociate []string + + // A list of lens aliases or ARNs to unapply to the review template. The + // wellarchitected lens cannot be unapplied. + LensesToDisassociate []string + + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. + Notes *string + + // The review template name. + TemplateName *string + + noSmithyDocumentSerde +} + +type UpdateReviewTemplateOutput struct { + + // A review template. + ReviewTemplate *types.ReviewTemplate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateReviewTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateReviewTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateReviewTemplate{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addUpdateReviewTemplateResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateReviewTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateReviewTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateReviewTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateReviewTemplate", + } +} + +type opUpdateReviewTemplateResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateReviewTemplateResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateReviewTemplateResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateReviewTemplateResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateReviewTemplateResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_UpdateReviewTemplateAnswer.go b/service/wellarchitected/api_op_UpdateReviewTemplateAnswer.go new file mode 100644 index 00000000000..75642922f9f --- /dev/null +++ b/service/wellarchitected/api_op_UpdateReviewTemplateAnswer.go @@ -0,0 +1,306 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a review template answer. +func (c *Client) UpdateReviewTemplateAnswer(ctx context.Context, params *UpdateReviewTemplateAnswerInput, optFns ...func(*Options)) (*UpdateReviewTemplateAnswerOutput, error) { + if params == nil { + params = &UpdateReviewTemplateAnswerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateReviewTemplateAnswer", params, optFns, c.addOperationUpdateReviewTemplateAnswerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateReviewTemplateAnswerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateReviewTemplateAnswerInput struct { + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + // + // This member is required. + LensAlias *string + + // The ID of the question. + // + // This member is required. + QuestionId *string + + // The review template ARN. + // + // This member is required. + TemplateArn *string + + // A list of choices to be updated. + ChoiceUpdates map[string]types.ChoiceUpdate + + // Defines whether this question is applicable to a lens review. + IsApplicable bool + + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. + Notes *string + + // The update reason. + Reason types.AnswerReason + + // List of selected choice IDs in a question answer. The values entered replace + // the previously selected choices. + SelectedChoices []string + + noSmithyDocumentSerde +} + +type UpdateReviewTemplateAnswerOutput struct { + + // An answer of the question. + Answer *types.ReviewTemplateAnswer + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + LensAlias *string + + // The review template ARN. + TemplateArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateReviewTemplateAnswerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateReviewTemplateAnswer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateReviewTemplateAnswer{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addUpdateReviewTemplateAnswerResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateReviewTemplateAnswerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateReviewTemplateAnswer(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateReviewTemplateAnswer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateReviewTemplateAnswer", + } +} + +type opUpdateReviewTemplateAnswerResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateReviewTemplateAnswerResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateReviewTemplateAnswerResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateReviewTemplateAnswerResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateReviewTemplateAnswerResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_UpdateReviewTemplateLensReview.go b/service/wellarchitected/api_op_UpdateReviewTemplateLensReview.go new file mode 100644 index 00000000000..cb1966be3c3 --- /dev/null +++ b/service/wellarchitected/api_op_UpdateReviewTemplateLensReview.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a lens review associated with a review template. +func (c *Client) UpdateReviewTemplateLensReview(ctx context.Context, params *UpdateReviewTemplateLensReviewInput, optFns ...func(*Options)) (*UpdateReviewTemplateLensReviewOutput, error) { + if params == nil { + params = &UpdateReviewTemplateLensReviewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateReviewTemplateLensReview", params, optFns, c.addOperationUpdateReviewTemplateLensReviewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateReviewTemplateLensReviewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateReviewTemplateLensReviewInput struct { + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + // + // This member is required. + LensAlias *string + + // The review template ARN. + // + // This member is required. + TemplateArn *string + + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. + LensNotes *string + + // List of pillar notes of a lens review in a workload. For a review template, + // these are the notes that will be associated with the workload when the template + // is applied. + PillarNotes map[string]string + + noSmithyDocumentSerde +} + +type UpdateReviewTemplateLensReviewOutput struct { + + // A lens review of a question. + LensReview *types.ReviewTemplateLensReview + + // The review template ARN. + TemplateArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateReviewTemplateLensReviewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateReviewTemplateLensReview{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateReviewTemplateLensReview{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addUpdateReviewTemplateLensReviewResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateReviewTemplateLensReviewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateReviewTemplateLensReview(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateReviewTemplateLensReview(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateReviewTemplateLensReview", + } +} + +type opUpdateReviewTemplateLensReviewResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateReviewTemplateLensReviewResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateReviewTemplateLensReviewResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateReviewTemplateLensReviewResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateReviewTemplateLensReviewResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/api_op_UpdateWorkload.go b/service/wellarchitected/api_op_UpdateWorkload.go index 47d05d8fc35..f081fa5fdce 100644 --- a/service/wellarchitected/api_op_UpdateWorkload.go +++ b/service/wellarchitected/api_op_UpdateWorkload.go @@ -108,7 +108,8 @@ type UpdateWorkloadInput struct { // The list of non-Amazon Web Services Regions associated with the workload. NonAwsRegions []string - // The notes associated with the workload. + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. Notes *string // The priorities of the pillars, which are used to order items in the improvement diff --git a/service/wellarchitected/api_op_UpgradeReviewTemplateLensReview.go b/service/wellarchitected/api_op_UpgradeReviewTemplateLensReview.go new file mode 100644 index 00000000000..8811da68ada --- /dev/null +++ b/service/wellarchitected/api_op_UpgradeReviewTemplateLensReview.go @@ -0,0 +1,277 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Upgrade the lens review of a review template. +func (c *Client) UpgradeReviewTemplateLensReview(ctx context.Context, params *UpgradeReviewTemplateLensReviewInput, optFns ...func(*Options)) (*UpgradeReviewTemplateLensReviewOutput, error) { + if params == nil { + params = &UpgradeReviewTemplateLensReviewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpgradeReviewTemplateLensReview", params, optFns, c.addOperationUpgradeReviewTemplateLensReviewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpgradeReviewTemplateLensReviewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpgradeReviewTemplateLensReviewInput struct { + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + // + // This member is required. + LensAlias *string + + // The ARN of the review template. + // + // This member is required. + TemplateArn *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 + + noSmithyDocumentSerde +} + +type UpgradeReviewTemplateLensReviewOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpgradeReviewTemplateLensReviewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpgradeReviewTemplateLensReview{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpgradeReviewTemplateLensReview{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addUpgradeReviewTemplateLensReviewResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpgradeReviewTemplateLensReviewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpgradeReviewTemplateLensReview(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpgradeReviewTemplateLensReview(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpgradeReviewTemplateLensReview", + } +} + +type opUpgradeReviewTemplateLensReviewResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpgradeReviewTemplateLensReviewResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpgradeReviewTemplateLensReviewResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "wellarchitected" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "wellarchitected" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("wellarchitected") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpgradeReviewTemplateLensReviewResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpgradeReviewTemplateLensReviewResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/wellarchitected/deserializers.go b/service/wellarchitected/deserializers.go index cc83a32a8c9..4312416dad0 100644 --- a/service/wellarchitected/deserializers.go +++ b/service/wellarchitected/deserializers.go @@ -1110,14 +1110,14 @@ func awsRestjson1_deserializeOpDocumentCreateProfileShareOutput(v **CreateProfil return nil } -type awsRestjson1_deserializeOpCreateWorkload struct { +type awsRestjson1_deserializeOpCreateReviewTemplate struct { } -func (*awsRestjson1_deserializeOpCreateWorkload) ID() string { +func (*awsRestjson1_deserializeOpCreateReviewTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateReviewTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1131,9 +1131,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_deserializeOpErrorCreateReviewTemplate(response, &metadata) } - output := &CreateWorkloadOutput{} + output := &CreateReviewTemplateOutput{} out.Result = output var buff [1024]byte @@ -1154,7 +1154,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateReviewTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1167,7 +1167,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateReviewTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1239,7 +1239,7 @@ func awsRestjson1_deserializeOpErrorCreateWorkload(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(v **CreateWorkloadOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateReviewTemplateOutput(v **CreateReviewTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1252,31 +1252,22 @@ func awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(v **CreateWorkloadOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateWorkloadOutput + var sv *CreateReviewTemplateOutput if *v == nil { - sv = &CreateWorkloadOutput{} + sv = &CreateReviewTemplateOutput{} } 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": + case "TemplateArn": 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 TemplateArn to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.TemplateArn = ptr.String(jtv) } default: @@ -1288,14 +1279,14 @@ func awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(v **CreateWorkloadOu return nil } -type awsRestjson1_deserializeOpCreateWorkloadShare struct { +type awsRestjson1_deserializeOpCreateTemplateShare struct { } -func (*awsRestjson1_deserializeOpCreateWorkloadShare) ID() string { +func (*awsRestjson1_deserializeOpCreateTemplateShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateTemplateShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1309,9 +1300,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_deserializeOpErrorCreateTemplateShare(response, &metadata) } - output := &CreateWorkloadShareOutput{} + output := &CreateTemplateShareOutput{} out.Result = output var buff [1024]byte @@ -1332,7 +1323,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateTemplateShareOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1345,7 +1336,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateTemplateShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1417,7 +1408,7 @@ func awsRestjson1_deserializeOpErrorCreateWorkloadShare(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(v **CreateWorkloadShareOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateTemplateShareOutput(v **CreateTemplateShareOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1430,9 +1421,9 @@ func awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(v **CreateWorkl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateWorkloadShareOutput + var sv *CreateTemplateShareOutput if *v == nil { - sv = &CreateWorkloadShareOutput{} + sv = &CreateTemplateShareOutput{} } else { sv = *v } @@ -1448,13 +1439,13 @@ func awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(v **CreateWorkl sv.ShareId = ptr.String(jtv) } - case "WorkloadId": + case "TemplateArn": 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 TemplateArn to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.TemplateArn = ptr.String(jtv) } default: @@ -1466,14 +1457,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) @@ -1487,21 +1478,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)} @@ -1554,6 +1567,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) @@ -1570,14 +1586,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) @@ -1591,21 +1656,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 { + 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_deserializeOpDocumentCreateWorkloadShareOutput(&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_deserializeOpErrorDeleteLensShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -1658,6 +1745,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) @@ -1674,14 +1764,63 @@ func awsRestjson1_deserializeOpErrorDeleteLensShare(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteProfile 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_deserializeOpDeleteProfile) ID() string { +type awsRestjson1_deserializeOpDeleteLens struct { +} + +func (*awsRestjson1_deserializeOpDeleteLens) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteProfile) 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) @@ -1695,9 +1834,9 @@ func (m *awsRestjson1_deserializeOpDeleteProfile) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteLens(response, &metadata) } - output := &DeleteProfileOutput{} + output := &DeleteLensOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1709,7 +1848,7 @@ func (m *awsRestjson1_deserializeOpDeleteProfile) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteProfile(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)} @@ -1778,14 +1917,14 @@ func awsRestjson1_deserializeOpErrorDeleteProfile(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeleteProfileShare struct { +type awsRestjson1_deserializeOpDeleteLensShare struct { } -func (*awsRestjson1_deserializeOpDeleteProfileShare) ID() string { +func (*awsRestjson1_deserializeOpDeleteLensShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteProfileShare) 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) @@ -1799,9 +1938,9 @@ func (m *awsRestjson1_deserializeOpDeleteProfileShare) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteProfileShare(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteLensShare(response, &metadata) } - output := &DeleteProfileShareOutput{} + output := &DeleteLensShareOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1813,7 +1952,7 @@ func (m *awsRestjson1_deserializeOpDeleteProfileShare) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteProfileShare(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)} @@ -1882,14 +2021,14 @@ func awsRestjson1_deserializeOpErrorDeleteProfileShare(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpDeleteWorkload struct { +type awsRestjson1_deserializeOpDeleteProfile struct { } -func (*awsRestjson1_deserializeOpDeleteWorkload) ID() string { +func (*awsRestjson1_deserializeOpDeleteProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteWorkload) 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) @@ -1903,9 +2042,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_deserializeOpErrorDeleteProfile(response, &metadata) } - output := &DeleteWorkloadOutput{} + output := &DeleteProfileOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1917,7 +2056,7 @@ func (m *awsRestjson1_deserializeOpDeleteWorkload) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteWorkload(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)} @@ -1986,14 +2125,14 @@ func awsRestjson1_deserializeOpErrorDeleteWorkload(response *smithyhttp.Response } } -type awsRestjson1_deserializeOpDeleteWorkloadShare struct { +type awsRestjson1_deserializeOpDeleteProfileShare struct { } -func (*awsRestjson1_deserializeOpDeleteWorkloadShare) ID() string { +func (*awsRestjson1_deserializeOpDeleteProfileShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteWorkloadShare) 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) @@ -2007,9 +2146,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_deserializeOpErrorDeleteProfileShare(response, &metadata) } - output := &DeleteWorkloadShareOutput{} + output := &DeleteProfileShareOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -2021,7 +2160,7 @@ func (m *awsRestjson1_deserializeOpDeleteWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteWorkloadShare(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)} @@ -2090,14 +2229,14 @@ func awsRestjson1_deserializeOpErrorDeleteWorkloadShare(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpDisassociateLenses struct { +type awsRestjson1_deserializeOpDeleteReviewTemplate struct { } -func (*awsRestjson1_deserializeOpDisassociateLenses) ID() string { +func (*awsRestjson1_deserializeOpDeleteReviewTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteReviewTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2111,9 +2250,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_deserializeOpErrorDeleteReviewTemplate(response, &metadata) } - output := &DisassociateLensesOutput{} + output := &DeleteReviewTemplateOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -2125,7 +2264,7 @@ func (m *awsRestjson1_deserializeOpDisassociateLenses) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateLenses(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteReviewTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2194,14 +2333,14 @@ func awsRestjson1_deserializeOpErrorDisassociateLenses(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpDisassociateProfiles struct { +type awsRestjson1_deserializeOpDeleteTemplateShare struct { } -func (*awsRestjson1_deserializeOpDisassociateProfiles) ID() string { +func (*awsRestjson1_deserializeOpDeleteTemplateShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteTemplateShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2215,9 +2354,9 @@ func (m *awsRestjson1_deserializeOpDisassociateProfiles) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteTemplateShare(response, &metadata) } - output := &DisassociateProfilesOutput{} + output := &DeleteTemplateShareOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -2229,7 +2368,7 @@ func (m *awsRestjson1_deserializeOpDisassociateProfiles) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteTemplateShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2298,14 +2437,14 @@ func awsRestjson1_deserializeOpErrorDisassociateProfiles(response *smithyhttp.Re } } -type awsRestjson1_deserializeOpExportLens struct { +type awsRestjson1_deserializeOpDeleteWorkload struct { } -func (*awsRestjson1_deserializeOpExportLens) ID() string { +func (*awsRestjson1_deserializeOpDeleteWorkload) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpExportLens) 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) @@ -2319,43 +2458,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_deserializeOpErrorDeleteWorkload(response, &metadata) } - output := &ExportLensOutput{} + 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_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_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)} @@ -2399,6 +2516,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) @@ -2421,54 +2541,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_deserializeOpDeleteWorkloadShare struct { } -func (*awsRestjson1_deserializeOpGetAnswer) ID() string { +func (*awsRestjson1_deserializeOpDeleteWorkloadShare) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -2482,43 +2562,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_deserializeOpErrorDeleteWorkloadShare(response, &metadata) } - output := &GetAnswerOutput{} + output := &DeleteWorkloadShareOutput{} 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_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)} @@ -2562,6 +2620,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) @@ -2584,90 +2645,14 @@ 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 - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetAnswerOutput - if *v == nil { - sv = &GetAnswerOutput{} - } 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 "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_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) @@ -2681,43 +2666,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)} @@ -2767,7 +2730,10 @@ func awsRestjson1_deserializeOpErrorGetConsolidatedReport(response *smithyhttp.R case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): + 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): @@ -2783,68 +2749,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) @@ -2858,43 +2770,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)} @@ -2938,6 +2828,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) @@ -2960,50 +2853,14 @@ 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 - } - - shape, ok := value.(map[string]interface{}) - 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 { +type awsRestjson1_deserializeOpExportLens struct { } -func (*awsRestjson1_deserializeOpGetLensReview) ID() string { +func (*awsRestjson1_deserializeOpExportLens) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -3017,9 +2874,9 @@ func (m *awsRestjson1_deserializeOpGetLensReview) HandleDeserialize(ctx context. } 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 @@ -3040,7 +2897,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) @@ -3053,7 +2910,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)} @@ -3119,7 +2976,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) } @@ -3132,40 +2989,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: @@ -3177,14 +3016,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) @@ -3198,9 +3037,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 @@ -3221,7 +3060,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) @@ -3234,7 +3073,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)} @@ -3300,7 +3139,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) } @@ -3313,20 +3152,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) @@ -3358,14 +3215,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) @@ -3379,9 +3236,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 @@ -3402,7 +3259,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) @@ -3415,7 +3272,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)} @@ -3459,12 +3316,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) @@ -3481,7 +3338,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) } @@ -3494,63 +3351,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": + case "Base64String": 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 Base64String to be of type string, got %T instead", value) } - sv.BaseLensVersion = ptr.String(jtv) + sv.Base64String = 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": - 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: @@ -3562,14 +3392,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) @@ -3583,9 +3413,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 @@ -3606,7 +3436,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) @@ -3619,7 +3449,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)} @@ -3685,7 +3515,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) } @@ -3698,29 +3528,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 @@ -3730,14 +3551,14 @@ func awsRestjson1_deserializeOpDocumentGetMilestoneOutput(v **GetMilestoneOutput return nil } -type awsRestjson1_deserializeOpGetProfile struct { +type awsRestjson1_deserializeOpGetLensReview struct { } -func (*awsRestjson1_deserializeOpGetProfile) ID() string { +func (*awsRestjson1_deserializeOpGetLensReview) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetProfile) 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) @@ -3751,9 +3572,9 @@ func (m *awsRestjson1_deserializeOpGetProfile) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetLensReview(response, &metadata) } - output := &GetProfileOutput{} + output := &GetLensReviewOutput{} out.Result = output var buff [1024]byte @@ -3774,7 +3595,7 @@ func (m *awsRestjson1_deserializeOpGetProfile) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLensReviewOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3787,7 +3608,7 @@ func (m *awsRestjson1_deserializeOpGetProfile) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetProfile(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)} @@ -3853,7 +3674,7 @@ func awsRestjson1_deserializeOpErrorGetProfile(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetProfileOutput(v **GetProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLensReviewOutput(v **GetLensReviewOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3866,20 +3687,42 @@ func awsRestjson1_deserializeOpDocumentGetProfileOutput(v **GetProfileOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetProfileOutput + var sv *GetLensReviewOutput if *v == nil { - sv = &GetProfileOutput{} + sv = &GetLensReviewOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Profile": - if err := awsRestjson1_deserializeDocumentProfile(&sv.Profile, value); err != nil { + 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": + 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 @@ -3889,14 +3732,14 @@ func awsRestjson1_deserializeOpDocumentGetProfileOutput(v **GetProfileOutput, va return nil } -type awsRestjson1_deserializeOpGetProfileTemplate struct { +type awsRestjson1_deserializeOpGetLensReviewReport struct { } -func (*awsRestjson1_deserializeOpGetProfileTemplate) ID() string { +func (*awsRestjson1_deserializeOpGetLensReviewReport) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetProfileTemplate) 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) @@ -3910,9 +3753,9 @@ func (m *awsRestjson1_deserializeOpGetProfileTemplate) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetProfileTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetLensReviewReport(response, &metadata) } - output := &GetProfileTemplateOutput{} + output := &GetLensReviewReportOutput{} out.Result = output var buff [1024]byte @@ -3933,7 +3776,7 @@ func (m *awsRestjson1_deserializeOpGetProfileTemplate) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetProfileTemplateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3946,7 +3789,7 @@ func (m *awsRestjson1_deserializeOpGetProfileTemplate) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetProfileTemplate(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)} @@ -4012,7 +3855,7 @@ func awsRestjson1_deserializeOpErrorGetProfileTemplate(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetProfileTemplateOutput(v **GetProfileTemplateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(v **GetLensReviewReportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4025,20 +3868,42 @@ func awsRestjson1_deserializeOpDocumentGetProfileTemplateOutput(v **GetProfileTe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetProfileTemplateOutput + var sv *GetLensReviewReportOutput if *v == nil { - sv = &GetProfileTemplateOutput{} + sv = &GetLensReviewReportOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ProfileTemplate": - if err := awsRestjson1_deserializeDocumentProfileTemplate(&sv.ProfileTemplate, value); err != nil { + case "LensReviewReport": + if err := awsRestjson1_deserializeDocumentLensReviewReport(&sv.LensReviewReport, 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": + 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 @@ -4048,14 +3913,14 @@ func awsRestjson1_deserializeOpDocumentGetProfileTemplateOutput(v **GetProfileTe return nil } -type awsRestjson1_deserializeOpGetWorkload struct { +type awsRestjson1_deserializeOpGetLensVersionDifference struct { } -func (*awsRestjson1_deserializeOpGetWorkload) ID() string { +func (*awsRestjson1_deserializeOpGetLensVersionDifference) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetWorkload) 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) @@ -4069,9 +3934,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_deserializeOpErrorGetLensVersionDifference(response, &metadata) } - output := &GetWorkloadOutput{} + output := &GetLensVersionDifferenceOutput{} out.Result = output var buff [1024]byte @@ -4092,7 +3957,7 @@ func (m *awsRestjson1_deserializeOpGetWorkload) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetWorkloadOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4105,7 +3970,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_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)} @@ -4171,7 +4036,7 @@ func awsRestjson1_deserializeOpErrorGetWorkload(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentGetWorkloadOutput(v **GetWorkloadOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(v **GetLensVersionDifferenceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4184,17 +4049,62 @@ func awsRestjson1_deserializeOpDocumentGetWorkloadOutput(v **GetWorkloadOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetWorkloadOutput + var sv *GetLensVersionDifferenceOutput if *v == nil { - sv = &GetWorkloadOutput{} + sv = &GetLensVersionDifferenceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Workload": - if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { + 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": + 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 "TargetLensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion 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 } @@ -4207,14 +4117,14 @@ func awsRestjson1_deserializeOpDocumentGetWorkloadOutput(v **GetWorkloadOutput, return nil } -type awsRestjson1_deserializeOpImportLens struct { +type awsRestjson1_deserializeOpGetMilestone struct { } -func (*awsRestjson1_deserializeOpImportLens) ID() string { +func (*awsRestjson1_deserializeOpGetMilestone) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpImportLens) 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) @@ -4228,9 +4138,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_deserializeOpErrorGetMilestone(response, &metadata) } - output := &ImportLensOutput{} + output := &GetMilestoneOutput{} out.Result = output var buff [1024]byte @@ -4251,7 +4161,7 @@ func (m *awsRestjson1_deserializeOpImportLens) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentImportLensOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetMilestoneOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4264,7 +4174,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_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)} @@ -4308,18 +4218,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) @@ -4336,7 +4240,7 @@ func awsRestjson1_deserializeOpErrorImportLens(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentImportLensOutput(v **ImportLensOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetMilestoneOutput(v **GetMilestoneOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4349,31 +4253,27 @@ func awsRestjson1_deserializeOpDocumentImportLensOutput(v **ImportLensOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ImportLensOutput + var sv *GetMilestoneOutput if *v == nil { - sv = &ImportLensOutput{} + sv = &GetMilestoneOutput{} } else { sv = *v } 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 "Milestone": + if err := awsRestjson1_deserializeDocumentMilestone(&sv.Milestone, value); err != nil { + return err } - 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: @@ -4385,14 +4285,14 @@ func awsRestjson1_deserializeOpDocumentImportLensOutput(v **ImportLensOutput, va return nil } -type awsRestjson1_deserializeOpListAnswers struct { +type awsRestjson1_deserializeOpGetProfile struct { } -func (*awsRestjson1_deserializeOpListAnswers) ID() string { +func (*awsRestjson1_deserializeOpGetProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAnswers) 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) @@ -4406,9 +4306,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_deserializeOpErrorGetProfile(response, &metadata) } - output := &ListAnswersOutput{} + output := &GetProfileOutput{} out.Result = output var buff [1024]byte @@ -4429,7 +4329,7 @@ func (m *awsRestjson1_deserializeOpListAnswers) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAnswersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4442,7 +4342,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_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)} @@ -4508,7 +4408,7 @@ func awsRestjson1_deserializeOpErrorListAnswers(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetProfileOutput(v **GetProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4521,69 +4421,20 @@ func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAnswersOutput + var sv *GetProfileOutput if *v == nil { - sv = &ListAnswersOutput{} + sv = &GetProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AnswerSummaries": - if err := awsRestjson1_deserializeDocumentAnswerSummaries(&sv.AnswerSummaries, value); err != nil { + case "Profile": + if err := awsRestjson1_deserializeDocumentProfile(&sv.Profile, 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 @@ -4593,14 +4444,14 @@ func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, return nil } -type awsRestjson1_deserializeOpListCheckDetails struct { +type awsRestjson1_deserializeOpGetProfileTemplate struct { } -func (*awsRestjson1_deserializeOpListCheckDetails) ID() string { +func (*awsRestjson1_deserializeOpGetProfileTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCheckDetails) 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) @@ -4614,9 +4465,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_deserializeOpErrorGetProfileTemplate(response, &metadata) } - output := &ListCheckDetailsOutput{} + output := &GetProfileTemplateOutput{} out.Result = output var buff [1024]byte @@ -4637,7 +4488,7 @@ func (m *awsRestjson1_deserializeOpListCheckDetails) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetProfileTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4650,7 +4501,7 @@ func (m *awsRestjson1_deserializeOpListCheckDetails) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCheckDetails(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)} @@ -4716,7 +4567,7 @@ func awsRestjson1_deserializeOpErrorListCheckDetails(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(v **ListCheckDetailsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetProfileTemplateOutput(v **GetProfileTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4729,29 +4580,20 @@ func awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(v **ListCheckDetai return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCheckDetailsOutput + var sv *GetProfileTemplateOutput if *v == nil { - sv = &ListCheckDetailsOutput{} + sv = &GetProfileTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CheckDetails": - if err := awsRestjson1_deserializeDocumentCheckDetails(&sv.CheckDetails, 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 @@ -4761,14 +4603,14 @@ func awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(v **ListCheckDetai return nil } -type awsRestjson1_deserializeOpListCheckSummaries struct { +type awsRestjson1_deserializeOpGetReviewTemplate struct { } -func (*awsRestjson1_deserializeOpListCheckSummaries) ID() string { +func (*awsRestjson1_deserializeOpGetReviewTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCheckSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetReviewTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4782,9 +4624,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_deserializeOpErrorGetReviewTemplate(response, &metadata) } - output := &ListCheckSummariesOutput{} + output := &GetReviewTemplateOutput{} out.Result = output var buff [1024]byte @@ -4805,7 +4647,7 @@ func (m *awsRestjson1_deserializeOpListCheckSummaries) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetReviewTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4818,7 +4660,7 @@ func (m *awsRestjson1_deserializeOpListCheckSummaries) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCheckSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetReviewTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4884,7 +4726,7 @@ func awsRestjson1_deserializeOpErrorListCheckSummaries(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(v **ListCheckSummariesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetReviewTemplateOutput(v **GetReviewTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4897,29 +4739,20 @@ func awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(v **ListCheckSum return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCheckSummariesOutput + var sv *GetReviewTemplateOutput if *v == nil { - sv = &ListCheckSummariesOutput{} + sv = &GetReviewTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CheckSummaries": - if err := awsRestjson1_deserializeDocumentCheckSummaries(&sv.CheckSummaries, value); err != nil { + case "ReviewTemplate": + if err := awsRestjson1_deserializeDocumentReviewTemplate(&sv.ReviewTemplate, 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 @@ -4929,14 +4762,14 @@ func awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(v **ListCheckSum return nil } -type awsRestjson1_deserializeOpListLenses struct { +type awsRestjson1_deserializeOpGetReviewTemplateAnswer struct { } -func (*awsRestjson1_deserializeOpListLenses) ID() string { +func (*awsRestjson1_deserializeOpGetReviewTemplateAnswer) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetReviewTemplateAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4950,9 +4783,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_deserializeOpErrorGetReviewTemplateAnswer(response, &metadata) } - output := &ListLensesOutput{} + output := &GetReviewTemplateAnswerOutput{} out.Result = output var buff [1024]byte @@ -4973,7 +4806,7 @@ func (m *awsRestjson1_deserializeOpListLenses) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLensesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetReviewTemplateAnswerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4986,7 +4819,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_deserializeOpErrorGetReviewTemplateAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5033,6 +4866,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) @@ -5049,7 +4885,7 @@ func awsRestjson1_deserializeOpErrorListLenses(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetReviewTemplateAnswerOutput(v **GetReviewTemplateAnswerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5062,27 +4898,36 @@ func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLensesOutput + var sv *GetReviewTemplateAnswerOutput if *v == nil { - sv = &ListLensesOutput{} + sv = &GetReviewTemplateAnswerOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensSummaries": - if err := awsRestjson1_deserializeDocumentLensSummaries(&sv.LensSummaries, value); err != nil { + case "Answer": + if err := awsRestjson1_deserializeDocumentReviewTemplateAnswer(&sv.Answer, value); err != nil { return err } - case "NextToken": + case "LensAlias": 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 LensAlias to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.LensAlias = ptr.String(jtv) + } + + case "TemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) } default: @@ -5094,14 +4939,14 @@ func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, va return nil } -type awsRestjson1_deserializeOpListLensReviewImprovements struct { +type awsRestjson1_deserializeOpGetReviewTemplateLensReview struct { } -func (*awsRestjson1_deserializeOpListLensReviewImprovements) ID() string { +func (*awsRestjson1_deserializeOpGetReviewTemplateLensReview) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetReviewTemplateLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5115,9 +4960,9 @@ func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListLensReviewImprovements(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetReviewTemplateLensReview(response, &metadata) } - output := &ListLensReviewImprovementsOutput{} + output := &GetReviewTemplateLensReviewOutput{} out.Result = output var buff [1024]byte @@ -5138,7 +4983,7 @@ func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetReviewTemplateLensReviewOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5151,7 +4996,7 @@ func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLensReviewImprovements(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetReviewTemplateLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5217,7 +5062,7 @@ func awsRestjson1_deserializeOpErrorListLensReviewImprovements(response *smithyh } } -func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **ListLensReviewImprovementsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetReviewTemplateLensReviewOutput(v **GetReviewTemplateLensReviewOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5230,67 +5075,27 @@ func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **List return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLensReviewImprovementsOutput + var sv *GetReviewTemplateLensReviewOutput if *v == nil { - sv = &ListLensReviewImprovementsOutput{} + sv = &GetReviewTemplateLensReviewOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ImprovementSummaries": - if err := awsRestjson1_deserializeDocumentImprovementSummaries(&sv.ImprovementSummaries, value); err != nil { + case "LensReview": + if err := awsRestjson1_deserializeDocumentReviewTemplateLensReview(&sv.LensReview, 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": + case "TemplateArn": 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 TemplateArn to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.TemplateArn = ptr.String(jtv) } default: @@ -5302,14 +5107,14 @@ func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **List return nil } -type awsRestjson1_deserializeOpListLensReviews struct { +type awsRestjson1_deserializeOpGetWorkload struct { } -func (*awsRestjson1_deserializeOpListLensReviews) ID() string { +func (*awsRestjson1_deserializeOpGetWorkload) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLensReviews) 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) @@ -5323,9 +5128,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_deserializeOpErrorGetWorkload(response, &metadata) } - output := &ListLensReviewsOutput{} + output := &GetWorkloadOutput{} out.Result = output var buff [1024]byte @@ -5346,7 +5151,7 @@ func (m *awsRestjson1_deserializeOpListLensReviews) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLensReviewsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetWorkloadOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5359,7 +5164,7 @@ func (m *awsRestjson1_deserializeOpListLensReviews) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLensReviews(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)} @@ -5425,7 +5230,7 @@ func awsRestjson1_deserializeOpErrorListLensReviews(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviewsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetWorkloadOutput(v **GetWorkloadOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5438,51 +5243,20 @@ func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviews return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLensReviewsOutput + var sv *GetWorkloadOutput if *v == nil { - sv = &ListLensReviewsOutput{} + sv = &GetWorkloadOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensReviewSummaries": - if err := awsRestjson1_deserializeDocumentLensReviewSummaries(&sv.LensReviewSummaries, value); err != nil { + case "Workload": + if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, 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) - 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 @@ -5492,14 +5266,14 @@ func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviews return nil } -type awsRestjson1_deserializeOpListLensShares struct { +type awsRestjson1_deserializeOpImportLens struct { } -func (*awsRestjson1_deserializeOpListLensShares) ID() string { +func (*awsRestjson1_deserializeOpImportLens) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLensShares) 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) @@ -5513,9 +5287,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_deserializeOpErrorImportLens(response, &metadata) } - output := &ListLensSharesOutput{} + output := &ImportLensOutput{} out.Result = output var buff [1024]byte @@ -5536,7 +5310,7 @@ func (m *awsRestjson1_deserializeOpListLensShares) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLensSharesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentImportLensOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5549,7 +5323,7 @@ func (m *awsRestjson1_deserializeOpListLensShares) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLensShares(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)} @@ -5593,12 +5367,18 @@ func awsRestjson1_deserializeOpErrorListLensShares(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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5615,7 +5395,7 @@ func awsRestjson1_deserializeOpErrorListLensShares(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentImportLensOutput(v **ImportLensOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5628,27 +5408,31 @@ func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLensSharesOutput + var sv *ImportLensOutput if *v == nil { - sv = &ListLensSharesOutput{} + sv = &ImportLensOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LensShareSummaries": - if err := awsRestjson1_deserializeDocumentLensShareSummaries(&sv.LensShareSummaries, value); err != nil { - return 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) } - case "NextToken": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ImportLensStatus to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Status = types.ImportLensStatus(jtv) } default: @@ -5660,14 +5444,14 @@ func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOu return nil } -type awsRestjson1_deserializeOpListMilestones struct { +type awsRestjson1_deserializeOpListAnswers struct { } -func (*awsRestjson1_deserializeOpListMilestones) ID() string { +func (*awsRestjson1_deserializeOpListAnswers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMilestones) 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) @@ -5681,9 +5465,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_deserializeOpErrorListAnswers(response, &metadata) } - output := &ListMilestonesOutput{} + output := &ListAnswersOutput{} out.Result = output var buff [1024]byte @@ -5704,7 +5488,7 @@ func (m *awsRestjson1_deserializeOpListMilestones) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMilestonesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAnswersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5717,7 +5501,7 @@ func (m *awsRestjson1_deserializeOpListMilestones) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMilestones(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)} @@ -5783,7 +5567,7 @@ func awsRestjson1_deserializeOpErrorListMilestones(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5796,20 +5580,51 @@ func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMilestonesOutput + var sv *ListAnswersOutput if *v == nil { - sv = &ListMilestonesOutput{} + sv = &ListAnswersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "MilestoneSummaries": - if err := awsRestjson1_deserializeDocumentMilestoneSummaries(&sv.MilestoneSummaries, 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) @@ -5837,14 +5652,14 @@ func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOu return nil } -type awsRestjson1_deserializeOpListNotifications struct { +type awsRestjson1_deserializeOpListCheckDetails struct { } -func (*awsRestjson1_deserializeOpListNotifications) ID() string { +func (*awsRestjson1_deserializeOpListCheckDetails) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListNotifications) 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) @@ -5858,9 +5673,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_deserializeOpErrorListCheckDetails(response, &metadata) } - output := &ListNotificationsOutput{} + output := &ListCheckDetailsOutput{} out.Result = output var buff [1024]byte @@ -5881,7 +5696,7 @@ func (m *awsRestjson1_deserializeOpListNotifications) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListNotificationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5894,7 +5709,7 @@ func (m *awsRestjson1_deserializeOpListNotifications) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListNotifications(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)} @@ -5941,6 +5756,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) @@ -5957,7 +5775,7 @@ func awsRestjson1_deserializeOpErrorListNotifications(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCheckDetailsOutput(v **ListCheckDetailsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5970,15 +5788,20 @@ func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListNotificationsOutput + var sv *ListCheckDetailsOutput if *v == nil { - sv = &ListNotificationsOutput{} + sv = &ListCheckDetailsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "CheckDetails": + if err := awsRestjson1_deserializeDocumentCheckDetails(&sv.CheckDetails, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -5988,11 +5811,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 @@ -6002,14 +5820,14 @@ func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificat return nil } -type awsRestjson1_deserializeOpListProfileNotifications struct { +type awsRestjson1_deserializeOpListCheckSummaries struct { } -func (*awsRestjson1_deserializeOpListProfileNotifications) ID() string { +func (*awsRestjson1_deserializeOpListCheckSummaries) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListProfileNotifications) 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) @@ -6023,9 +5841,9 @@ func (m *awsRestjson1_deserializeOpListProfileNotifications) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListProfileNotifications(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCheckSummaries(response, &metadata) } - output := &ListProfileNotificationsOutput{} + output := &ListCheckSummariesOutput{} out.Result = output var buff [1024]byte @@ -6046,7 +5864,7 @@ func (m *awsRestjson1_deserializeOpListProfileNotifications) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListProfileNotificationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6059,7 +5877,7 @@ func (m *awsRestjson1_deserializeOpListProfileNotifications) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListProfileNotifications(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)} @@ -6106,6 +5924,9 @@ func awsRestjson1_deserializeOpErrorListProfileNotifications(response *smithyhtt 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) @@ -6122,7 +5943,7 @@ func awsRestjson1_deserializeOpErrorListProfileNotifications(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListProfileNotificationsOutput(v **ListProfileNotificationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCheckSummariesOutput(v **ListCheckSummariesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6135,15 +5956,20 @@ func awsRestjson1_deserializeOpDocumentListProfileNotificationsOutput(v **ListPr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListProfileNotificationsOutput + var sv *ListCheckSummariesOutput if *v == nil { - sv = &ListProfileNotificationsOutput{} + 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) @@ -6153,11 +5979,6 @@ func awsRestjson1_deserializeOpDocumentListProfileNotificationsOutput(v **ListPr sv.NextToken = ptr.String(jtv) } - case "NotificationSummaries": - if err := awsRestjson1_deserializeDocumentProfileNotificationSummaries(&sv.NotificationSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -6167,14 +5988,14 @@ func awsRestjson1_deserializeOpDocumentListProfileNotificationsOutput(v **ListPr return nil } -type awsRestjson1_deserializeOpListProfiles struct { +type awsRestjson1_deserializeOpListLenses struct { } -func (*awsRestjson1_deserializeOpListProfiles) ID() string { +func (*awsRestjson1_deserializeOpListLenses) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListProfiles) 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) @@ -6188,9 +6009,9 @@ func (m *awsRestjson1_deserializeOpListProfiles) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListLenses(response, &metadata) } - output := &ListProfilesOutput{} + output := &ListLensesOutput{} out.Result = output var buff [1024]byte @@ -6211,7 +6032,7 @@ func (m *awsRestjson1_deserializeOpListProfiles) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLensesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6224,7 +6045,7 @@ func (m *awsRestjson1_deserializeOpListProfiles) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListProfiles(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)} @@ -6287,7 +6108,7 @@ func awsRestjson1_deserializeOpErrorListProfiles(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListProfilesOutput(v **ListProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6300,15 +6121,20 @@ func awsRestjson1_deserializeOpDocumentListProfilesOutput(v **ListProfilesOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListProfilesOutput + var sv *ListLensesOutput if *v == nil { - sv = &ListProfilesOutput{} + 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) @@ -6318,11 +6144,6 @@ func awsRestjson1_deserializeOpDocumentListProfilesOutput(v **ListProfilesOutput sv.NextToken = ptr.String(jtv) } - case "ProfileSummaries": - if err := awsRestjson1_deserializeDocumentProfileSummaries(&sv.ProfileSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -6332,14 +6153,14 @@ func awsRestjson1_deserializeOpDocumentListProfilesOutput(v **ListProfilesOutput return nil } -type awsRestjson1_deserializeOpListProfileShares struct { +type awsRestjson1_deserializeOpListLensReviewImprovements struct { } -func (*awsRestjson1_deserializeOpListProfileShares) ID() string { +func (*awsRestjson1_deserializeOpListLensReviewImprovements) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListProfileShares) 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) @@ -6353,9 +6174,9 @@ func (m *awsRestjson1_deserializeOpListProfileShares) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListProfileShares(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListLensReviewImprovements(response, &metadata) } - output := &ListProfileSharesOutput{} + output := &ListLensReviewImprovementsOutput{} out.Result = output var buff [1024]byte @@ -6376,7 +6197,7 @@ func (m *awsRestjson1_deserializeOpListProfileShares) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListProfileSharesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6389,7 +6210,7 @@ func (m *awsRestjson1_deserializeOpListProfileShares) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListProfileShares(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)} @@ -6455,7 +6276,7 @@ func awsRestjson1_deserializeOpErrorListProfileShares(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListProfileSharesOutput(v **ListProfileSharesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **ListLensReviewImprovementsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6468,30 +6289,70 @@ func awsRestjson1_deserializeOpDocumentListProfileSharesOutput(v **ListProfileSh return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListProfileSharesOutput + var sv *ListLensReviewImprovementsOutput if *v == nil { - sv = &ListProfileSharesOutput{} + sv = &ListLensReviewImprovementsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": + 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 NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected LensAlias 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 + sv.LensAlias = ptr.String(jtv) } - default: + 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 } @@ -6500,14 +6361,14 @@ func awsRestjson1_deserializeOpDocumentListProfileSharesOutput(v **ListProfileSh return nil } -type awsRestjson1_deserializeOpListShareInvitations struct { +type awsRestjson1_deserializeOpListLensReviews struct { } -func (*awsRestjson1_deserializeOpListShareInvitations) ID() string { +func (*awsRestjson1_deserializeOpListLensReviews) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListShareInvitations) 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) @@ -6521,9 +6382,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_deserializeOpErrorListLensReviews(response, &metadata) } - output := &ListShareInvitationsOutput{} + output := &ListLensReviewsOutput{} out.Result = output var buff [1024]byte @@ -6544,7 +6405,7 @@ func (m *awsRestjson1_deserializeOpListShareInvitations) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLensReviewsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6557,7 +6418,7 @@ func (m *awsRestjson1_deserializeOpListShareInvitations) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListShareInvitations(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)} @@ -6604,6 +6465,9 @@ func awsRestjson1_deserializeOpErrorListShareInvitations(response *smithyhttp.Re 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) @@ -6620,7 +6484,7 @@ func awsRestjson1_deserializeOpErrorListShareInvitations(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareInvitationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviewsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6633,15 +6497,33 @@ func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareI return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListShareInvitationsOutput + var sv *ListLensReviewsOutput if *v == nil { - sv = &ListShareInvitationsOutput{} + 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) @@ -6651,9 +6533,13 @@ func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareI sv.NextToken = ptr.String(jtv) } - case "ShareInvitationSummaries": - if err := awsRestjson1_deserializeDocumentShareInvitationSummaries(&sv.ShareInvitationSummaries, 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: @@ -6665,14 +6551,14 @@ func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareI return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListLensShares struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListLensShares) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) 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) @@ -6686,9 +6572,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_deserializeOpErrorListLensShares(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListLensSharesOutput{} out.Result = output var buff [1024]byte @@ -6709,7 +6595,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLensSharesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6722,7 +6608,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(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)} @@ -6763,12 +6649,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, @@ -6779,7 +6674,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLensSharesOutput(v **ListLensSharesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6792,20 +6687,29 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListLensSharesOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListLensSharesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "LensShareSummaries": + if err := awsRestjson1_deserializeDocumentLensShareSummaries(&sv.LensShareSummaries, 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 @@ -6815,14 +6719,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListWorkloads struct { +type awsRestjson1_deserializeOpListMilestones struct { } -func (*awsRestjson1_deserializeOpListWorkloads) ID() string { +func (*awsRestjson1_deserializeOpListMilestones) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListWorkloads) 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) @@ -6836,9 +6740,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_deserializeOpErrorListMilestones(response, &metadata) } - output := &ListWorkloadsOutput{} + output := &ListMilestonesOutput{} out.Result = output var buff [1024]byte @@ -6859,7 +6763,7 @@ func (m *awsRestjson1_deserializeOpListWorkloads) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListWorkloadsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListMilestonesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6872,7 +6776,7 @@ func (m *awsRestjson1_deserializeOpListWorkloads) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorListWorkloads(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)} @@ -6919,6 +6823,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) @@ -6935,7 +6842,7 @@ func awsRestjson1_deserializeOpErrorListWorkloads(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6948,15 +6855,20 @@ func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListWorkloadsOutput + var sv *ListMilestonesOutput if *v == nil { - sv = &ListWorkloadsOutput{} + sv = &ListMilestonesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "MilestoneSummaries": + if err := awsRestjson1_deserializeDocumentMilestoneSummaries(&sv.MilestoneSummaries, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -6966,9 +6878,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: @@ -6980,14 +6896,14 @@ func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutp return nil } -type awsRestjson1_deserializeOpListWorkloadShares struct { +type awsRestjson1_deserializeOpListNotifications struct { } -func (*awsRestjson1_deserializeOpListWorkloadShares) ID() string { +func (*awsRestjson1_deserializeOpListNotifications) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListWorkloadShares) 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) @@ -7001,9 +6917,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_deserializeOpErrorListNotifications(response, &metadata) } - output := &ListWorkloadSharesOutput{} + output := &ListNotificationsOutput{} out.Result = output var buff [1024]byte @@ -7024,7 +6940,7 @@ func (m *awsRestjson1_deserializeOpListWorkloadShares) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListNotificationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7037,7 +6953,7 @@ func (m *awsRestjson1_deserializeOpListWorkloadShares) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListWorkloadShares(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)} @@ -7084,9 +7000,6 @@ func awsRestjson1_deserializeOpErrorListWorkloadShares(response *smithyhttp.Resp case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -7103,7 +7016,7 @@ func awsRestjson1_deserializeOpErrorListWorkloadShares(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkloadSharesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7116,9 +7029,9 @@ func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkload return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListWorkloadSharesOutput + var sv *ListNotificationsOutput if *v == nil { - sv = &ListWorkloadSharesOutput{} + sv = &ListNotificationsOutput{} } else { sv = *v } @@ -7134,17 +7047,8 @@ 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 { + case "NotificationSummaries": + if err := awsRestjson1_deserializeDocumentNotificationSummaries(&sv.NotificationSummaries, value); err != nil { return err } @@ -7157,14 +7061,14 @@ func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkload return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListProfileNotifications struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListProfileNotifications) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) 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) @@ -7178,15 +7082,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_deserializeOpErrorListProfileNotifications(response, &metadata) } - output := &TagResourceOutput{} + output := &ListProfileNotificationsOutput{} 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_deserializeOpDocumentListProfileNotificationsOutput(&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_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)} @@ -7227,13 +7159,19 @@ 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) - default: + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -7243,14 +7181,59 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource 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_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpListProfiles struct { +} + +func (*awsRestjson1_deserializeOpListProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) 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) @@ -7264,15 +7247,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_deserializeOpErrorListProfiles(response, &metadata) } - output := &UntagResourceOutput{} + output := &ListProfilesOutput{} 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_deserializeOpDocumentListProfilesOutput(&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_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)} @@ -7313,11 +7324,17 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7329,14 +7346,59 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateAnswer struct { +func awsRestjson1_deserializeOpDocumentListProfilesOutput(v **ListProfilesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListProfilesOutput + if *v == nil { + sv = &ListProfilesOutput{} + } 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 "ProfileSummaries": + if err := awsRestjson1_deserializeDocumentProfileSummaries(&sv.ProfileSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateAnswer) ID() string { +type awsRestjson1_deserializeOpListProfileShares struct { +} + +func (*awsRestjson1_deserializeOpListProfileShares) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAnswer) 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) @@ -7350,9 +7412,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_deserializeOpErrorListProfileShares(response, &metadata) } - output := &UpdateAnswerOutput{} + output := &ListProfileSharesOutput{} out.Result = output var buff [1024]byte @@ -7373,7 +7435,7 @@ func (m *awsRestjson1_deserializeOpUpdateAnswer) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListProfileSharesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7386,7 +7448,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_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)} @@ -7430,9 +7492,6 @@ 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) @@ -7455,7 +7514,7 @@ func awsRestjson1_deserializeOpErrorUpdateAnswer(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListProfileSharesOutput(v **ListProfileSharesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7468,45 +7527,27 @@ func awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAnswerOutput + var sv *ListProfileSharesOutput if *v == nil { - sv = &UpdateAnswerOutput{} + sv = &ListProfileSharesOutput{} } 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 "ProfileShareSummaries": + if err := awsRestjson1_deserializeDocumentProfileShareSummaries(&sv.ProfileShareSummaries, value); err != nil { + return err } default: @@ -7518,14 +7559,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput return nil } -type awsRestjson1_deserializeOpUpdateGlobalSettings struct { +type awsRestjson1_deserializeOpListReviewTemplateAnswers struct { } -func (*awsRestjson1_deserializeOpUpdateGlobalSettings) ID() string { +func (*awsRestjson1_deserializeOpListReviewTemplateAnswers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateGlobalSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListReviewTemplateAnswers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7539,21 +7580,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_deserializeOpErrorListReviewTemplateAnswers(response, &metadata) } - output := &UpdateGlobalSettingsOutput{} + output := &ListReviewTemplateAnswersOutput{} 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_deserializeOpDocumentListReviewTemplateAnswersOutput(&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_deserializeOpErrorListReviewTemplateAnswers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7597,12 +7660,12 @@ 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) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -7619,30 +7682,93 @@ func awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response *smithyhttp.Re } } -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 +func awsRestjson1_deserializeOpDocumentListReviewTemplateAnswersOutput(v **ListReviewTemplateAnswersOutput, 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) + } + + var sv *ListReviewTemplateAnswersOutput + if *v == nil { + sv = &ListReviewTemplateAnswersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AnswerSummaries": + if err := awsRestjson1_deserializeDocumentReviewTemplateAnswerSummaries(&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 "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 "TemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListReviewTemplates struct { +} + +func (*awsRestjson1_deserializeOpListReviewTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListReviewTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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) + return out, metadata, awsRestjson1_deserializeOpErrorListReviewTemplates(response, &metadata) } - output := &UpdateLensReviewOutput{} + output := &ListReviewTemplatesOutput{} out.Result = output var buff [1024]byte @@ -7663,7 +7789,7 @@ func (m *awsRestjson1_deserializeOpUpdateLensReview) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListReviewTemplatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7676,7 +7802,7 @@ func (m *awsRestjson1_deserializeOpUpdateLensReview) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListReviewTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7720,15 +7846,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) @@ -7745,7 +7865,7 @@ func awsRestjson1_deserializeOpErrorUpdateLensReview(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(v **UpdateLensReviewOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListReviewTemplatesOutput(v **ListReviewTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7758,27 +7878,27 @@ func awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(v **UpdateLensRevi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateLensReviewOutput + var sv *ListReviewTemplatesOutput if *v == nil { - sv = &UpdateLensReviewOutput{} + sv = &ListReviewTemplatesOutput{} } 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 "ReviewTemplates": + if err := awsRestjson1_deserializeDocumentReviewTemplates(&sv.ReviewTemplates, value); err != nil { + return err } default: @@ -7790,14 +7910,14 @@ func awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(v **UpdateLensRevi return nil } -type awsRestjson1_deserializeOpUpdateProfile struct { +type awsRestjson1_deserializeOpListShareInvitations struct { } -func (*awsRestjson1_deserializeOpUpdateProfile) ID() string { +func (*awsRestjson1_deserializeOpListShareInvitations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateProfile) 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) @@ -7811,9 +7931,9 @@ func (m *awsRestjson1_deserializeOpUpdateProfile) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListShareInvitations(response, &metadata) } - output := &UpdateProfileOutput{} + output := &ListShareInvitationsOutput{} out.Result = output var buff [1024]byte @@ -7834,7 +7954,7 @@ func (m *awsRestjson1_deserializeOpUpdateProfile) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7847,7 +7967,7 @@ func (m *awsRestjson1_deserializeOpUpdateProfile) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateProfile(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)} @@ -7891,15 +8011,9 @@ func awsRestjson1_deserializeOpErrorUpdateProfile(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) @@ -7916,7 +8030,7 @@ func awsRestjson1_deserializeOpErrorUpdateProfile(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateProfileOutput(v **UpdateProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7929,17 +8043,26 @@ func awsRestjson1_deserializeOpDocumentUpdateProfileOutput(v **UpdateProfileOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateProfileOutput + var sv *ListShareInvitationsOutput if *v == nil { - sv = &UpdateProfileOutput{} + sv = &ListShareInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Profile": - if err := awsRestjson1_deserializeDocumentProfile(&sv.Profile, 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 } @@ -7952,14 +8075,14 @@ func awsRestjson1_deserializeOpDocumentUpdateProfileOutput(v **UpdateProfileOutp return nil } -type awsRestjson1_deserializeOpUpdateShareInvitation struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpUpdateShareInvitation) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateShareInvitation) 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) @@ -7973,9 +8096,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_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UpdateShareInvitationOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -7996,7 +8119,7 @@ func (m *awsRestjson1_deserializeOpUpdateShareInvitation) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateShareInvitationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8009,7 +8132,7 @@ func (m *awsRestjson1_deserializeOpUpdateShareInvitation) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateShareInvitation(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)} @@ -8050,24 +8173,12 @@ func awsRestjson1_deserializeOpErrorUpdateShareInvitation(response *smithyhttp.R } 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, @@ -8078,7 +8189,7 @@ func awsRestjson1_deserializeOpErrorUpdateShareInvitation(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentUpdateShareInvitationOutput(v **UpdateShareInvitationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8091,17 +8202,17 @@ func awsRestjson1_deserializeOpDocumentUpdateShareInvitationOutput(v **UpdateSha return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateShareInvitationOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &UpdateShareInvitationOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ShareInvitation": - if err := awsRestjson1_deserializeDocumentShareInvitation(&sv.ShareInvitation, value); err != nil { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } @@ -8114,14 +8225,14 @@ func awsRestjson1_deserializeOpDocumentUpdateShareInvitationOutput(v **UpdateSha return nil } -type awsRestjson1_deserializeOpUpdateWorkload struct { +type awsRestjson1_deserializeOpListTemplateShares struct { } -func (*awsRestjson1_deserializeOpUpdateWorkload) ID() string { +func (*awsRestjson1_deserializeOpListTemplateShares) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTemplateShares) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8135,9 +8246,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_deserializeOpErrorListTemplateShares(response, &metadata) } - output := &UpdateWorkloadOutput{} + output := &ListTemplateSharesOutput{} out.Result = output var buff [1024]byte @@ -8158,7 +8269,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTemplateSharesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8171,7 +8282,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTemplateShares(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8215,9 +8326,6 @@ 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) @@ -8240,7 +8348,7 @@ func awsRestjson1_deserializeOpErrorUpdateWorkload(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(v **UpdateWorkloadOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTemplateSharesOutput(v **ListTemplateSharesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8253,17 +8361,35 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(v **UpdateWorkloadOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateWorkloadOutput + var sv *ListTemplateSharesOutput if *v == nil { - sv = &UpdateWorkloadOutput{} + sv = &ListTemplateSharesOutput{} } 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 "TemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + case "TemplateShareSummaries": + if err := awsRestjson1_deserializeDocumentTemplateShareSummaries(&sv.TemplateShareSummaries, value); err != nil { return err } @@ -8276,14 +8402,14 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(v **UpdateWorkloadOu return nil } -type awsRestjson1_deserializeOpUpdateWorkloadShare struct { +type awsRestjson1_deserializeOpListWorkloads struct { } -func (*awsRestjson1_deserializeOpUpdateWorkloadShare) ID() string { +func (*awsRestjson1_deserializeOpListWorkloads) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) 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) @@ -8297,9 +8423,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_deserializeOpErrorListWorkloads(response, &metadata) } - output := &UpdateWorkloadShareOutput{} + output := &ListWorkloadsOutput{} out.Result = output var buff [1024]byte @@ -8320,7 +8446,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListWorkloadsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8333,7 +8459,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateWorkloadShare(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)} @@ -8377,15 +8503,9 @@ func awsRestjson1_deserializeOpErrorUpdateWorkloadShare(response *smithyhttp.Res 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) @@ -8402,7 +8522,7 @@ func awsRestjson1_deserializeOpErrorUpdateWorkloadShare(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(v **UpdateWorkloadShareOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8415,26 +8535,26 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(v **UpdateWorkl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateWorkloadShareOutput + var sv *ListWorkloadsOutput if *v == nil { - sv = &UpdateWorkloadShareOutput{} + sv = &ListWorkloadsOutput{} } else { sv = *v } for key, value := range shape { switch key { - 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 "WorkloadShare": - if err := awsRestjson1_deserializeDocumentWorkloadShare(&sv.WorkloadShare, value); err != nil { + case "WorkloadSummaries": + if err := awsRestjson1_deserializeDocumentWorkloadSummaries(&sv.WorkloadSummaries, value); err != nil { return err } @@ -8447,14 +8567,14 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(v **UpdateWorkl return nil } -type awsRestjson1_deserializeOpUpgradeLensReview struct { +type awsRestjson1_deserializeOpListWorkloadShares struct { } -func (*awsRestjson1_deserializeOpUpgradeLensReview) ID() string { +func (*awsRestjson1_deserializeOpListWorkloadShares) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpgradeLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -8468,26 +8588,48 @@ 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_deserializeOpErrorListWorkloadShares(response, &metadata) } - output := &UpgradeLensReviewOutput{} + output := &ListWorkloadSharesOutput{} 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 -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -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()) + 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_deserializeOpDocumentListWorkloadSharesOutput(&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_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 @@ -8526,9 +8668,6 @@ 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) @@ -8551,14 +8690,68 @@ func awsRestjson1_deserializeOpErrorUpgradeLensReview(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpUpgradeProfileVersion struct { +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 + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListWorkloadSharesOutput + if *v == nil { + sv = &ListWorkloadSharesOutput{} + } 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 "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 + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpgradeProfileVersion) ID() string { +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpgradeProfileVersion) 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) @@ -8572,21 +8765,15 @@ func (m *awsRestjson1_deserializeOpUpgradeProfileVersion) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpgradeProfileVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } - output := &UpgradeProfileVersionOutput{} + output := &TagResourceOutput{} 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 { +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)} @@ -8627,24 +8814,12 @@ func awsRestjson1_deserializeOpErrorUpgradeProfileVersion(response *smithyhttp.R } 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, @@ -8655,52 +8830,58 @@ func awsRestjson1_deserializeOpErrorUpgradeProfileVersion(response *smithyhttp.R } } -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_deserializeOpUntagResource struct { +} - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) +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 { - var snapshot 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_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err } -func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} +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{ @@ -8710,29 +8891,62 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons return err } - err := awsRestjson1_deserializeDocumentConflictException(&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_deserializeOpUpdateAnswer struct { +} - return output +func (*awsRestjson1_deserializeOpUpdateAnswer) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} +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(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -8743,83 +8957,44 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(&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_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 +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()) - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + errorCode := "UnknownError" + errorMessage := errorCode - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - 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) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8831,83 +9006,43 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy } 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 + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - - 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 + 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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) -func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ValidationException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(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(), - } - return err - } + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - if err != nil { - var snapshot 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 strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) - errorBody.Seek(0, io.SeekStart) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError - return output + } } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8920,22 +9055,45 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *UpdateAnswerOutput if *v == nil { - sv = &types.AccessDeniedException{} + sv = &UpdateAnswerOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + 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 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 "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: @@ -8947,80 +9105,2891 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie 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 +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 } - 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 mv map[string]int32 - if *v == nil { - mv = map[string]int32{} - } else { - mv = *v + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response, &metadata) } + output := &UpdateGlobalSettingsOutput{} + out.Result = output - 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) + 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), } - 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 - } + return out, metadata, err +} - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) +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_deserializeOpUpdateReviewTemplate struct { +} + +func (*awsRestjson1_deserializeOpUpdateReviewTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateReviewTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateReviewTemplate(response, &metadata) + } + output := &UpdateReviewTemplateOutput{} + 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_deserializeOpDocumentUpdateReviewTemplateOutput(&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_deserializeOpErrorUpdateReviewTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(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_deserializeOpDocumentUpdateReviewTemplateOutput(v **UpdateReviewTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateReviewTemplateOutput + if *v == nil { + sv = &UpdateReviewTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ReviewTemplate": + if err := awsRestjson1_deserializeDocumentReviewTemplate(&sv.ReviewTemplate, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateReviewTemplateAnswer struct { +} + +func (*awsRestjson1_deserializeOpUpdateReviewTemplateAnswer) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateReviewTemplateAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateReviewTemplateAnswer(response, &metadata) + } + output := &UpdateReviewTemplateAnswerOutput{} + 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_deserializeOpDocumentUpdateReviewTemplateAnswerOutput(&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_deserializeOpErrorUpdateReviewTemplateAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(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_deserializeOpDocumentUpdateReviewTemplateAnswerOutput(v **UpdateReviewTemplateAnswerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateReviewTemplateAnswerOutput + if *v == nil { + sv = &UpdateReviewTemplateAnswerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Answer": + if err := awsRestjson1_deserializeDocumentReviewTemplateAnswer(&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 "TemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateReviewTemplateLensReview struct { +} + +func (*awsRestjson1_deserializeOpUpdateReviewTemplateLensReview) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateReviewTemplateLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateReviewTemplateLensReview(response, &metadata) + } + output := &UpdateReviewTemplateLensReviewOutput{} + 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_deserializeOpDocumentUpdateReviewTemplateLensReviewOutput(&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_deserializeOpErrorUpdateReviewTemplateLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(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_deserializeOpDocumentUpdateReviewTemplateLensReviewOutput(v **UpdateReviewTemplateLensReviewOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateReviewTemplateLensReviewOutput + if *v == nil { + sv = &UpdateReviewTemplateLensReviewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensReview": + if err := awsRestjson1_deserializeDocumentReviewTemplateLensReview(&sv.LensReview, value); err != nil { + return err + } + + case "TemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + 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 + + } +} + +type awsRestjson1_deserializeOpUpgradeReviewTemplateLensReview struct { +} + +func (*awsRestjson1_deserializeOpUpgradeReviewTemplateLensReview) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpgradeReviewTemplateLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpgradeReviewTemplateLensReview(response, &metadata) + } + output := &UpgradeReviewTemplateLensReviewOutput{} + 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_deserializeOpErrorUpgradeReviewTemplateLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(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{} + 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) + } + + 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) + } + + 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) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCheckDetails(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.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.CheckDetail + if *v == nil { + cv = []types.CheckDetail{} + } else { + cv = *v + } + + 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 = cv + return nil +} + +func awsRestjson1_deserializeDocumentCheckSummaries(v *[]types.CheckSummary, 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.CheckSummary + if *v == nil { + cv = []types.CheckSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CheckSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentCheckSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCheckSummary(v **types.CheckSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CheckSummary + if *v == nil { + 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: @@ -9032,41 +12001,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) } @@ -9079,127 +12014,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: @@ -9211,7 +12141,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) } @@ -9224,17 +12154,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 @@ -9245,7 +12175,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) } @@ -9258,91 +12222,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 "IsApplicable": + case "ChoiceId": 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 ChoiceId to be of type string, got %T instead", value) } - sv.IsApplicable = jtv + sv.ChoiceId = ptr.String(jtv) } - case "PillarId": + case "Reason": 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 ChoiceReason to be of type string, got %T instead", value) } - sv.PillarId = ptr.String(jtv) + sv.Reason = types.ChoiceReason(jtv) } - case "QuestionId": + case "Status": 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 ChoiceStatus to be of type string, got %T instead", value) } - sv.QuestionId = ptr.String(jtv) + sv.Status = types.ChoiceStatus(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) - } + 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 "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) - } + 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: @@ -9354,7 +12316,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) } @@ -9367,9 +12329,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 } @@ -9385,13 +12347,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: @@ -9403,7 +12374,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) } @@ -9416,17 +12387,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 @@ -9437,7 +12408,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) } @@ -9450,141 +12455,146 @@ 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": + 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 + } + + case "LensesAppliedCount": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected FlaggedResources to be json.Number, got %T instead", value) + return fmt.Errorf("expected LensesAppliedCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.FlaggedResources = int32(i64) + sv.LensesAppliedCount = int32(i64) } - case "Id": + case "MetricType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CheckId to be of type string, got %T instead", value) + return fmt.Errorf("expected MetricType to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.MetricType = types.MetricType(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 "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err } - case "Name": + case "UpdatedAt": 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) - } + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - 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: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - 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": + case "WorkloadArn": 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 WorkloadArn to be of type string, got %T instead", value) } - sv.QuestionId = ptr.String(jtv) + sv.WorkloadArn = ptr.String(jtv) } - case "Reason": + case "WorkloadId": 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 WorkloadId to be of type string, got %T instead", value) } - sv.Reason = types.CheckFailureReason(jtv) + sv.WorkloadId = ptr.String(jtv) } - case "Status": + case "WorkloadName": 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) - + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) } + sv.WorkloadName = ptr.String(jtv) } default: @@ -9596,7 +12606,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) } @@ -9609,17 +12619,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 @@ -9630,7 +12640,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) } @@ -9643,17 +12653,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 @@ -9664,7 +12674,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) } @@ -9677,63 +12687,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": @@ -9745,15 +12719,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) @@ -9763,29 +12728,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: @@ -9797,7 +12755,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) } @@ -9810,55 +12768,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: @@ -9870,7 +12795,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) } @@ -9883,49 +12808,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: @@ -9937,7 +12885,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) } @@ -9945,33 +12893,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) } @@ -9984,17 +12948,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 @@ -10005,7 +12969,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) } @@ -10018,89 +12982,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: @@ -10112,7 +13099,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) } @@ -10125,40 +13112,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: @@ -10170,41 +13157,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) } @@ -10217,17 +13170,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 @@ -10238,7 +13191,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) } @@ -10251,98 +13204,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": @@ -10366,33 +13289,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 @@ -10402,7 +13298,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) } @@ -10415,17 +13311,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 @@ -10436,7 +13332,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) } @@ -10449,17 +13412,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 @@ -10470,7 +13433,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) } @@ -10483,103 +13446,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: @@ -10591,7 +13568,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) } @@ -10604,22 +13581,40 @@ 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 "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": @@ -10631,45 +13626,40 @@ func awsRestjson1_deserializeDocumentLens(v **types.Lens, value interface{}) err sv.LensArn = ptr.String(jtv) } - case "LensVersion": + case "ResourceArn": 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 ResourceArn to be of type string, got %T instead", value) } - sv.LensVersion = ptr.String(jtv) + sv.ResourceArn = ptr.String(jtv) } - case "Name": + case "ResourceName": 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 WorkloadName to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.ResourceName = 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: @@ -10681,7 +13671,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) } @@ -10694,31 +13684,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 } @@ -10731,7 +13745,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) } @@ -10744,17 +13758,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 @@ -10765,7 +13779,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) } @@ -10778,99 +13792,38 @@ 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": - 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": - 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) - } - - case "LensVersion": + case "MilestoneName": 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 MilestoneName to be of type string, got %T instead", value) } - sv.LensVersion = ptr.String(jtv) + sv.MilestoneName = ptr.String(jtv) } - case "NextToken": + case "MilestoneNumber": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) } - sv.NextToken = ptr.String(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) + i64, err := jtv.Int64() + if err != nil { + return err } - 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 + sv.MilestoneNumber = int32(i64) } - case "UpdatedAt": + case "RecordedAt": if value != nil { switch jtv := value.(type) { case json.Number: @@ -10878,7 +13831,7 @@ func awsRestjson1_deserializeDocumentLensReview(v **types.LensReview, value inte if err != nil { return err } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.RecordedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -10886,62 +13839,9 @@ func awsRestjson1_deserializeDocumentLensReview(v **types.LensReview, value inte } } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentLensReviewReport(v **types.LensReviewReport, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.LensReviewReport - if *v == nil { - sv = &types.LensReviewReport{} - } 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 "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 "WorkloadSummary": + if err := awsRestjson1_deserializeDocumentWorkloadSummary(&sv.WorkloadSummary, value); err != nil { + return err } default: @@ -10953,7 +13853,7 @@ func awsRestjson1_deserializeDocumentLensReviewReport(v **types.LensReviewReport return nil } -func awsRestjson1_deserializeDocumentLensReviewSummaries(v *[]types.LensReviewSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.NotificationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10966,17 +13866,17 @@ func awsRestjson1_deserializeDocumentLensReviewSummaries(v *[]types.LensReviewSu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LensReviewSummary + var cv []types.NotificationSummary if *v == nil { - cv = []types.LensReviewSummary{} + cv = []types.NotificationSummary{} } else { cv = *v } for _, value := range shape { - var col types.LensReviewSummary + var col types.NotificationSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentLensReviewSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentNotificationSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -10987,7 +13887,7 @@ func awsRestjson1_deserializeDocumentLensReviewSummaries(v *[]types.LensReviewSu return nil } -func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentNotificationSummary(v **types.NotificationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11000,91 +13900,92 @@ func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSumma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensReviewSummary + var sv *types.NotificationSummary if *v == nil { - sv = &types.LensReviewSummary{} + sv = &types.NotificationSummary{} } 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 "LensUpgradeSummary": + if err := awsRestjson1_deserializeDocumentLensUpgradeSummary(&sv.LensUpgradeSummary, value); err != nil { + return err } - case "LensArn": + case "Type": 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 NotificationType to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.Type = types.NotificationType(jtv) } - case "LensName": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PillarDifference + if *v == nil { + sv = &types.PillarDifference{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DifferenceStatus": 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 DifferenceStatus to be of type string, got %T instead", value) } - sv.LensName = ptr.String(jtv) + sv.DifferenceStatus = types.DifferenceStatus(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": + case "PillarName": 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 PillarName to be of type string, got %T instead", value) } - 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 + sv.PillarName = ptr.String(jtv) } - case "RiskCounts": - if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + case "QuestionDifferences": + if err := awsRestjson1_deserializeDocumentQuestionDifferences(&sv.QuestionDifferences, 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 @@ -11094,7 +13995,7 @@ func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSumma return nil } -func awsRestjson1_deserializeDocumentLensShareSummaries(v *[]types.LensShareSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11107,17 +14008,17 @@ func awsRestjson1_deserializeDocumentLensShareSummaries(v *[]types.LensShareSumm return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LensShareSummary + var cv []types.PillarDifference if *v == nil { - cv = []types.LensShareSummary{} + cv = []types.PillarDifference{} } else { cv = *v } for _, value := range shape { - var col types.LensShareSummary + var col types.PillarDifference destAddr := &col - if err := awsRestjson1_deserializeDocumentLensShareSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentPillarDifference(&destAddr, value); err != nil { return err } col = *destAddr @@ -11128,7 +14029,7 @@ func awsRestjson1_deserializeDocumentLensShareSummaries(v *[]types.LensShareSumm return nil } -func awsRestjson1_deserializeDocumentLensShareSummary(v **types.LensShareSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarMetric(v **types.PillarMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11141,49 +14042,32 @@ func awsRestjson1_deserializeDocumentLensShareSummary(v **types.LensShareSummary return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensShareSummary + var sv *types.PillarMetric if *v == nil { - sv = &types.LensShareSummary{} + sv = &types.PillarMetric{} } 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": + 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": - 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 "Questions": + if err := awsRestjson1_deserializeDocumentQuestionMetrics(&sv.Questions, 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) + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err } default: @@ -11195,7 +14079,7 @@ func awsRestjson1_deserializeDocumentLensShareSummary(v **types.LensShareSummary return nil } -func awsRestjson1_deserializeDocumentLensSummaries(v *[]types.LensSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarMetrics(v *[]types.PillarMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11208,17 +14092,17 @@ func awsRestjson1_deserializeDocumentLensSummaries(v *[]types.LensSummary, value return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LensSummary + var cv []types.PillarMetric if *v == nil { - cv = []types.LensSummary{} + cv = []types.PillarMetric{} } else { cv = *v } for _, value := range shape { - var col types.LensSummary + var col types.PillarMetric destAddr := &col - if err := awsRestjson1_deserializeDocumentLensSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentPillarMetric(&destAddr, value); err != nil { return err } col = *destAddr @@ -11229,7 +14113,7 @@ func awsRestjson1_deserializeDocumentLensSummaries(v *[]types.LensSummary, value return nil } -func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarReviewSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11237,122 +14121,89 @@ func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value in 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.LensSummary + var cv []types.PillarReviewSummary if *v == nil { - sv = &types.LensSummary{} + cv = []types.PillarReviewSummary{} } else { - sv = *v + cv = *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) - - } - } + 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) - 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) - } + } + *v = cv + return nil +} - 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) - } +func awsRestjson1_deserializeDocumentPillarReviewSummary(v **types.PillarReviewSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + 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) - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - 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) - } + var sv *types.PillarReviewSummary + if *v == nil { + sv = &types.PillarReviewSummary{} + } else { + sv = *v + } - case "LensStatus": + for key, value := range shape { + switch key { + case "Notes": 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 Notes to be of type string, got %T instead", value) } - sv.LensStatus = types.LensStatus(jtv) + sv.Notes = ptr.String(jtv) } - case "LensType": + case "PillarId": 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 PillarId to be of type string, got %T instead", value) } - sv.LensType = types.LensType(jtv) + sv.PillarId = ptr.String(jtv) } - case "LensVersion": + case "PillarName": 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 PillarName to be of type string, got %T instead", value) } - sv.LensVersion = ptr.String(jtv) + sv.PillarName = ptr.String(jtv) } - case "Owner": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) - } - sv.Owner = ptr.String(jtv) + case "PrioritizedRiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.PrioritizedRiskCounts, 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) - - } + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err } default: @@ -11364,7 +14215,7 @@ func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value in return nil } -func awsRestjson1_deserializeDocumentLensUpgradeSummary(v **types.LensUpgradeSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11377,123 +14228,96 @@ func awsRestjson1_deserializeDocumentLensUpgradeSummary(v **types.LensUpgradeSum return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LensUpgradeSummary + var sv *types.Profile if *v == nil { - sv = &types.LensUpgradeSummary{} + sv = &types.Profile{} } else { sv = *v } for key, value := range shape { switch key { - case "CurrentLensVersion": + case "CreatedAt": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.CurrentLensVersion = ptr.String(jtv) } - case "LatestLensVersion": + case "Owner": 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 AwsAccountId to be of type string, got %T instead", value) } - sv.LatestLensVersion = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "LensAlias": + case "ProfileArn": 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 ProfileArn to be of type string, got %T instead", value) } - sv.LensAlias = ptr.String(jtv) + sv.ProfileArn = ptr.String(jtv) } - case "LensArn": + case "ProfileDescription": 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 ProfileDescription to be of type string, got %T instead", value) } - sv.LensArn = ptr.String(jtv) + sv.ProfileDescription = ptr.String(jtv) } - case "WorkloadId": + case "ProfileName": 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 ProfileName to be of type string, got %T instead", value) } - sv.WorkloadId = ptr.String(jtv) + sv.ProfileName = ptr.String(jtv) } - case "WorkloadName": + 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 WorkloadName to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) } - sv.WorkloadName = ptr.String(jtv) + sv.ProfileVersion = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentMilestone(v **types.Milestone, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Milestone - if *v == nil { - sv = &types.Milestone{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "MilestoneName": + case "ShareInvitationId": 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 ShareInvitationId to be of type string, got %T instead", value) } - sv.MilestoneName = ptr.String(jtv) + sv.ShareInvitationId = 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 "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } - case "RecordedAt": + case "UpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: @@ -11501,7 +14325,7 @@ func awsRestjson1_deserializeDocumentMilestone(v **types.Milestone, value interf if err != nil { return err } - sv.RecordedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -11509,11 +14333,6 @@ func awsRestjson1_deserializeDocumentMilestone(v **types.Milestone, value interf } } - case "Workload": - if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { - return err - } - default: _, _ = key, value @@ -11523,41 +14342,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_deserializeDocumentProfileChoice(v **types.ProfileChoice, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11570,56 +14355,40 @@ func awsRestjson1_deserializeDocumentMilestoneSummary(v **types.MilestoneSummary return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MilestoneSummary + var sv *types.ProfileChoice if *v == nil { - sv = &types.MilestoneSummary{} + sv = &types.ProfileChoice{} } else { sv = *v } for key, value := range shape { switch key { - case "MilestoneName": + case "ChoiceDescription": 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 ChoiceDescription to be of type string, got %T instead", value) } - sv.MilestoneName = ptr.String(jtv) + sv.ChoiceDescription = ptr.String(jtv) } - case "MilestoneNumber": + case "ChoiceId": 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 ChoiceId to be of type string, got %T instead", value) } - sv.MilestoneNumber = int32(i64) + sv.ChoiceId = ptr.String(jtv) } - case "RecordedAt": + case "ChoiceTitle": 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) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) } - } - - case "WorkloadSummary": - if err := awsRestjson1_deserializeDocumentWorkloadSummary(&sv.WorkloadSummary, value); err != nil { - return err + sv.ChoiceTitle = ptr.String(jtv) } default: @@ -11631,7 +14400,7 @@ func awsRestjson1_deserializeDocumentMilestoneSummary(v **types.MilestoneSummary return nil } -func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.NotificationSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileNotificationSummaries(v *[]types.ProfileNotificationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11644,17 +14413,17 @@ func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.Notificati return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.NotificationSummary + var cv []types.ProfileNotificationSummary if *v == nil { - cv = []types.NotificationSummary{} + cv = []types.ProfileNotificationSummary{} } else { cv = *v } for _, value := range shape { - var col types.NotificationSummary + var col types.ProfileNotificationSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentNotificationSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentProfileNotificationSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -11665,7 +14434,7 @@ func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.Notificati return nil } -func awsRestjson1_deserializeDocumentNotificationSummary(v **types.NotificationSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileNotificationSummary(v **types.ProfileNotificationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11678,27 +14447,76 @@ func awsRestjson1_deserializeDocumentNotificationSummary(v **types.NotificationS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.NotificationSummary + var sv *types.ProfileNotificationSummary if *v == nil { - sv = &types.NotificationSummary{} + sv = &types.ProfileNotificationSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "LensUpgradeSummary": - if err := awsRestjson1_deserializeDocumentLensUpgradeSummary(&sv.LensUpgradeSummary, value); err != nil { - return err + case "CurrentProfileVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) + } + sv.CurrentProfileVersion = ptr.String(jtv) + } + + case "LatestProfileVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) + } + 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.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 "Type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NotificationType to be of type string, got %T instead", value) + return fmt.Errorf("expected ProfileNotificationType to be of type string, got %T instead", value) } - sv.Type = types.NotificationType(jtv) + 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 "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: @@ -11710,7 +14528,7 @@ func awsRestjson1_deserializeDocumentNotificationSummary(v **types.NotificationS return nil } -func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileQuestion(v **types.ProfileQuestion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11723,44 +14541,75 @@ func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PillarDifference + var sv *types.ProfileQuestion if *v == nil { - sv = &types.PillarDifference{} + sv = &types.ProfileQuestion{} } else { sv = *v } for key, value := range shape { switch key { - case "DifferenceStatus": + case "MaxSelectedChoices": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaxSelectedProfileChoices to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxSelectedChoices = int32(i64) + } + + 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_deserializeDocumentProfileQuestionChoices(&sv.QuestionChoices, value); err != nil { + return err + } + + case "QuestionDescription": 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 QuestionDescription to be of type string, got %T instead", value) } - sv.DifferenceStatus = types.DifferenceStatus(jtv) + sv.QuestionDescription = ptr.String(jtv) } - case "PillarId": + case "QuestionId": 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 QuestionId to be of type string, got %T instead", value) } - sv.PillarId = ptr.String(jtv) + sv.QuestionId = ptr.String(jtv) } - case "PillarName": + case "QuestionTitle": 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 QuestionTitle to be of type string, got %T instead", value) } - sv.PillarName = ptr.String(jtv) + sv.QuestionTitle = ptr.String(jtv) } - case "QuestionDifferences": - if err := awsRestjson1_deserializeDocumentQuestionDifferences(&sv.QuestionDifferences, value); err != nil { + case "SelectedChoiceIds": + if err := awsRestjson1_deserializeDocumentSelectedChoiceIds(&sv.SelectedChoiceIds, value); err != nil { return err } @@ -11773,7 +14622,7 @@ func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference return nil } -func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifference, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileQuestionChoices(v *[]types.ProfileChoice, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11786,17 +14635,17 @@ func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifferen return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PillarDifference + var cv []types.ProfileChoice if *v == nil { - cv = []types.PillarDifference{} + cv = []types.ProfileChoice{} } else { cv = *v } for _, value := range shape { - var col types.PillarDifference + var col types.ProfileChoice destAddr := &col - if err := awsRestjson1_deserializeDocumentPillarDifference(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentProfileChoice(&destAddr, value); err != nil { return err } col = *destAddr @@ -11807,57 +14656,7 @@ func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifferen return nil } -func awsRestjson1_deserializeDocumentPillarMetric(v **types.PillarMetric, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PillarMetric - if *v == nil { - sv = &types.PillarMetric{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - 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 "Questions": - if err := awsRestjson1_deserializeDocumentQuestionMetrics(&sv.Questions, value); err != nil { - return err - } - - case "RiskCounts": - if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPillarMetrics(v *[]types.PillarMetric, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileQuestions(v *[]types.ProfileQuestion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11870,17 +14669,17 @@ func awsRestjson1_deserializeDocumentPillarMetrics(v *[]types.PillarMetric, valu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PillarMetric + var cv []types.ProfileQuestion if *v == nil { - cv = []types.PillarMetric{} + cv = []types.ProfileQuestion{} } else { cv = *v } for _, value := range shape { - var col types.PillarMetric + var col types.ProfileQuestion destAddr := &col - if err := awsRestjson1_deserializeDocumentPillarMetric(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentProfileQuestion(&destAddr, value); err != nil { return err } col = *destAddr @@ -11891,7 +14690,7 @@ func awsRestjson1_deserializeDocumentPillarMetrics(v *[]types.PillarMetric, valu return nil } -func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarReviewSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileShareSummaries(v *[]types.ProfileShareSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11904,17 +14703,17 @@ func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarRevi return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PillarReviewSummary + var cv []types.ProfileShareSummary if *v == nil { - cv = []types.PillarReviewSummary{} + cv = []types.ProfileShareSummary{} } else { cv = *v } for _, value := range shape { - var col types.PillarReviewSummary + var col types.ProfileShareSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentPillarReviewSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentProfileShareSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -11925,7 +14724,7 @@ func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarRevi return nil } -func awsRestjson1_deserializeDocumentPillarReviewSummary(v **types.PillarReviewSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileShareSummary(v **types.ProfileShareSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11938,62 +14737,95 @@ func awsRestjson1_deserializeDocumentPillarReviewSummary(v **types.PillarReviewS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PillarReviewSummary + var sv *types.ProfileShareSummary if *v == nil { - sv = &types.PillarReviewSummary{} + sv = &types.ProfileShareSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "Notes": + case "SharedWith": 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 SharedWith to be of type string, got %T instead", value) } - sv.Notes = ptr.String(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 "PrioritizedRiskCounts": - if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.PrioritizedRiskCounts, 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) } - case "RiskCounts": - if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { - return err - } + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentProfileSummaries(v *[]types.ProfileSummary, 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) + } - default: - _, _ = key, value + var cv []types.ProfileSummary + if *v == nil { + cv = []types.ProfileSummary{} + } else { + cv = *v + } + for _, value := range shape { + var col types.ProfileSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentProfileSummary(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileSummary(v **types.ProfileSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12006,9 +14838,9 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Profile + var sv *types.ProfileSummary if *v == nil { - sv = &types.Profile{} + sv = &types.ProfileSummary{} } else { sv = *v } @@ -12067,11 +14899,6 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ sv.ProfileName = ptr.String(jtv) } - case "ProfileQuestions": - if err := awsRestjson1_deserializeDocumentProfileQuestions(&sv.ProfileQuestions, value); err != nil { - return err - } - case "ProfileVersion": if value != nil { jtv, ok := value.(string) @@ -12081,20 +14908,6 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ sv.ProfileVersion = 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 - } - case "UpdatedAt": if value != nil { switch jtv := value.(type) { @@ -12120,7 +14933,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ return nil } -func awsRestjson1_deserializeDocumentProfileChoice(v **types.ProfileChoice, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileTemplate(v **types.ProfileTemplate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12133,40 +14946,59 @@ func awsRestjson1_deserializeDocumentProfileChoice(v **types.ProfileChoice, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ProfileChoice + var sv *types.ProfileTemplate if *v == nil { - sv = &types.ProfileChoice{} + sv = &types.ProfileTemplate{} } else { sv = *v } for key, value := range shape { switch key { - case "ChoiceDescription": + case "CreatedAt": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ChoiceDescription to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.ChoiceDescription = ptr.String(jtv) } - case "ChoiceId": + case "TemplateName": 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 ProfileName to be of type string, got %T instead", value) } - sv.ChoiceId = ptr.String(jtv) + sv.TemplateName = ptr.String(jtv) } - case "ChoiceTitle": + case "TemplateQuestions": + if err := awsRestjson1_deserializeDocumentTemplateQuestions(&sv.TemplateQuestions, value); err != nil { + return err + } + + case "UpdatedAt": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.ChoiceTitle = ptr.String(jtv) } default: @@ -12178,41 +15010,7 @@ func awsRestjson1_deserializeDocumentProfileChoice(v **types.ProfileChoice, valu return nil } -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 { +func awsRestjson1_deserializeDocumentProfileTemplateChoice(v **types.ProfileTemplateChoice, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12225,76 +15023,40 @@ func awsRestjson1_deserializeDocumentProfileNotificationSummary(v **types.Profil return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ProfileNotificationSummary + var sv *types.ProfileTemplateChoice if *v == nil { - sv = &types.ProfileNotificationSummary{} + sv = &types.ProfileTemplateChoice{} } else { sv = *v } for key, value := range shape { switch key { - case "CurrentProfileVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) - } - sv.CurrentProfileVersion = ptr.String(jtv) - } - - case "LatestProfileVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value) - } - 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.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 "Type": + case "ChoiceDescription": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ProfileNotificationType to be of type string, got %T instead", value) + return fmt.Errorf("expected ChoiceDescription to be of type string, got %T instead", value) } - sv.Type = types.ProfileNotificationType(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: @@ -12306,7 +15068,7 @@ func awsRestjson1_deserializeDocumentProfileNotificationSummary(v **types.Profil return nil } -func awsRestjson1_deserializeDocumentProfileQuestion(v **types.ProfileQuestion, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileTemplateQuestion(v **types.ProfileTemplateQuestion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12319,9 +15081,9 @@ func awsRestjson1_deserializeDocumentProfileQuestion(v **types.ProfileQuestion, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ProfileQuestion + var sv *types.ProfileTemplateQuestion if *v == nil { - sv = &types.ProfileQuestion{} + sv = &types.ProfileTemplateQuestion{} } else { sv = *v } @@ -12355,7 +15117,7 @@ func awsRestjson1_deserializeDocumentProfileQuestion(v **types.ProfileQuestion, } case "QuestionChoices": - if err := awsRestjson1_deserializeDocumentProfileQuestionChoices(&sv.QuestionChoices, value); err != nil { + if err := awsRestjson1_deserializeDocumentProfileTemplateQuestionChoices(&sv.QuestionChoices, value); err != nil { return err } @@ -12386,11 +15148,6 @@ func awsRestjson1_deserializeDocumentProfileQuestion(v **types.ProfileQuestion, sv.QuestionTitle = ptr.String(jtv) } - case "SelectedChoiceIds": - if err := awsRestjson1_deserializeDocumentSelectedChoiceIds(&sv.SelectedChoiceIds, value); err != nil { - return err - } - default: _, _ = key, value @@ -12400,7 +15157,7 @@ func awsRestjson1_deserializeDocumentProfileQuestion(v **types.ProfileQuestion, return nil } -func awsRestjson1_deserializeDocumentProfileQuestionChoices(v *[]types.ProfileChoice, value interface{}) error { +func awsRestjson1_deserializeDocumentProfileTemplateQuestionChoices(v *[]types.ProfileTemplateChoice, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12413,28 +15170,68 @@ func awsRestjson1_deserializeDocumentProfileQuestionChoices(v *[]types.ProfileCh return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ProfileChoice + var cv []types.ProfileTemplateChoice if *v == nil { - cv = []types.ProfileChoice{} + cv = []types.ProfileTemplateChoice{} } else { cv = *v } for _, value := range shape { - var col types.ProfileChoice + var col types.ProfileTemplateChoice destAddr := &col - if err := awsRestjson1_deserializeDocumentProfileChoice(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentProfileTemplateChoice(&destAddr, value); err != nil { return err } - col = *destAddr - cv = append(cv, col) + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentQuestionCounts(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 Count to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + parsedVal = int32(i64) + } + mv[key] = parsedVal } - *v = cv + *v = mv return nil } -func awsRestjson1_deserializeDocumentProfileQuestions(v *[]types.ProfileQuestion, value interface{}) error { +func awsRestjson1_deserializeDocumentQuestionDifference(v **types.QuestionDifference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12442,33 +15239,57 @@ func awsRestjson1_deserializeDocumentProfileQuestions(v *[]types.ProfileQuestion 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.ProfileQuestion + var sv *types.QuestionDifference if *v == nil { - cv = []types.ProfileQuestion{} + sv = &types.QuestionDifference{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ProfileQuestion - destAddr := &col - if err := awsRestjson1_deserializeDocumentProfileQuestion(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "DifferenceStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DifferenceStatus to be of type string, got %T instead", value) + } + sv.DifferenceStatus = types.DifferenceStatus(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) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentProfileShareSummaries(v *[]types.ProfileShareSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentQuestionDifferences(v *[]types.QuestionDifference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12481,17 +15302,17 @@ func awsRestjson1_deserializeDocumentProfileShareSummaries(v *[]types.ProfileSha return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ProfileShareSummary + var cv []types.QuestionDifference if *v == nil { - cv = []types.ProfileShareSummary{} + cv = []types.QuestionDifference{} } else { cv = *v } for _, value := range shape { - var col types.ProfileShareSummary + var col types.QuestionDifference destAddr := &col - if err := awsRestjson1_deserializeDocumentProfileShareSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentQuestionDifference(&destAddr, value); err != nil { return err } col = *destAddr @@ -12502,7 +15323,7 @@ func awsRestjson1_deserializeDocumentProfileShareSummaries(v *[]types.ProfileSha return nil } -func awsRestjson1_deserializeDocumentProfileShareSummary(v **types.ProfileShareSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentQuestionMetric(v **types.QuestionMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12515,49 +15336,36 @@ func awsRestjson1_deserializeDocumentProfileShareSummary(v **types.ProfileShareS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ProfileShareSummary + var sv *types.QuestionMetric if *v == nil { - sv = &types.ProfileShareSummary{} + sv = &types.QuestionMetric{} } 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 "BestPractices": + if err := awsRestjson1_deserializeDocumentBestPractices(&sv.BestPractices, value); err != nil { + return err } - case "Status": + case "QuestionId": 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 QuestionId to be of type string, got %T instead", value) } - sv.Status = types.ShareStatus(jtv) + sv.QuestionId = ptr.String(jtv) } - case "StatusMessage": + case "Risk": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected Risk to be of type string, got %T instead", value) } - sv.StatusMessage = ptr.String(jtv) + sv.Risk = types.Risk(jtv) } default: @@ -12569,7 +15377,7 @@ func awsRestjson1_deserializeDocumentProfileShareSummary(v **types.ProfileShareS return nil } -func awsRestjson1_deserializeDocumentProfileSummaries(v *[]types.ProfileSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentQuestionMetrics(v *[]types.QuestionMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12582,17 +15390,17 @@ func awsRestjson1_deserializeDocumentProfileSummaries(v *[]types.ProfileSummary, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ProfileSummary + var cv []types.QuestionMetric if *v == nil { - cv = []types.ProfileSummary{} + cv = []types.QuestionMetric{} } else { cv = *v } for _, value := range shape { - var col types.ProfileSummary + var col types.QuestionMetric destAddr := &col - if err := awsRestjson1_deserializeDocumentProfileSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentQuestionMetric(&destAddr, value); err != nil { return err } col = *destAddr @@ -12603,7 +15411,7 @@ func awsRestjson1_deserializeDocumentProfileSummaries(v *[]types.ProfileSummary, return nil } -func awsRestjson1_deserializeDocumentProfileSummary(v **types.ProfileSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12616,90 +15424,40 @@ func awsRestjson1_deserializeDocumentProfileSummary(v **types.ProfileSummary, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ProfileSummary + var sv *types.ResourceNotFoundException if *v == nil { - sv = &types.ProfileSummary{} + sv = &types.ResourceNotFoundException{} } 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 "Owner": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) - } - sv.Owner = 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 "ProfileDescription": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ProfileDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } - sv.ProfileDescription = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "ProfileName": + case "ResourceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value) + return fmt.Errorf("expected ExceptionResourceId to be of type string, got %T instead", value) } - sv.ProfileName = ptr.String(jtv) + sv.ResourceId = ptr.String(jtv) } - case "ProfileVersion": + case "ResourceType": 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) - + return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) } + sv.ResourceType = ptr.String(jtv) } default: @@ -12711,7 +15469,7 @@ func awsRestjson1_deserializeDocumentProfileSummary(v **types.ProfileSummary, va return nil } -func awsRestjson1_deserializeDocumentProfileTemplate(v **types.ProfileTemplate, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplate(v **types.ReviewTemplate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12724,45 +15482,84 @@ func awsRestjson1_deserializeDocumentProfileTemplate(v **types.ProfileTemplate, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ProfileTemplate + var sv *types.ReviewTemplate if *v == nil { - sv = &types.ProfileTemplate{} + sv = &types.ReviewTemplate{} } else { sv = *v } for key, value := range shape { switch key { - case "CreatedAt": + case "Description": 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)) + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + case "Lenses": + if err := awsRestjson1_deserializeDocumentReviewTemplateLenses(&sv.Lenses, value); err != nil { + return err + } + 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 "TemplateName": + case "Owner": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } - sv.TemplateName = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "TemplateQuestions": - if err := awsRestjson1_deserializeDocumentTemplateQuestions(&sv.TemplateQuestions, value); err != nil { + case "QuestionCounts": + if err := awsRestjson1_deserializeDocumentQuestionCounts(&sv.QuestionCounts, value); err != nil { + return err + } + + 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 } + case "TemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + case "TemplateName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) + } + sv.TemplateName = ptr.String(jtv) + } + case "UpdatedAt": if value != nil { switch jtv := value.(type) { @@ -12779,6 +15576,15 @@ func awsRestjson1_deserializeDocumentProfileTemplate(v **types.ProfileTemplate, } } + case "UpdateStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReviewTemplateUpdateStatus to be of type string, got %T instead", value) + } + sv.UpdateStatus = types.ReviewTemplateUpdateStatus(jtv) + } + default: _, _ = key, value @@ -12788,7 +15594,7 @@ func awsRestjson1_deserializeDocumentProfileTemplate(v **types.ProfileTemplate, return nil } -func awsRestjson1_deserializeDocumentProfileTemplateChoice(v **types.ProfileTemplateChoice, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplateAnswer(v **types.ReviewTemplateAnswer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12801,40 +15607,127 @@ func awsRestjson1_deserializeDocumentProfileTemplateChoice(v **types.ProfileTemp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ProfileTemplateChoice + var sv *types.ReviewTemplateAnswer if *v == nil { - sv = &types.ProfileTemplateChoice{} + sv = &types.ReviewTemplateAnswer{} } else { sv = *v } for key, value := range shape { switch key { - case "ChoiceDescription": + case "AnswerStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChoiceDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected ReviewTemplateAnswerStatus to be of type string, got %T instead", value) } - sv.ChoiceDescription = ptr.String(jtv) + sv.AnswerStatus = types.ReviewTemplateAnswerStatus(jtv) } - case "ChoiceId": + 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 ChoiceId to be of type string, got %T instead", value) + return fmt.Errorf("expected DisplayText to be of type string, got %T instead", value) } - sv.ChoiceId = ptr.String(jtv) + sv.HelpfulResourceDisplayText = ptr.String(jtv) } - case "ChoiceTitle": + case "HelpfulResourceUrl": 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 HelpfulResourceUrl to be of type string, got %T instead", value) } - sv.ChoiceTitle = ptr.String(jtv) + 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 "SelectedChoices": + if err := awsRestjson1_deserializeDocumentSelectedChoices(&sv.SelectedChoices, value); err != nil { + return err } default: @@ -12846,7 +15739,41 @@ func awsRestjson1_deserializeDocumentProfileTemplateChoice(v **types.ProfileTemp return nil } -func awsRestjson1_deserializeDocumentProfileTemplateQuestion(v **types.ProfileTemplateQuestion, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplateAnswerSummaries(v *[]types.ReviewTemplateAnswerSummary, 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.ReviewTemplateAnswerSummary + if *v == nil { + cv = []types.ReviewTemplateAnswerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ReviewTemplateAnswerSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentReviewTemplateAnswerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentReviewTemplateAnswerSummary(v **types.ReviewTemplateAnswerSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12859,53 +15786,50 @@ func awsRestjson1_deserializeDocumentProfileTemplateQuestion(v **types.ProfileTe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ProfileTemplateQuestion + var sv *types.ReviewTemplateAnswerSummary if *v == nil { - sv = &types.ProfileTemplateQuestion{} + sv = &types.ReviewTemplateAnswerSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "MaxSelectedChoices": + case "AnswerStatus": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MaxSelectedProfileChoices to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected ReviewTemplateAnswerStatus to be of type string, got %T instead", value) } - sv.MaxSelectedChoices = int32(i64) + sv.AnswerStatus = types.ReviewTemplateAnswerStatus(jtv) } - 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 "ChoiceAnswerSummaries": + if err := awsRestjson1_deserializeDocumentChoiceAnswerSummaries(&sv.ChoiceAnswerSummaries, value); err != nil { + return err } - case "QuestionChoices": - if err := awsRestjson1_deserializeDocumentProfileTemplateQuestionChoices(&sv.QuestionChoices, value); err != nil { + case "Choices": + if err := awsRestjson1_deserializeDocumentChoices(&sv.Choices, value); err != nil { return err } - case "QuestionDescription": + 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 QuestionDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) } - sv.QuestionDescription = ptr.String(jtv) + sv.PillarId = ptr.String(jtv) } case "QuestionId": @@ -12926,6 +15850,29 @@ func awsRestjson1_deserializeDocumentProfileTemplateQuestion(v **types.ProfileTe 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 "SelectedChoices": + if err := awsRestjson1_deserializeDocumentSelectedChoices(&sv.SelectedChoices, value); err != nil { + return err + } + default: _, _ = key, value @@ -12935,7 +15882,7 @@ func awsRestjson1_deserializeDocumentProfileTemplateQuestion(v **types.ProfileTe return nil } -func awsRestjson1_deserializeDocumentProfileTemplateQuestionChoices(v *[]types.ProfileTemplateChoice, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplateLenses(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12948,20 +15895,22 @@ func awsRestjson1_deserializeDocumentProfileTemplateQuestionChoices(v *[]types.P return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ProfileTemplateChoice + var cv []string if *v == nil { - cv = []types.ProfileTemplateChoice{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.ProfileTemplateChoice - destAddr := &col - if err := awsRestjson1_deserializeDocumentProfileTemplateChoice(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -12969,7 +15918,7 @@ func awsRestjson1_deserializeDocumentProfileTemplateQuestionChoices(v *[]types.P return nil } -func awsRestjson1_deserializeDocumentQuestionDifference(v **types.QuestionDifference, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplateLensReview(v **types.ReviewTemplateLensReview, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12982,40 +15931,102 @@ func awsRestjson1_deserializeDocumentQuestionDifference(v **types.QuestionDiffer return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QuestionDifference + var sv *types.ReviewTemplateLensReview if *v == nil { - sv = &types.QuestionDifference{} + sv = &types.ReviewTemplateLensReview{} } else { sv = *v } - for key, value := range shape { - switch key { - case "DifferenceStatus": + 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": 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 LensStatus to be of type string, got %T instead", value) } - sv.DifferenceStatus = types.DifferenceStatus(jtv) + sv.LensStatus = types.LensStatus(jtv) } - case "QuestionId": + case "LensVersion": 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 LensVersion to be of type string, got %T instead", value) } - sv.QuestionId = ptr.String(jtv) + sv.LensVersion = ptr.String(jtv) } - case "QuestionTitle": + case "NextToken": 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 NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(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 "PillarReviewSummaries": + if err := awsRestjson1_deserializeDocumentReviewTemplatePillarReviewSummaries(&sv.PillarReviewSummaries, value); err != nil { + return err + } + + case "QuestionCounts": + if err := awsRestjson1_deserializeDocumentQuestionCounts(&sv.QuestionCounts, 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.QuestionTitle = ptr.String(jtv) } default: @@ -13027,7 +16038,7 @@ func awsRestjson1_deserializeDocumentQuestionDifference(v **types.QuestionDiffer return nil } -func awsRestjson1_deserializeDocumentQuestionDifferences(v *[]types.QuestionDifference, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplatePillarReviewSummaries(v *[]types.ReviewTemplatePillarReviewSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13040,17 +16051,17 @@ func awsRestjson1_deserializeDocumentQuestionDifferences(v *[]types.QuestionDiff return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.QuestionDifference + var cv []types.ReviewTemplatePillarReviewSummary if *v == nil { - cv = []types.QuestionDifference{} + cv = []types.ReviewTemplatePillarReviewSummary{} } else { cv = *v } for _, value := range shape { - var col types.QuestionDifference + var col types.ReviewTemplatePillarReviewSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentQuestionDifference(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentReviewTemplatePillarReviewSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -13061,7 +16072,7 @@ func awsRestjson1_deserializeDocumentQuestionDifferences(v *[]types.QuestionDiff return nil } -func awsRestjson1_deserializeDocumentQuestionMetric(v **types.QuestionMetric, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplatePillarReviewSummary(v **types.ReviewTemplatePillarReviewSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13074,36 +16085,45 @@ func awsRestjson1_deserializeDocumentQuestionMetric(v **types.QuestionMetric, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QuestionMetric + var sv *types.ReviewTemplatePillarReviewSummary if *v == nil { - sv = &types.QuestionMetric{} + sv = &types.ReviewTemplatePillarReviewSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "BestPractices": - if err := awsRestjson1_deserializeDocumentBestPractices(&sv.BestPractices, value); err != nil { - return err + 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 "QuestionId": + case "PillarId": 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 PillarId to be of type string, got %T instead", value) } - sv.QuestionId = ptr.String(jtv) + sv.PillarId = ptr.String(jtv) } - case "Risk": + case "PillarName": 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 PillarName to be of type string, got %T instead", value) } - sv.Risk = types.Risk(jtv) + sv.PillarName = ptr.String(jtv) + } + + case "QuestionCounts": + if err := awsRestjson1_deserializeDocumentQuestionCounts(&sv.QuestionCounts, value); err != nil { + return err } default: @@ -13115,7 +16135,7 @@ func awsRestjson1_deserializeDocumentQuestionMetric(v **types.QuestionMetric, va return nil } -func awsRestjson1_deserializeDocumentQuestionMetrics(v *[]types.QuestionMetric, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplates(v *[]types.ReviewTemplateSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13128,17 +16148,17 @@ func awsRestjson1_deserializeDocumentQuestionMetrics(v *[]types.QuestionMetric, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.QuestionMetric + var cv []types.ReviewTemplateSummary if *v == nil { - cv = []types.QuestionMetric{} + cv = []types.ReviewTemplateSummary{} } else { cv = *v } for _, value := range shape { - var col types.QuestionMetric + var col types.ReviewTemplateSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentQuestionMetric(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentReviewTemplateSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -13149,7 +16169,7 @@ func awsRestjson1_deserializeDocumentQuestionMetrics(v *[]types.QuestionMetric, return nil } -func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsRestjson1_deserializeDocumentReviewTemplateSummary(v **types.ReviewTemplateSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13162,40 +16182,79 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceNotFoundException + var sv *types.ReviewTemplateSummary if *v == nil { - sv = &types.ResourceNotFoundException{} + sv = &types.ReviewTemplateSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "Description": 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 TemplateDescription to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "ResourceId": + case "Lenses": + if err := awsRestjson1_deserializeDocumentReviewTemplateLenses(&sv.Lenses, value); err != nil { + return err + } + + case "Owner": 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 AwsAccountId to be of type string, got %T instead", value) } - sv.ResourceId = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "ResourceType": + case "TemplateArn": 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 TemplateArn to be of type string, got %T instead", value) } - sv.ResourceType = ptr.String(jtv) + sv.TemplateArn = ptr.String(jtv) + } + + case "TemplateName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) + } + sv.TemplateName = 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 "UpdateStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReviewTemplateUpdateStatus to be of type string, got %T instead", value) + } + sv.UpdateStatus = types.ReviewTemplateUpdateStatus(jtv) } default: @@ -13462,6 +16521,15 @@ func awsRestjson1_deserializeDocumentShareInvitation(v **types.ShareInvitation, sv.ShareResourceType = types.ShareResourceType(jtv) } + case "TemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + case "WorkloadId": if value != nil { jtv, ok := value.(string) @@ -13617,6 +16685,24 @@ func awsRestjson1_deserializeDocumentShareInvitationSummary(v **types.ShareInvit sv.ShareResourceType = types.ShareResourceType(jtv) } + case "TemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + case "TemplateName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) + } + sv.TemplateName = ptr.String(jtv) + } + case "WorkloadId": if value != nil { jtv, ok := value.(string) @@ -13714,6 +16800,107 @@ func awsRestjson1_deserializeDocumentTemplateQuestions(v *[]types.ProfileTemplat return nil } +func awsRestjson1_deserializeDocumentTemplateShareSummaries(v *[]types.TemplateShareSummary, 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.TemplateShareSummary + if *v == nil { + cv = []types.TemplateShareSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TemplateShareSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentTemplateShareSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTemplateShareSummary(v **types.TemplateShareSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TemplateShareSummary + if *v == nil { + sv = &types.TemplateShareSummary{} + } 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_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/wellarchitected/generated.json b/service/wellarchitected/generated.json index a01ba24f410..4ef0ab2cd03 100644 --- a/service/wellarchitected/generated.json +++ b/service/wellarchitected/generated.json @@ -16,12 +16,16 @@ "api_op_CreateMilestone.go", "api_op_CreateProfile.go", "api_op_CreateProfileShare.go", + "api_op_CreateReviewTemplate.go", + "api_op_CreateTemplateShare.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_DeleteReviewTemplate.go", + "api_op_DeleteTemplateShare.go", "api_op_DeleteWorkload.go", "api_op_DeleteWorkloadShare.go", "api_op_DisassociateLenses.go", @@ -36,6 +40,9 @@ "api_op_GetMilestone.go", "api_op_GetProfile.go", "api_op_GetProfileTemplate.go", + "api_op_GetReviewTemplate.go", + "api_op_GetReviewTemplateAnswer.go", + "api_op_GetReviewTemplateLensReview.go", "api_op_GetWorkload.go", "api_op_ImportLens.go", "api_op_ListAnswers.go", @@ -50,8 +57,11 @@ "api_op_ListProfileNotifications.go", "api_op_ListProfileShares.go", "api_op_ListProfiles.go", + "api_op_ListReviewTemplateAnswers.go", + "api_op_ListReviewTemplates.go", "api_op_ListShareInvitations.go", "api_op_ListTagsForResource.go", + "api_op_ListTemplateShares.go", "api_op_ListWorkloadShares.go", "api_op_ListWorkloads.go", "api_op_TagResource.go", @@ -60,11 +70,15 @@ "api_op_UpdateGlobalSettings.go", "api_op_UpdateLensReview.go", "api_op_UpdateProfile.go", + "api_op_UpdateReviewTemplate.go", + "api_op_UpdateReviewTemplateAnswer.go", + "api_op_UpdateReviewTemplateLensReview.go", "api_op_UpdateShareInvitation.go", "api_op_UpdateWorkload.go", "api_op_UpdateWorkloadShare.go", "api_op_UpgradeLensReview.go", "api_op_UpgradeProfileVersion.go", + "api_op_UpgradeReviewTemplateLensReview.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/wellarchitected/serializers.go b/service/wellarchitected/serializers.go index d0b03a11bad..ba623291c33 100644 --- a/service/wellarchitected/serializers.go +++ b/service/wellarchitected/serializers.go @@ -670,6 +670,203 @@ func awsRestjson1_serializeOpDocumentCreateProfileShareInput(v *CreateProfileSha return nil } +type awsRestjson1_serializeOpCreateReviewTemplate struct { +} + +func (*awsRestjson1_serializeOpCreateReviewTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateReviewTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateReviewTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateReviewTemplateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateReviewTemplateInput(v *CreateReviewTemplateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateReviewTemplateInput(v *CreateReviewTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Lenses != nil { + ok := object.Key("Lenses") + if err := awsRestjson1_serializeDocumentReviewTemplateLenses(v.Lenses, ok); err != nil { + return err + } + } + + if v.Notes != nil { + ok := object.Key("Notes") + ok.String(*v.Notes) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.TemplateName != nil { + ok := object.Key("TemplateName") + ok.String(*v.TemplateName) + } + + return nil +} + +type awsRestjson1_serializeOpCreateTemplateShare struct { +} + +func (*awsRestjson1_serializeOpCreateTemplateShare) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateTemplateShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTemplateShareInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/templates/shares/{TemplateArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateTemplateShareInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateTemplateShareInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateTemplateShareInput(v *CreateTemplateShareInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} + } + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateTemplateShareInput(v *CreateTemplateShareInput, 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 { } @@ -833,6 +1030,13 @@ func awsRestjson1_serializeOpDocumentCreateWorkloadInput(v *CreateWorkloadInput, ok.String(*v.ReviewOwner) } + if v.ReviewTemplateArns != nil { + ok := object.Key("ReviewTemplateArns") + if err := awsRestjson1_serializeDocumentReviewTemplateArns(v.ReviewTemplateArns, ok); err != nil { + return err + } + } + if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { @@ -1244,14 +1448,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteProfileShareInput(v *DeleteProfil return nil } -type awsRestjson1_serializeOpDeleteWorkload struct { +type awsRestjson1_serializeOpDeleteReviewTemplate struct { } -func (*awsRestjson1_serializeOpDeleteWorkload) ID() string { +func (*awsRestjson1_serializeOpDeleteReviewTemplate) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteReviewTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1259,13 +1463,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.(*DeleteReviewTemplateInput) _ = 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("/reviewTemplates/{TemplateArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -1281,7 +1485,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_serializeOpHttpBindingsDeleteReviewTemplateInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1292,7 +1496,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_serializeOpHttpBindingsDeleteReviewTemplateInput(v *DeleteReviewTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1301,11 +1505,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.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} } - if v.WorkloadId != nil { - if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { return err } } @@ -1313,14 +1517,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadInput(v *DeleteWorkloadIn return nil } -type awsRestjson1_serializeOpDeleteWorkloadShare struct { +type awsRestjson1_serializeOpDeleteTemplateShare struct { } -func (*awsRestjson1_serializeOpDeleteWorkloadShare) ID() string { +func (*awsRestjson1_serializeOpDeleteTemplateShare) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteWorkloadShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteTemplateShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1328,13 +1532,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.(*DeleteTemplateShareInput) _ = 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("/templates/shares/{TemplateArn}/{ShareId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -1350,7 +1554,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_serializeOpHttpBindingsDeleteTemplateShareInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1361,7 +1565,7 @@ func (m *awsRestjson1_serializeOpDeleteWorkloadShare) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadShareInput(v *DeleteWorkloadShareInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteTemplateShareInput(v *DeleteTemplateShareInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1379,11 +1583,11 @@ func awsRestjson1_serializeOpHttpBindingsDeleteWorkloadShareInput(v *DeleteWorkl } } - if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} } - if v.WorkloadId != nil { - if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { return err } } @@ -1391,14 +1595,14 @@ 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_serializeOpDisassociateLenses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -1406,16 +1610,16 @@ func (m *awsRestjson1_serializeOpDisassociateLenses) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisassociateLensesInput) + 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}/disassociateLenses") + 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 = "PATCH" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1428,18 +1632,7 @@ func (m *awsRestjson1_serializeOpDisassociateLenses) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDisassociateLensesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDisassociateLensesInput(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_serializeOpHttpBindingsDeleteWorkloadInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1450,11 +1643,15 @@ func (m *awsRestjson1_serializeOpDisassociateLenses) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDisassociateLensesInput(v *DisassociateLensesInput, encoder *httpbinding.Encoder) error { +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")} } @@ -1467,28 +1664,14 @@ func awsRestjson1_serializeOpHttpBindingsDisassociateLensesInput(v *Disassociate return nil } -func awsRestjson1_serializeOpDocumentDisassociateLensesInput(v *DisassociateLensesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.LensAliases != nil { - ok := object.Key("LensAliases") - if err := awsRestjson1_serializeDocumentLensAliases(v.LensAliases, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDisassociateProfiles struct { +type awsRestjson1_serializeOpDeleteWorkloadShare struct { } -func (*awsRestjson1_serializeOpDisassociateProfiles) ID() string { +func (*awsRestjson1_serializeOpDeleteWorkloadShare) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDisassociateProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -1496,16 +1679,16 @@ func (m *awsRestjson1_serializeOpDisassociateProfiles) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisassociateProfilesInput) + 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}/disassociateProfiles") + 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 = "PATCH" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1518,7 +1701,175 @@ func (m *awsRestjson1_serializeOpDisassociateProfiles) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDisassociateProfilesInput(input, restEncoder); err != nil { + 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" +} + +func (m *awsRestjson1_serializeOpDisassociateLenses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateLensesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/disassociateLenses") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDisassociateLensesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDisassociateLensesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDisassociateLensesInput(v *DisassociateLensesInput, 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_serializeOpDocumentDisassociateLensesInput(v *DisassociateLensesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LensAliases != nil { + ok := object.Key("LensAliases") + if err := awsRestjson1_serializeDocumentLensAliases(v.LensAliases, ok); err != nil { + return err + } + } + + 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" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDisassociateProfilesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2289,14 +2640,14 @@ func awsRestjson1_serializeOpHttpBindingsGetProfileTemplateInput(v *GetProfileTe return nil } -type awsRestjson1_serializeOpGetWorkload struct { +type awsRestjson1_serializeOpGetReviewTemplate struct { } -func (*awsRestjson1_serializeOpGetWorkload) ID() string { +func (*awsRestjson1_serializeOpGetReviewTemplate) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetReviewTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2304,13 +2655,13 @@ func (m *awsRestjson1_serializeOpGetWorkload) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetWorkloadInput) + input, ok := in.Parameters.(*GetReviewTemplateInput) _ = 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("/reviewTemplates/{TemplateArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2326,7 +2677,7 @@ func (m *awsRestjson1_serializeOpGetWorkload) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetWorkloadInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetReviewTemplateInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2337,16 +2688,16 @@ func (m *awsRestjson1_serializeOpGetWorkload) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetWorkloadInput(v *GetWorkloadInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetReviewTemplateInput(v *GetReviewTemplateInput, 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.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} } - if v.WorkloadId != nil { - if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { return err } } @@ -2354,14 +2705,14 @@ func awsRestjson1_serializeOpHttpBindingsGetWorkloadInput(v *GetWorkloadInput, e return nil } -type awsRestjson1_serializeOpImportLens struct { +type awsRestjson1_serializeOpGetReviewTemplateAnswer struct { } -func (*awsRestjson1_serializeOpImportLens) ID() string { +func (*awsRestjson1_serializeOpGetReviewTemplateAnswer) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpImportLens) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetReviewTemplateAnswer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2369,16 +2720,16 @@ func (m *awsRestjson1_serializeOpImportLens) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ImportLensInput) + input, ok := in.Parameters.(*GetReviewTemplateAnswerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/importLens") + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates/{TemplateArn}/lensReviews/{LensAlias}/answers/{QuestionId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2391,14 +2742,7 @@ func (m *awsRestjson1_serializeOpImportLens) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentImportLensInput(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_serializeOpHttpBindingsGetReviewTemplateAnswerInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2409,36 +2753,34 @@ func (m *awsRestjson1_serializeOpImportLens) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsImportLensInput(v *ImportLensInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetReviewTemplateAnswerInput(v *GetReviewTemplateAnswerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} - -func awsRestjson1_serializeOpDocumentImportLensInput(v *ImportLensInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("ClientRequestToken") - ok.String(*v.ClientRequestToken) + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} } - - if v.JSONString != nil { - ok := object.Key("JSONString") - ok.String(*v.JSONString) + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } } - if v.LensAlias != nil { - ok := object.Key("LensAlias") - ok.String(*v.LensAlias) + if v.QuestionId == nil || len(*v.QuestionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QuestionId must not be empty")} + } + if v.QuestionId != nil { + if err := encoder.SetURI("QuestionId").String(*v.QuestionId); err != nil { + return err + } } - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} + } + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { return err } } @@ -2446,14 +2788,14 @@ func awsRestjson1_serializeOpDocumentImportLensInput(v *ImportLensInput, value s return nil } -type awsRestjson1_serializeOpListAnswers struct { +type awsRestjson1_serializeOpGetReviewTemplateLensReview struct { } -func (*awsRestjson1_serializeOpListAnswers) ID() string { +func (*awsRestjson1_serializeOpGetReviewTemplateLensReview) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAnswers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetReviewTemplateLensReview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2461,13 +2803,13 @@ func (m *awsRestjson1_serializeOpListAnswers) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAnswersInput) + input, ok := in.Parameters.(*GetReviewTemplateLensReviewInput) _ = 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}/answers") + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates/{TemplateArn}/lensReviews/{LensAlias}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2483,7 +2825,7 @@ func (m *awsRestjson1_serializeOpListAnswers) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAnswersInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetReviewTemplateLensReviewInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2494,7 +2836,7 @@ func (m *awsRestjson1_serializeOpListAnswers) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAnswersInput(v *ListAnswersInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetReviewTemplateLensReviewInput(v *GetReviewTemplateLensReviewInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2508,24 +2850,255 @@ func awsRestjson1_serializeOpHttpBindingsListAnswersInput(v *ListAnswersInput, e } } - if v.MaxResults != 0 { - encoder.SetQuery("MaxResults").Integer(v.MaxResults) + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} } - - if v.MilestoneNumber != 0 { - encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { + return err + } } - if v.NextToken != nil { - encoder.SetQuery("NextToken").String(*v.NextToken) - } + return nil +} - if v.PillarId != nil { - encoder.SetQuery("PillarId").String(*v.PillarId) - } +type awsRestjson1_serializeOpGetWorkload struct { +} - if len(v.QuestionPriority) > 0 { - encoder.SetQuery("QuestionPriority").String(string(v.QuestionPriority)) +func (*awsRestjson1_serializeOpGetWorkload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWorkloadInput) + _ = 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 = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetWorkloadInput(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_serializeOpHttpBindingsGetWorkloadInput(v *GetWorkloadInput, 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 +} + +type awsRestjson1_serializeOpImportLens struct { +} + +func (*awsRestjson1_serializeOpImportLens) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpImportLens) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ImportLensInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/importLens") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentImportLensInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsImportLensInput(v *ImportLensInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentImportLensInput(v *ImportLensInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.JSONString != nil { + ok := object.Key("JSONString") + ok.String(*v.JSONString) + } + + if v.LensAlias != nil { + ok := object.Key("LensAlias") + ok.String(*v.LensAlias) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListAnswers struct { +} + +func (*awsRestjson1_serializeOpListAnswers) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAnswers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAnswersInput) + _ = 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}/answers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAnswersInput(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_serializeOpHttpBindingsListAnswersInput(v *ListAnswersInput, 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.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.MilestoneNumber != 0 { + encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.PillarId != nil { + 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 { @@ -3264,6 +3837,11 @@ func awsRestjson1_serializeOpDocumentListNotificationsInput(v *ListNotifications ok.String(*v.NextToken) } + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + if v.WorkloadId != nil { ok := object.Key("WorkloadId") ok.String(*v.WorkloadId) @@ -3493,14 +4071,14 @@ func awsRestjson1_serializeOpHttpBindingsListProfileSharesInput(v *ListProfileSh return nil } -type awsRestjson1_serializeOpListShareInvitations struct { +type awsRestjson1_serializeOpListReviewTemplateAnswers struct { } -func (*awsRestjson1_serializeOpListShareInvitations) ID() string { +func (*awsRestjson1_serializeOpListReviewTemplateAnswers) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListShareInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListReviewTemplateAnswers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3508,13 +4086,13 @@ func (m *awsRestjson1_serializeOpListShareInvitations) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListShareInvitationsInput) + input, ok := in.Parameters.(*ListReviewTemplateAnswersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/shareInvitations") + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates/{TemplateArn}/lensReviews/{LensAlias}/answers") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3530,7 +4108,7 @@ func (m *awsRestjson1_serializeOpListShareInvitations) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListShareInvitationsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListReviewTemplateAnswersInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3541,13 +4119,18 @@ func (m *awsRestjson1_serializeOpListShareInvitations) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListShareInvitationsInput(v *ListShareInvitationsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListReviewTemplateAnswersInput(v *ListReviewTemplateAnswersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.LensNamePrefix != nil { - encoder.SetQuery("LensNamePrefix").String(*v.LensNamePrefix) + 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.MaxResults != 0 { @@ -3558,14 +4141,163 @@ func awsRestjson1_serializeOpHttpBindingsListShareInvitationsInput(v *ListShareI encoder.SetQuery("NextToken").String(*v.NextToken) } - if v.ProfileNamePrefix != nil { - encoder.SetQuery("ProfileNamePrefix").String(*v.ProfileNamePrefix) + if v.PillarId != nil { + encoder.SetQuery("PillarId").String(*v.PillarId) + } + + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} + } + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListReviewTemplates struct { +} + +func (*awsRestjson1_serializeOpListReviewTemplates) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListReviewTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListReviewTemplatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListReviewTemplatesInput(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_serializeOpHttpBindingsListReviewTemplatesInput(v *ListReviewTemplatesInput, 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_serializeOpListShareInvitations struct { +} + +func (*awsRestjson1_serializeOpListShareInvitations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListShareInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListShareInvitationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/shareInvitations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListShareInvitationsInput(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_serializeOpHttpBindingsListShareInvitationsInput(v *ListShareInvitationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensNamePrefix != nil { + encoder.SetQuery("LensNamePrefix").String(*v.LensNamePrefix) + } + + 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.ShareResourceType) > 0 { encoder.SetQuery("ShareResourceType").String(string(v.ShareResourceType)) } + if v.TemplateNamePrefix != nil { + encoder.SetQuery("TemplateNamePrefix").String(*v.TemplateNamePrefix) + } + if v.WorkloadNamePrefix != nil { encoder.SetQuery("WorkloadNamePrefix").String(*v.WorkloadNamePrefix) } @@ -3638,6 +4370,87 @@ func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsFor return nil } +type awsRestjson1_serializeOpListTemplateShares struct { +} + +func (*awsRestjson1_serializeOpListTemplateShares) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTemplateShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTemplateSharesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/templates/shares/{TemplateArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTemplateSharesInput(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_serializeOpHttpBindingsListTemplateSharesInput(v *ListTemplateSharesInput, 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.SharedWithPrefix != nil { + encoder.SetQuery("SharedWithPrefix").String(*v.SharedWithPrefix) + } + + if len(v.Status) > 0 { + encoder.SetQuery("Status").String(string(v.Status)) + } + + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} + } + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListWorkloads struct { } @@ -4080,14 +4893,293 @@ func awsRestjson1_serializeOpDocumentUpdateAnswerInput(v *UpdateAnswerInput, val ok.String(*v.Notes) } - if len(v.Reason) > 0 { - ok := object.Key("Reason") - ok.String(string(v.Reason)) + if len(v.Reason) > 0 { + ok := object.Key("Reason") + ok.String(string(v.Reason)) + } + + if v.SelectedChoices != nil { + ok := object.Key("SelectedChoices") + if err := awsRestjson1_serializeDocumentSelectedChoices(v.SelectedChoices, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateGlobalSettings struct { +} + +func (*awsRestjson1_serializeOpUpdateGlobalSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateGlobalSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateGlobalSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/global-settings") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateGlobalSettingsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateGlobalSettingsInput(v *UpdateGlobalSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateGlobalSettingsInput(v *UpdateGlobalSettingsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.DiscoveryIntegrationStatus) > 0 { + ok := object.Key("DiscoveryIntegrationStatus") + ok.String(string(v.DiscoveryIntegrationStatus)) + } + + if len(v.OrganizationSharingStatus) > 0 { + ok := object.Key("OrganizationSharingStatus") + ok.String(string(v.OrganizationSharingStatus)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateLensReview struct { +} + +func (*awsRestjson1_serializeOpUpdateLensReview) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateLensReview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateLensReviewInput) + _ = 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}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateLensReviewInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateLensReviewInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateLensReviewInput(v *UpdateLensReviewInput, 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.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_serializeOpDocumentUpdateLensReviewInput(v *UpdateLensReviewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LensNotes != nil { + ok := object.Key("LensNotes") + ok.String(*v.LensNotes) + } + + if v.PillarNotes != nil { + ok := object.Key("PillarNotes") + if err := awsRestjson1_serializeDocumentPillarNotes(v.PillarNotes, ok); err != nil { + return err + } + } + + 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" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_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.SelectedChoices != nil { - ok := object.Key("SelectedChoices") - if err := awsRestjson1_serializeDocumentSelectedChoices(v.SelectedChoices, ok); err != nil { + if v.ProfileQuestions != nil { + ok := object.Key("ProfileQuestions") + if err := awsRestjson1_serializeDocumentProfileQuestionUpdates(v.ProfileQuestions, ok); err != nil { return err } } @@ -4095,14 +5187,14 @@ func awsRestjson1_serializeOpDocumentUpdateAnswerInput(v *UpdateAnswerInput, val return nil } -type awsRestjson1_serializeOpUpdateGlobalSettings struct { +type awsRestjson1_serializeOpUpdateReviewTemplate struct { } -func (*awsRestjson1_serializeOpUpdateGlobalSettings) ID() string { +func (*awsRestjson1_serializeOpUpdateReviewTemplate) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateGlobalSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateReviewTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -4110,13 +5202,13 @@ func (m *awsRestjson1_serializeOpUpdateGlobalSettings) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateGlobalSettingsInput) + input, ok := in.Parameters.(*UpdateReviewTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/global-settings") + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates/{TemplateArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" @@ -4132,10 +5224,14 @@ func (m *awsRestjson1_serializeOpUpdateGlobalSettings) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } + if err := awsRestjson1_serializeOpHttpBindingsUpdateReviewTemplateInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateGlobalSettingsInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateReviewTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -4150,39 +5246,67 @@ func (m *awsRestjson1_serializeOpUpdateGlobalSettings) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateGlobalSettingsInput(v *UpdateGlobalSettingsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateReviewTemplateInput(v *UpdateReviewTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} + } + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { + return err + } + } + return nil } -func awsRestjson1_serializeOpDocumentUpdateGlobalSettingsInput(v *UpdateGlobalSettingsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateReviewTemplateInput(v *UpdateReviewTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.DiscoveryIntegrationStatus) > 0 { - ok := object.Key("DiscoveryIntegrationStatus") - ok.String(string(v.DiscoveryIntegrationStatus)) + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) } - if len(v.OrganizationSharingStatus) > 0 { - ok := object.Key("OrganizationSharingStatus") - ok.String(string(v.OrganizationSharingStatus)) + if v.LensesToAssociate != nil { + ok := object.Key("LensesToAssociate") + if err := awsRestjson1_serializeDocumentReviewTemplateLensAliases(v.LensesToAssociate, ok); err != nil { + return err + } + } + + if v.LensesToDisassociate != nil { + ok := object.Key("LensesToDisassociate") + if err := awsRestjson1_serializeDocumentReviewTemplateLensAliases(v.LensesToDisassociate, ok); err != nil { + return err + } + } + + if v.Notes != nil { + ok := object.Key("Notes") + ok.String(*v.Notes) + } + + if v.TemplateName != nil { + ok := object.Key("TemplateName") + ok.String(*v.TemplateName) } return nil } -type awsRestjson1_serializeOpUpdateLensReview struct { +type awsRestjson1_serializeOpUpdateReviewTemplateAnswer struct { } -func (*awsRestjson1_serializeOpUpdateLensReview) ID() string { +func (*awsRestjson1_serializeOpUpdateReviewTemplateAnswer) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateLensReview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateReviewTemplateAnswer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -4190,13 +5314,13 @@ func (m *awsRestjson1_serializeOpUpdateLensReview) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateLensReviewInput) + input, ok := in.Parameters.(*UpdateReviewTemplateAnswerInput) _ = 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}") + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates/{TemplateArn}/lensReviews/{LensAlias}/answers/{QuestionId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" @@ -4212,14 +5336,14 @@ func (m *awsRestjson1_serializeOpUpdateLensReview) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateLensReviewInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsUpdateReviewTemplateAnswerInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateLensReviewInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateReviewTemplateAnswerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -4234,7 +5358,7 @@ func (m *awsRestjson1_serializeOpUpdateLensReview) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateLensReviewInput(v *UpdateLensReviewInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateReviewTemplateAnswerInput(v *UpdateReviewTemplateAnswerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -4248,11 +5372,20 @@ func awsRestjson1_serializeOpHttpBindingsUpdateLensReviewInput(v *UpdateLensRevi } } - if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + if v.QuestionId == nil || len(*v.QuestionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QuestionId must not be empty")} } - if v.WorkloadId != nil { - if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + if v.QuestionId != nil { + if err := encoder.SetURI("QuestionId").String(*v.QuestionId); err != nil { + return err + } + } + + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} + } + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { return err } } @@ -4260,18 +5393,35 @@ func awsRestjson1_serializeOpHttpBindingsUpdateLensReviewInput(v *UpdateLensRevi return nil } -func awsRestjson1_serializeOpDocumentUpdateLensReviewInput(v *UpdateLensReviewInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateReviewTemplateAnswerInput(v *UpdateReviewTemplateAnswerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.LensNotes != nil { - ok := object.Key("LensNotes") - ok.String(*v.LensNotes) + if v.ChoiceUpdates != nil { + ok := object.Key("ChoiceUpdates") + if err := awsRestjson1_serializeDocumentChoiceUpdates(v.ChoiceUpdates, ok); err != nil { + return err + } } - if v.PillarNotes != nil { - ok := object.Key("PillarNotes") - if err := awsRestjson1_serializeDocumentPillarNotes(v.PillarNotes, ok); err != nil { + if v.IsApplicable { + ok := object.Key("IsApplicable") + ok.Boolean(v.IsApplicable) + } + + if v.Notes != nil { + ok := object.Key("Notes") + ok.String(*v.Notes) + } + + if len(v.Reason) > 0 { + ok := object.Key("Reason") + ok.String(string(v.Reason)) + } + + if v.SelectedChoices != nil { + ok := object.Key("SelectedChoices") + if err := awsRestjson1_serializeDocumentSelectedChoices(v.SelectedChoices, ok); err != nil { return err } } @@ -4279,14 +5429,14 @@ func awsRestjson1_serializeOpDocumentUpdateLensReviewInput(v *UpdateLensReviewIn return nil } -type awsRestjson1_serializeOpUpdateProfile struct { +type awsRestjson1_serializeOpUpdateReviewTemplateLensReview struct { } -func (*awsRestjson1_serializeOpUpdateProfile) ID() string { +func (*awsRestjson1_serializeOpUpdateReviewTemplateLensReview) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateReviewTemplateLensReview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -4294,13 +5444,13 @@ func (m *awsRestjson1_serializeOpUpdateProfile) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateProfileInput) + input, ok := in.Parameters.(*UpdateReviewTemplateLensReviewInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/profiles/{ProfileArn}") + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates/{TemplateArn}/lensReviews/{LensAlias}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" @@ -4316,14 +5466,14 @@ func (m *awsRestjson1_serializeOpUpdateProfile) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateProfileInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsUpdateReviewTemplateLensReviewInput(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 { + if err := awsRestjson1_serializeOpDocumentUpdateReviewTemplateLensReviewInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -4338,16 +5488,25 @@ func (m *awsRestjson1_serializeOpUpdateProfile) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateProfileInput(v *UpdateProfileInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateReviewTemplateLensReviewInput(v *UpdateReviewTemplateLensReviewInput, 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.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} } - if v.ProfileArn != nil { - if err := encoder.SetURI("ProfileArn").String(*v.ProfileArn); err != nil { + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} + } + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { return err } } @@ -4355,18 +5514,18 @@ func awsRestjson1_serializeOpHttpBindingsUpdateProfileInput(v *UpdateProfileInpu return nil } -func awsRestjson1_serializeOpDocumentUpdateProfileInput(v *UpdateProfileInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateReviewTemplateLensReviewInput(v *UpdateReviewTemplateLensReviewInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ProfileDescription != nil { - ok := object.Key("ProfileDescription") - ok.String(*v.ProfileDescription) + if v.LensNotes != nil { + ok := object.Key("LensNotes") + ok.String(*v.LensNotes) } - if v.ProfileQuestions != nil { - ok := object.Key("ProfileQuestions") - if err := awsRestjson1_serializeDocumentProfileQuestionUpdates(v.ProfileQuestions, ok); err != nil { + if v.PillarNotes != nil { + ok := object.Key("PillarNotes") + if err := awsRestjson1_serializeDocumentPillarNotes(v.PillarNotes, ok); err != nil { return err } } @@ -4938,6 +6097,103 @@ func awsRestjson1_serializeOpDocumentUpgradeProfileVersionInput(v *UpgradeProfil return nil } +type awsRestjson1_serializeOpUpgradeReviewTemplateLensReview struct { +} + +func (*awsRestjson1_serializeOpUpgradeReviewTemplateLensReview) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpgradeReviewTemplateLensReview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpgradeReviewTemplateLensReviewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/reviewTemplates/{TemplateArn}/lensReviews/{LensAlias}/upgrade") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpgradeReviewTemplateLensReviewInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpgradeReviewTemplateLensReviewInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpgradeReviewTemplateLensReviewInput(v *UpgradeReviewTemplateLensReviewInput, 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.TemplateArn == nil || len(*v.TemplateArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateArn must not be empty")} + } + if v.TemplateArn != nil { + if err := encoder.SetURI("TemplateArn").String(*v.TemplateArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpgradeReviewTemplateLensReviewInput(v *UpgradeReviewTemplateLensReviewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + return nil +} + func awsRestjson1_serializeDocumentChoiceUpdate(v *types.ChoiceUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5039,6 +6295,39 @@ func awsRestjson1_serializeDocumentProfileQuestionUpdates(v []types.ProfileQuest return nil } +func awsRestjson1_serializeDocumentReviewTemplateArns(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_serializeDocumentReviewTemplateLensAliases(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_serializeDocumentReviewTemplateLenses(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_serializeDocumentSelectedChoices(v []string, 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 b3ce2c518d0..e962c56f330 100644 --- a/service/wellarchitected/types/enums.go +++ b/service/wellarchitected/types/enums.go @@ -396,6 +396,24 @@ func (ProfileOwnerType) Values() []ProfileOwnerType { } } +type Question string + +// Enum values for Question +const ( + QuestionUnanswered Question = "UNANSWERED" + QuestionAnswered Question = "ANSWERED" +) + +// Values returns all known values for Question. 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 (Question) Values() []Question { + return []Question{ + "UNANSWERED", + "ANSWERED", + } +} + type QuestionPriority string // Enum values for QuestionPriority @@ -450,6 +468,42 @@ func (ReportFormat) Values() []ReportFormat { } } +type ReviewTemplateAnswerStatus string + +// Enum values for ReviewTemplateAnswerStatus +const ( + ReviewTemplateAnswerStatusUnanswered ReviewTemplateAnswerStatus = "UNANSWERED" + ReviewTemplateAnswerStatusAnswered ReviewTemplateAnswerStatus = "ANSWERED" +) + +// Values returns all known values for ReviewTemplateAnswerStatus. 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 (ReviewTemplateAnswerStatus) Values() []ReviewTemplateAnswerStatus { + return []ReviewTemplateAnswerStatus{ + "UNANSWERED", + "ANSWERED", + } +} + +type ReviewTemplateUpdateStatus string + +// Enum values for ReviewTemplateUpdateStatus +const ( + ReviewTemplateUpdateStatusCurrent ReviewTemplateUpdateStatus = "CURRENT" + ReviewTemplateUpdateStatusLensNotCurrent ReviewTemplateUpdateStatus = "LENS_NOT_CURRENT" +) + +// Values returns all known values for ReviewTemplateUpdateStatus. 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 (ReviewTemplateUpdateStatus) Values() []ReviewTemplateUpdateStatus { + return []ReviewTemplateUpdateStatus{ + "CURRENT", + "LENS_NOT_CURRENT", + } +} + type Risk string // Enum values for Risk @@ -499,6 +553,7 @@ const ( ShareResourceTypeWorkload ShareResourceType = "WORKLOAD" ShareResourceTypeLens ShareResourceType = "LENS" ShareResourceTypeProfile ShareResourceType = "PROFILE" + ShareResourceTypeTemplate ShareResourceType = "TEMPLATE" ) // Values returns all known values for ShareResourceType. Note that this can be @@ -509,6 +564,7 @@ func (ShareResourceType) Values() []ShareResourceType { "WORKLOAD", "LENS", "PROFILE", + "TEMPLATE", } } diff --git a/service/wellarchitected/types/types.go b/service/wellarchitected/types/types.go index 6616f536671..a5fd5afbe8c 100644 --- a/service/wellarchitected/types/types.go +++ b/service/wellarchitected/types/types.go @@ -48,7 +48,8 @@ type Answer struct { // Defines whether this question is applicable to a lens review. IsApplicable bool - // The notes associated with the workload. + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. Notes *string // The ID used to identify a pillar, for example, security . A pillar is identified @@ -452,7 +453,8 @@ type LensReview struct { // The token to use to retrieve the next set of results. NextToken *string - // The notes associated with the workload. + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. Notes *string // List of pillar review summaries of lens review in a workload. @@ -541,8 +543,8 @@ type LensShareSummary 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. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. SharedWith *string // The status of the share request. @@ -617,6 +619,14 @@ type LensUpgradeSummary struct { // The ARN for the lens. LensArn *string + // ResourceArn of the lens being upgraded + ResourceArn *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. + ResourceName *string + // The ID assigned to the workload. This ID is unique within an Amazon Web // Services Region. WorkloadId *string @@ -717,7 +727,8 @@ type PillarMetric struct { // A pillar review summary of a lens review. type PillarReviewSummary struct { - // The notes associated with the workload. + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. Notes *string // The ID used to identify a pillar, for example, security . A pillar is identified @@ -862,8 +873,8 @@ 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. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. SharedWith *string // The status of the share request. @@ -990,6 +1001,233 @@ type QuestionMetric struct { noSmithyDocumentSerde } +// A review template. +type ReviewTemplate struct { + + // The review template description. + Description *string + + // The lenses applied to the review template. + Lenses []string + + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. + Notes *string + + // An Amazon Web Services account ID. + Owner *string + + // A count of how many total questions are answered and unanswered in the review + // template. + QuestionCounts map[string]int32 + + // The ID assigned to the template share invitation. + ShareInvitationId *string + + // The tags assigned to the review template. + Tags map[string]string + + // The review template ARN. + TemplateArn *string + + // The name of the review template. + TemplateName *string + + // The latest status of a review template. + UpdateStatus ReviewTemplateUpdateStatus + + // The date and time recorded. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// An answer of the question. +type ReviewTemplateAnswer struct { + + // The status of whether or not this question has been answered. + AnswerStatus ReviewTemplateAnswerStatus + + // A list of selected choices to a question in your review template. + ChoiceAnswers []ChoiceAnswer + + // List of choices available for a question. + Choices []Choice + + // The helpful resource text to be displayed for a custom lens. This field does + // not apply to Amazon Web Services official lenses. + HelpfulResourceDisplayText *string + + // The helpful resource URL. For Amazon Web Services official lenses, this is the + // helpful resource URL for a question or choice. For custom lenses, this is the + // helpful resource URL for a question and is only provided if + // HelpfulResourceDisplayText was specified for the question. + HelpfulResourceUrl *string + + // The improvement plan URL for a question in an Amazon Web Services official + // lenses. This value is only available if the question has been answered. This + // value does not apply to custom lenses. + ImprovementPlanUrl *string + + // Defines whether this question is applicable to a lens review. + IsApplicable bool + + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. + Notes *string + + // The ID used to identify a pillar, for example, security . A pillar is identified + // by its PillarReviewSummary$PillarId . + PillarId *string + + // The description of the question. + QuestionDescription *string + + // The ID of the question. + QuestionId *string + + // The title of the question. + QuestionTitle *string + + // The reason why the question is not applicable to your review template. + Reason AnswerReason + + // List of selected choice IDs in a question answer. The values entered replace + // the previously selected choices. + SelectedChoices []string + + noSmithyDocumentSerde +} + +// The summary of review template answers. +type ReviewTemplateAnswerSummary struct { + + // The status of whether or not this question has been answered. + AnswerStatus ReviewTemplateAnswerStatus + + // A list of selected choices to a question in the review template. + ChoiceAnswerSummaries []ChoiceAnswerSummary + + // List of choices available for a question. + Choices []Choice + + // Defines whether this question is applicable to a lens review. + IsApplicable bool + + // The ID used to identify a pillar, for example, security . A pillar is identified + // by its PillarReviewSummary$PillarId . + PillarId *string + + // The ID of the question. + QuestionId *string + + // The title of the question. + QuestionTitle *string + + // The type of question. + QuestionType QuestionType + + // The reason why a choice is not-applicable to a question in the review template. + Reason AnswerReason + + // List of selected choice IDs in a question answer. The values entered replace + // the previously selected choices. + SelectedChoices []string + + noSmithyDocumentSerde +} + +// The lens review of a review template. +type ReviewTemplateLensReview struct { + + // The alias of the lens. For Amazon Web Services official lenses, this is either + // the lens alias, such as serverless , or the lens ARN, such as + // arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef + // . Each lens is identified by its LensSummary$LensAlias . + LensAlias *string + + // The lens ARN. + LensArn *string + + // The full name of the lens. + LensName *string + + // The status of the lens. + LensStatus LensStatus + + // The version of the lens. + LensVersion *string + + // The token to use to retrieve the next set of results. + NextToken *string + + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. + Notes *string + + // Pillar review summaries of a lens review. + PillarReviewSummaries []ReviewTemplatePillarReviewSummary + + // A count of how many questions are answered and unanswered in the lens review. + QuestionCounts map[string]int32 + + // The date and time recorded. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Summary of a review template. +type ReviewTemplatePillarReviewSummary struct { + + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. + Notes *string + + // The ID used to identify a pillar, for example, security . A pillar is identified + // by its PillarReviewSummary$PillarId . + PillarId *string + + // The name of the pillar. + PillarName *string + + // A count of how many questions are answered and unanswered in the requested + // pillar of the lens review. + QuestionCounts map[string]int32 + + noSmithyDocumentSerde +} + +// Summary of a review template. +type ReviewTemplateSummary struct { + + // Description of the review template. + Description *string + + // Lenses associated with the review template. + Lenses []string + + // An Amazon Web Services account ID. + Owner *string + + // The review template ARN. + TemplateArn *string + + // The name of the review template. + TemplateName *string + + // The latest status of a review template. + UpdateStatus ReviewTemplateUpdateStatus + + // The date and time recorded. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + // The share invitation. type ShareInvitation struct { @@ -1014,6 +1252,9 @@ type ShareInvitation struct { // The resource type of the share invitation. ShareResourceType ShareResourceType + // The review template ARN. + TemplateArn *string + // The ID assigned to the workload. This ID is unique within an Amazon Web // Services Region. WorkloadId *string @@ -1048,10 +1289,16 @@ type ShareInvitationSummary struct { // 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, lens, or profile is shared. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. SharedWith *string + // The review template ARN. + TemplateArn *string + + // The name of the review template. + TemplateName *string + // The ID assigned to the workload. This ID is unique within an Amazon Web // Services Region. WorkloadId *string @@ -1064,6 +1311,25 @@ type ShareInvitationSummary struct { noSmithyDocumentSerde } +// Summary of a review template share. +type TemplateShareSummary struct { + + // The ID associated with the share. + ShareId *string + + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. + SharedWith *string + + // The status of the share request. + Status ShareStatus + + // Review template share invitation status message. + StatusMessage *string + + noSmithyDocumentSerde +} + // Stores information about a field passed inside a request that resulted in an // exception. type ValidationExceptionField struct { @@ -1158,13 +1424,16 @@ type Workload struct { IsReviewOwnerUpdateAcknowledged bool // The list of lenses associated with the workload. Each lens is identified by its - // LensSummary$LensAlias . + // LensSummary$LensAlias . If a review template that specifies lenses is applied to + // the workload, those lenses are applied to the workload in addition to these + // lenses. Lenses []string // The list of non-Amazon Web Services Regions associated with the workload. NonAwsRegions []string - // The notes associated with the workload. + // The notes associated with the workload. For a review template, these are the + // notes that will be associated with the workload when the template is applied. Notes *string // An Amazon Web Services account ID. @@ -1251,8 +1520,8 @@ type WorkloadShare struct { // 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, lens, or profile is shared. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. SharedWith *string // The status of the share request. @@ -1279,8 +1548,8 @@ type WorkloadShareSummary 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. + // The Amazon Web Services account ID, organization ID, or organizational unit + // (OU) ID with which the workload, lens, profile, or review template is shared. SharedWith *string // The status of the share request. @@ -1299,7 +1568,9 @@ type WorkloadSummary struct { ImprovementStatus WorkloadImprovementStatus // The list of lenses associated with the workload. Each lens is identified by its - // LensSummary$LensAlias . + // LensSummary$LensAlias . If a review template that specifies lenses is applied to + // the workload, those lenses are applied to the workload in addition to these + // lenses. Lenses []string // An Amazon Web Services account ID. diff --git a/service/wellarchitected/validators.go b/service/wellarchitected/validators.go index f7a4609dd68..58b4a311ec1 100644 --- a/service/wellarchitected/validators.go +++ b/service/wellarchitected/validators.go @@ -150,6 +150,46 @@ func (m *validateOpCreateProfileShare) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpCreateReviewTemplate struct { +} + +func (*validateOpCreateReviewTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateReviewTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateReviewTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateReviewTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateTemplateShare struct { +} + +func (*validateOpCreateTemplateShare) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTemplateShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTemplateShareInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTemplateShareInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateWorkload struct { } @@ -270,6 +310,46 @@ func (m *validateOpDeleteProfileShare) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDeleteReviewTemplate struct { +} + +func (*validateOpDeleteReviewTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteReviewTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteReviewTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteReviewTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteTemplateShare struct { +} + +func (*validateOpDeleteTemplateShare) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteTemplateShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteTemplateShareInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteTemplateShareInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteWorkload struct { } @@ -530,6 +610,66 @@ func (m *validateOpGetProfile) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpGetReviewTemplateAnswer struct { +} + +func (*validateOpGetReviewTemplateAnswer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetReviewTemplateAnswer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetReviewTemplateAnswerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetReviewTemplateAnswerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetReviewTemplate struct { +} + +func (*validateOpGetReviewTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetReviewTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetReviewTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetReviewTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetReviewTemplateLensReview struct { +} + +func (*validateOpGetReviewTemplateLensReview) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetReviewTemplateLensReview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetReviewTemplateLensReviewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetReviewTemplateLensReviewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetWorkload struct { } @@ -730,6 +870,26 @@ func (m *validateOpListProfileShares) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpListReviewTemplateAnswers struct { +} + +func (*validateOpListReviewTemplateAnswers) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListReviewTemplateAnswers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListReviewTemplateAnswersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListReviewTemplateAnswersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -750,6 +910,26 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListTemplateShares struct { +} + +func (*validateOpListTemplateShares) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTemplateShares) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTemplateSharesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTemplateSharesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListWorkloadShares struct { } @@ -870,6 +1050,66 @@ func (m *validateOpUpdateProfile) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateReviewTemplateAnswer struct { +} + +func (*validateOpUpdateReviewTemplateAnswer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateReviewTemplateAnswer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateReviewTemplateAnswerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateReviewTemplateAnswerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateReviewTemplate struct { +} + +func (*validateOpUpdateReviewTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateReviewTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateReviewTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateReviewTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateReviewTemplateLensReview struct { +} + +func (*validateOpUpdateReviewTemplateLensReview) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateReviewTemplateLensReview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateReviewTemplateLensReviewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateReviewTemplateLensReviewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateShareInvitation struct { } @@ -970,6 +1210,26 @@ func (m *validateOpUpgradeProfileVersion) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpUpgradeReviewTemplateLensReview struct { +} + +func (*validateOpUpgradeReviewTemplateLensReview) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpgradeReviewTemplateLensReview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpgradeReviewTemplateLensReviewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpgradeReviewTemplateLensReviewInput(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) } @@ -998,6 +1258,14 @@ func addOpCreateProfileShareValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpCreateProfileShare{}, middleware.After) } +func addOpCreateReviewTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateReviewTemplate{}, middleware.After) +} + +func addOpCreateTemplateShareValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTemplateShare{}, middleware.After) +} + func addOpCreateWorkloadValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorkload{}, middleware.After) } @@ -1022,6 +1290,14 @@ func addOpDeleteProfileShareValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDeleteProfileShare{}, middleware.After) } +func addOpDeleteReviewTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteReviewTemplate{}, middleware.After) +} + +func addOpDeleteTemplateShareValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteTemplateShare{}, middleware.After) +} + func addOpDeleteWorkloadValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteWorkload{}, middleware.After) } @@ -1074,6 +1350,18 @@ func addOpGetProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetProfile{}, middleware.After) } +func addOpGetReviewTemplateAnswerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetReviewTemplateAnswer{}, middleware.After) +} + +func addOpGetReviewTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetReviewTemplate{}, middleware.After) +} + +func addOpGetReviewTemplateLensReviewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetReviewTemplateLensReview{}, middleware.After) +} + func addOpGetWorkloadValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetWorkload{}, middleware.After) } @@ -1114,10 +1402,18 @@ func addOpListProfileSharesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListProfileShares{}, middleware.After) } +func addOpListReviewTemplateAnswersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListReviewTemplateAnswers{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpListTemplateSharesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTemplateShares{}, middleware.After) +} + func addOpListWorkloadSharesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListWorkloadShares{}, middleware.After) } @@ -1142,6 +1438,18 @@ func addOpUpdateProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateProfile{}, middleware.After) } +func addOpUpdateReviewTemplateAnswerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateReviewTemplateAnswer{}, middleware.After) +} + +func addOpUpdateReviewTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateReviewTemplate{}, middleware.After) +} + +func addOpUpdateReviewTemplateLensReviewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateReviewTemplateLensReview{}, middleware.After) +} + func addOpUpdateShareInvitationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateShareInvitation{}, middleware.After) } @@ -1162,6 +1470,10 @@ func addOpUpgradeProfileVersionValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpUpgradeProfileVersion{}, middleware.After) } +func addOpUpgradeReviewTemplateLensReviewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpgradeReviewTemplateLensReview{}, middleware.After) +} + func validateChoiceUpdate(v *types.ChoiceUpdate) error { if v == nil { return nil @@ -1339,6 +1651,51 @@ func validateOpCreateProfileShareInput(v *CreateProfileShareInput) error { } } +func validateOpCreateReviewTemplateInput(v *CreateReviewTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateReviewTemplateInput"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if v.Lenses == nil { + invalidParams.Add(smithy.NewErrParamRequired("Lenses")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateTemplateShareInput(v *CreateTemplateShareInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTemplateShareInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + 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 @@ -1471,6 +1828,45 @@ func validateOpDeleteProfileShareInput(v *DeleteProfileShareInput) error { } } +func validateOpDeleteReviewTemplateInput(v *DeleteReviewTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteReviewTemplateInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteTemplateShareInput(v *DeleteTemplateShareInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteTemplateShareInput"} + if v.ShareId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ShareId")) + } + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + 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 @@ -1693,6 +2089,60 @@ func validateOpGetProfileInput(v *GetProfileInput) error { } } +func validateOpGetReviewTemplateAnswerInput(v *GetReviewTemplateAnswerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetReviewTemplateAnswerInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if v.QuestionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuestionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetReviewTemplateInput(v *GetReviewTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetReviewTemplateInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetReviewTemplateLensReviewInput(v *GetReviewTemplateLensReviewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetReviewTemplateLensReviewInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetWorkloadInput(v *GetWorkloadInput) error { if v == nil { return nil @@ -1876,6 +2326,24 @@ func validateOpListProfileSharesInput(v *ListProfileSharesInput) error { } } +func validateOpListReviewTemplateAnswersInput(v *ListReviewTemplateAnswersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListReviewTemplateAnswersInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -1891,6 +2359,21 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpListTemplateSharesInput(v *ListTemplateSharesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTemplateSharesInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListWorkloadSharesInput(v *ListWorkloadSharesInput) error { if v == nil { return nil @@ -2001,6 +2484,65 @@ func validateOpUpdateProfileInput(v *UpdateProfileInput) error { } } +func validateOpUpdateReviewTemplateAnswerInput(v *UpdateReviewTemplateAnswerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateReviewTemplateAnswerInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if v.QuestionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuestionId")) + } + if v.ChoiceUpdates != nil { + if err := validateChoiceUpdates(v.ChoiceUpdates); err != nil { + invalidParams.AddNested("ChoiceUpdates", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateReviewTemplateInput(v *UpdateReviewTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateReviewTemplateInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateReviewTemplateLensReviewInput(v *UpdateReviewTemplateLensReviewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateReviewTemplateLensReviewInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateShareInvitationInput(v *UpdateShareInvitationInput) error { if v == nil { return nil @@ -2093,3 +2635,21 @@ func validateOpUpgradeProfileVersionInput(v *UpgradeProfileVersionInput) error { return nil } } + +func validateOpUpgradeReviewTemplateLensReviewInput(v *UpgradeReviewTemplateLensReviewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpgradeReviewTemplateLensReviewInput"} + if v.TemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateArn")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +}